Class MovedBlocks<L>
java.lang.Object
org.apache.hadoop.hdfs.server.balancer.MovedBlocks<L>
- Type Parameters:
L- Location type
This window makes sure to keep blocks that have been moved within a fixed
time interval (default is 1.5 hour). Old window has blocks that are older;
Current window has blocks that are more recent; Cleanup method triggers the
check if blocks in the old window are more than the fixed time interval. If
yes, purge the old window and then move blocks in current window to old
window.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class for keeping track of a block and its locations -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()remove old blocksbooleancontains(org.apache.hadoop.hdfs.protocol.Block block) voidput(MovedBlocks.Locations<L> block) add a block thus marking a block to be moved
-
Constructor Details
-
MovedBlocks
public MovedBlocks(long winTimeInterval) initialize the moved blocks collection
-
-
Method Details
-
put
add a block thus marking a block to be moved -
contains
public boolean contains(org.apache.hadoop.hdfs.protocol.Block block) - Returns:
- if a block is marked as moved
-
cleanup
public void cleanup()remove old blocks
-