Пример #1
0
    private void executeNextBlock(Query query) {
      ExecutionBlockCursor cursor = query.getExecutionBlockCursor();
      ExecutionBlock nextBlock = cursor.nextBlock();
      SubQuery nextSubQuery = new SubQuery(query.context, query.getPlan(), nextBlock, query.sm);
      nextSubQuery.setPriority(query.priority--);
      query.addSubQuery(nextSubQuery);
      nextSubQuery.handle(new SubQueryEvent(nextSubQuery.getId(), SubQueryEventType.SQ_INIT));

      LOG.info("Scheduling SubQuery:" + nextSubQuery.getId());
      if (LOG.isDebugEnabled()) {
        LOG.debug("Scheduling SubQuery's Priority: " + nextSubQuery.getPriority());
        LOG.debug("Scheduling SubQuery's Plan: \n" + nextSubQuery.getBlock().getPlan());
      }
    }
Пример #2
0
 private boolean hasNext(Query query) {
   ExecutionBlockCursor cursor = query.getExecutionBlockCursor();
   ExecutionBlock nextBlock = cursor.peek();
   return !query.getPlan().isTerminal(nextBlock);
 }