Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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() {
@Override
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.
table.setAutoFlush(false);
return table;
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
@Override
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.