public class BlockGenerator extends RateLimiter implements Logging
Receiver
and puts them into appropriately
named blocks at regular intervals. This class starts two threads,
one to periodically start a new batch and prepare the previous batch of as a block,
the other to push the blocks into the block manager.Constructor and Description |
---|
BlockGenerator(BlockGeneratorListener listener,
int receiverId,
SparkConf conf) |
Modifier and Type | Method and Description |
---|---|
void |
addData(Object data)
Push a single data item into the buffer.
|
void |
addDataWithCallback(Object data,
Object metadata)
Push a single data item into the buffer.
|
void |
start()
Start block generating and pushing threads.
|
void |
stop()
Stop all threads.
|
waitToPush
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public BlockGenerator(BlockGeneratorListener listener, int receiverId, SparkConf conf)
public void start()
public void stop()
public void addData(Object data)
public void addDataWithCallback(Object data, Object metadata)
BlockGeneratorListener.onAddData
callback will be called. All received data items
will be periodically pushed into BlockManager.