public class ReceivedBlockTracker extends Object implements Logging
Note that when any instance of this class is created with a checkpoint directory, it will try reading events from logs in the directory.
Constructor and Description |
---|
ReceivedBlockTracker(SparkConf conf,
org.apache.hadoop.conf.Configuration hadoopConf,
scala.collection.Seq<Object> streamIds,
Clock clock,
scala.Option<String> checkpointDirOption) |
Modifier and Type | Method and Description |
---|---|
boolean |
addBlock(ReceivedBlockInfo receivedBlockInfo)
Add received block.
|
void |
allocateBlocksToBatch(Time batchTime)
Allocate all unallocated blocks to the given batch.
|
static String |
checkpointDirToLogDir(String checkpointDir) |
void |
cleanupOldBatches(Time cleanupThreshTime)
Clean up block information of old batches.
|
scala.collection.immutable.Map<Object,scala.collection.Seq<ReceivedBlockInfo>> |
getBlocksOfBatch(Time batchTime)
Get the blocks allocated to the given batch.
|
scala.collection.Seq<ReceivedBlockInfo> |
getBlocksOfBatchAndStream(Time batchTime,
int streamId)
Get the blocks allocated to the given batch and stream.
|
scala.collection.Seq<ReceivedBlockInfo> |
getUnallocatedBlocks(int streamId)
Get blocks that have been added but not yet allocated to any batch.
|
boolean |
hasUnallocatedReceivedBlocks()
Check if any blocks are left to be allocated to batches.
|
boolean |
isLogManagerEnabled()
Check if the log manager is enabled.
|
void |
stop()
Stop the block tracker.
|
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 static String checkpointDirToLogDir(String checkpointDir)
public boolean addBlock(ReceivedBlockInfo receivedBlockInfo)
public void allocateBlocksToBatch(Time batchTime)
public scala.collection.immutable.Map<Object,scala.collection.Seq<ReceivedBlockInfo>> getBlocksOfBatch(Time batchTime)
public scala.collection.Seq<ReceivedBlockInfo> getBlocksOfBatchAndStream(Time batchTime, int streamId)
public boolean hasUnallocatedReceivedBlocks()
public scala.collection.Seq<ReceivedBlockInfo> getUnallocatedBlocks(int streamId)
public void cleanupOldBatches(Time cleanupThreshTime)
public void stop()
public boolean isLogManagerEnabled()