@Test( expected = IllegalArgumentException.class ) public void shouldFailWithEmptyTupleQueues () { drainer.setParameters( AT_LEAST, 1 ); drainer.drain( null, new TupleQueue[] {}, tuplesSupplier ); }
public final void setParameters ( final TupleAvailabilityByCount tupleAvailabilityByCount, final int tupleCount ) { checkArgument( tupleAvailabilityByCount != null ); checkArgument( tupleCount > 0, "invalid tuple count %s", tupleCount ); this.tupleCountToCheck = tupleCount; this.tupleCountToPoll = tupleAvailabilityByCount == EXACT ? tupleCount : max( tupleCount, maxBatchSize ); }
SinglePortDrainer implements TupleQueueDrainer { public final void setParameters ( final TupleAvailabilityByCount tupleAvailabilityByCount, final int tupleCount ) { checkArgument( tupleAvailabilityByCount != null ); checkArgument( tupleCount > 0, "invalid tuple count %s", tupleCount ); this.tupleCountToCheck = tupleCount; this.tupleCountToPoll = tupleAvailabilityByCount == EXACT ? tupleCount : max( tupleCount, maxBatchSize ); } }
SinglePortDrainer implements TupleQueueDrainer { public final void setParameters ( final TupleAvailabilityByCount tupleAvailabilityByCount, final int tupleCount ) { checkArgument( tupleAvailabilityByCount != null ); checkArgument( tupleCount > 0, "invalid tuple count %s", tupleCount ); this.tupleCountToCheck = tupleCount; this.tupleCountToPoll = tupleAvailabilityByCount == EXACT ? tupleCount : max( tupleCount, maxBatchSize ); } SinglePortDrainer( final int maxBatchSize ); }
SinglePortDrainer implements TupleQueueDrainer { public final void setParameters ( final TupleAvailabilityByCount tupleAvailabilityByCount, final int tupleCount ) { checkArgument( tupleAvailabilityByCount != null ); checkArgument( tupleCount > 0, "invalid tuple count %s", tupleCount ); this.tupleCountToCheck = tupleCount; this.tupleCountToPoll = tupleAvailabilityByCount == EXACT ? tupleCount : max( tupleCount, maxBatchSize ); } SinglePortDrainer( final int maxBatchSize ); final void setParameters( final TupleAvailabilityByCount tupleAvailabilityByCount, final int tupleCount ); }
SinglePortDrainer implements TupleQueueDrainer { public final void setParameters ( final TupleAvailabilityByCount tupleAvailabilityByCount, final int tupleCount ) { checkArgument( tupleAvailabilityByCount != null ); checkArgument( tupleCount > 0, "invalid tuple count %s", tupleCount ); this.tupleCountToCheck = tupleCount; this.tupleCountToPoll = tupleAvailabilityByCount == EXACT ? tupleCount : max( tupleCount, maxBatchSize ); } SinglePortDrainer( final int maxBatchSize ); final void setParameters( final TupleAvailabilityByCount tupleAvailabilityByCount, final int tupleCount );  }