Пример #1
0
 /** triggered if the last remaining upstream finished or failed */
 protected void onFinish() {
   assert !paused : "must not receive a finish call if upstream should be paused";
   for (Object[] objects : pauseFifo) {
     sharedRow.cells(objects);
     boolean wantMore = delegate.setNextRow(sharedRow);
     if (!wantMore) {
       break;
     }
   }
   delegate.finish();
 }
Пример #2
0
 protected boolean synchronizedSetNextRow(Row row) {
   if (paused) {
     pauseFifo.add(row.materialize());
     return true;
   } else {
     Object[] bufferedCells;
     while ((bufferedCells = pauseFifo.poll()) != null) {
       sharedRow.cells(bufferedCells);
       boolean wantMore = delegate.setNextRow(sharedRow);
       if (!wantMore) {
         return false;
       }
       if (paused) {
         pauseFifo.add(row.materialize());
         return true;
       }
     }
     return delegate.setNextRow(row);
   }
 }