org.apache.hadoop.chukwa.datacollection
Interface ChunkQueue

All Superinterfaces:
ChunkReceiver
All Known Implementing Classes:
MemLimitQueue, WaitingQueue

public interface ChunkQueue
extends ChunkReceiver

A generic interface for queues of Chunks. Differs from a normal queue interface primarily by having collect().


Method Summary
 void add(Chunk chunk)
          Add a chunk to the queue, blocking if queue is full.
 void collect(List<Chunk> chunks, int count)
          Return at least one, and no more than count, Chunks into chunks.
 int size()
          Return an approximation of the number of chunks in the queue currently.
 

Method Detail

add

void add(Chunk chunk)
         throws InterruptedException
Add a chunk to the queue, blocking if queue is full.

Specified by:
add in interface ChunkReceiver
Parameters:
chunk -
Throws:
InterruptedException - if thread is interrupted while blocking

collect

void collect(List<Chunk> chunks,
             int count)
             throws InterruptedException
Return at least one, and no more than count, Chunks into chunks. Blocks if queue is empty.

Throws:
InterruptedException

size

int size()
Return an approximation of the number of chunks in the queue currently. No guarantees are made about the accuracy of this number.



Copyright © ${year} The Apache Software Foundation