Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Get a HTableInterface from HTablePool with autoFlush disabled (not needed in newer HBase versions, needed in 0.92.x).
// HBase bug 5728: setAutoFlush(boolean) is missing from HTableInterface.
// Solution: custom HTableInterfaceFactory (suggestion from the HBase user mailing-list)
HTablePool pool = new HTablePool(conf, Integer.MAX_VALUE, new HTableInterfaceFactory() {
public HTableInterface createHTableInterface(Configuration config, byte[] tableName) {
try {
HTable table = new HTable(config, tableName);
// Don't send out any RPC calls until the buffer is full to prevent generating one
// call per operation.
return table;
} catch (IOException ioe) {
throw new RuntimeException(ioe);
public void releaseHTableInterface(HTableInterface table) throws IOException {
// Do nothing. Required stub.
return pool;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.