What can I use instead of HTable(config,tablename)?   
This method is deprecated. In every example I could find they use this or another Constuctor, which is also deprecated.
Constructing HTable objects manually has been deprecated. Please use Connection to instantiate a Table instead. 
From a Connection, Table implementations are retrieved with Connection.getTable(TableName)
Example:
Connection connection = ConnectionFactory.createConnection(config);
Table table = connection.getTable(TableName.valueOf("table1"));
try 
{
   // Use the table as needed, for a single operation and a single thread
} 
finally
{
   table.close();
   connection.close();
}
Connection.getTable(TableName) is used only for retrieving Table.
If you need to create a table instead, use TableDescriptorBuilder and Admin.createTable(TableDescriptor).
For instance:
val tableDescriptor: TableDescriptor = TableDescriptorBuilder
                          .newBuilder(TableName.valueOf("mytable"))
                          .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder("myId".getBytes).build())
                          .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder("data".getBytes).build())
                          .build()
admin.createTable(tableDescriptor)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With