question: 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 ; } }
target:  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.