private boolean extractorQueueEmpty() throws InterruptedException {
  if (extractor.hasMoreEvents())   return false;
 else   if (blockCommitIntervalMillis <= 0)   return true;
 else {
    long nextCommitMillis=lastCommitMillis + blockCommitIntervalMillis;
    long sleepMillis=nextCommitMillis - System.currentTimeMillis();
    while (sleepMillis > 0) {
      Thread.sleep(1);
      if (extractor.hasMoreEvents())       return false;
      sleepMillis=nextCommitMillis - System.currentTimeMillis();
    }
    return true;
  }
}

private boolean extractorQueueEmpty ( ) throws InterruptedException { if ( extractor . hasMoreEvents ( ) ) return false ; else if ( blockCommitIntervalMillis <= 0 ) return true ; else { long nextCommitMillis = lastCommitMillis + blockCommitIntervalMillis ; long sleepMillis = nextCommitMillis - System . currentTimeMillis ( ) ; while ( sleepMillis > 0 ) { Thread . sleep ( 1 ) ; if ( extractor . hasMoreEvents ( ) ) return false ; sleepMillis = nextCommitMillis - System . currentTimeMillis ( ) ; } return true ; } }
determines whether the extractor queue is currently empty . if the queue is empty we wait up until the block commit interval using a quick sleep interval .
