final ListenableFutureTask<?> ft = ListenableFutureTask.create(new Runnable() {
@Override
public void run() {
if (result.errorMsg == null) {
if (result instanceof AdHocPlannedStmtBatch) {
final AdHocPlannedStmtBatch plannedStmtBatch = (AdHocPlannedStmtBatch) result;
// assume all stmts have the same catalog version
if ((plannedStmtBatch.getPlannedStatementCount() > 0) &&
(plannedStmtBatch.getPlannedStatement(0).core.catalogVersion != m_catalogContext.get().catalogVersion)) {
/* The adhoc planner learns of catalog updates after the EE and the
rest of the system. If the adhoc sql was planned against an
obsolete catalog, re-plan. */
LocalObjectMessage work = new LocalObjectMessage(
AdHocPlannerWork.rework(plannedStmtBatch.work, m_adhocCompletionHandler));
m_mailbox.send(m_plannerSiteId, work);
}
else if( plannedStmtBatch.isExplainWork() ) {
processExplainPlannedStmtBatch( plannedStmtBatch );
}
else {
try {
createAdHocTransaction(plannedStmtBatch, c);