}
@Test
public void randomConcurrentTest() throws HBqlException, InterruptedException {
final HConnectionPool connectionPool = HConnectionPoolManager.newConnectionPool(1, 4);
final int queryPoolCnt = 5;
for (int p = 1; p <= queryPoolCnt; p++) {
final String poolName = "execPool" + p;
System.out.println("Creating query executor pool: " + poolName);
QueryExecutorPoolManager.newQueryExecutorPool(poolName,
Utils.getRandomPositiveInt(5),
Utils.getRandomPositiveInt(2),
Utils.getRandomPositiveInt(5),
Long.MAX_VALUE,
Utils.getRandomBoolean(),
Utils.getRandomPositiveInt(10));
}
final int poolSize = Utils.getRandomPositiveInt(10);
final ExecutorService threadPool = Executors.newFixedThreadPool(poolSize);
final int repeats = 10;
for (int i = 0; i < repeats; i++) {
final int totalJobs = Utils.getRandomPositiveInt(50);
final int keyCount = Utils.getRandomPositiveInt(50);
final CountDownLatch latch = new CountDownLatch(totalJobs);
for (int tj = 0; tj < totalJobs; tj++) {
final int jobNum = tj;
threadPool.submit(
new Runnable() {
public void run() {
HConnection conn = null;
try {
conn = connectionPool.takeConnection();
conn.setQueryExecutorPoolName("execPool" + Utils.getRandomPositiveInt(queryPoolCnt));
conn.execute("CREATE TEMP MAPPING tab3 FOR TABLE table20"
+ "("