// START SNIPPET: create-query-executor-pool
HConnection conn = HConnectionManager.newConnection();
// Create Query Executor Pool named execPool if it doesn't already exist.
conn.execute("CREATE QUERY EXECUTOR POOL execPool (MAX_EXECUTOR_POOL_SIZE: 5, MAX_THREAD_COUNT: 10) IF NOT queryExecutorPoolExists('execPool')");
// Or, using the API
if (!QueryExecutorPoolManager.queryExecutorPoolExists("execPool"))
QueryExecutorPoolManager.newQueryExecutorPool("execPool", 5, 5, 10, Long.MAX_VALUE, true, 100);