public class NonBlockingMemLimitQueue extends Object implements ChunkQueue
Constructor and Description |
---|
NonBlockingMemLimitQueue(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
add(Chunk chunk)
Add a chunk to the queue, blocking if queue is full.
|
void |
collect(List<Chunk> events,
int maxSize)
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.
|
public NonBlockingMemLimitQueue(org.apache.hadoop.conf.Configuration conf)
public void add(Chunk chunk) throws InterruptedException
ChunkQueue
add
in interface ChunkQueue
add
in interface ChunkReceiver
chunk
- A binary blobInterruptedException
- if thread is interrupted while blockingChunkQueue.add(org.apache.hadoop.chukwa.Chunk)
public void collect(List<Chunk> events, int maxSize) throws InterruptedException
ChunkQueue
collect
in interface ChunkQueue
events
- List of binary blobsmaxSize
- maximum number of chunk to returnInterruptedException
- if thread is interrupted while collectingChunkQueue.collect(java.util.List,
int)
public int size()
ChunkQueue
size
in interface ChunkQueue
Copyright © 2016 Apache Software Foundation. All Rights Reserved.