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"
+ "("
+ "keyval key, "
+ "f1 ("
+ " val1 string alias val1, "
+ " val2 int alias val2, "
+ " val3 int alias val3 DEFAULT 12 "
+ "))");
final StringBuilder query = new StringBuilder("select * from tab3 WITH KEYS ");
final int rangeCount = Utils.getRandomPositiveInt(keyCount);
boolean firstTime = true;
for (int rc = 0; rc < rangeCount; rc++) {
if (!firstTime)
query.append(", ");
else
firstTime = false;
query.append("'0000000001'TO '0000000009' ");
}
query.append("SERVER FILTER where val1+'ss' BETWEEN '11ss' AND '13ss' ");
int recCnt = showValues(conn, query.toString(), rangeCount * 3, false);
System.out.println("Value count: " + recCnt + " for job: " + jobNum);
}
catch (HBqlException e) {
e.printStackTrace();
}
finally {
if (conn != null) {
conn.close();
}
latch.countDown();
}
}
});