// Create Query Executor Pool named execPool if it doesn't already exist.
if (!QueryExecutorPoolManager.queryExecutorPoolExists("execPool"))
QueryExecutorPoolManager.newQueryExecutorPool("execPool", 5, 5, 10, Long.MAX_VALUE, true, 100);
// Take a connection from the connection pool
HConnection conn = connectionPool.takeConnection();
// Assign the connection a query executor pool name to use for queries
conn.setQueryExecutorPoolName("execPool");
// Do something with the connection