/** * Drain from the input blocking queue to the output list up to maxItems elements. * * The coalescing strategy may choose to park the current thread if it thinks it will * be able to produce an output list with more elements. * * @param input Blocking queue to retrieve elements from * @param out Output list to place retrieved elements in. Must be empty. * @param maxItems Maximum number of elements to place in the output list */ public <C extends Coalescable> void coalesce(BlockingQueue<C> input, List<C> out, int maxItems) throws InterruptedException { Preconditions.checkArgument(out.isEmpty(), "out list should be empty"); coalesceInternal(input, out, maxItems); }
/** * Drain from the input blocking queue to the output list up to maxItems elements. * * The coalescing strategy may choose to park the current thread if it thinks it will * be able to produce an output list with more elements. * * @param input Blocking queue to retrieve elements from * @param out Output list to place retrieved elements in. Must be empty. * @param maxItems Maximum number of elements to place in the output list */ public <C extends Coalescable> void coalesce(BlockingQueue<C> input, List<C> out, int maxItems) throws InterruptedException { Preconditions.checkArgument(out.isEmpty(), "out list should be empty"); coalesceInternal(input, out, maxItems); }
/** * Drain from the input blocking queue to the output list up to maxItems elements. * * The coalescing strategy may choose to park the current thread if it thinks it will * be able to produce an output list with more elements. * * @param input Blocking queue to retrieve elements from * @param out Output list to place retrieved elements in. Must be empty. * @param maxItems Maximum number of elements to place in the output list */ public <C extends Coalescable> void coalesce(BlockingQueue<C> input, List<C> out, int maxItems) throws InterruptedException { Preconditions.checkArgument(out.isEmpty(), "out list should be empty"); coalesceInternal(input, out, maxItems); }
/** * Drain from the input blocking queue to the output list up to maxItems elements. * * The coalescing strategy may choose to park the current thread if it thinks it will * be able to produce an output list with more elements. * * @param input Blocking queue to retrieve elements from * @param out Output list to place retrieved elements in. Must be empty. * @param maxItems Maximum number of elements to place in the output list */ public <C extends Coalescable> void coalesce(BlockingQueue<C> input, List<C> out, int maxItems) throws InterruptedException { Preconditions.checkArgument(out.isEmpty(), "out list should be empty"); coalesceInternal(input, out, maxItems); }