, , thread-safe. , Table Admin, Connection
private static class ConnectionHolder{
private final Connection connection;
private ConnectionHolder(){
connection = ConnectionFactory.createConnection(config);
}
Connection getConnection(){
return connection;
}
}
, Connection, . Tables ResultScanners
Table getTable(String name){
Table table = connection.getTable(TableName.valueOf(name));
return table;
}
try(Table table = getTable("tableName")){
...
}