public class DefaultBlockIterator extends Object implements BlockIterator
BlockIterator
implementation that integrates with the
BlockMetadataManager
.Constructor and Description |
---|
DefaultBlockIterator(BlockMetadataManager metaManager,
BlockAnnotator blockAnnotator)
Creates default block iterator instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
aligned(BlockStoreLocation srcLocation,
BlockStoreLocation dstLocation,
BlockOrder order,
java.util.function.Function<Long,Boolean> blockFilterFunc)
Used to detect presence of an overlap between two locations.
|
List<Long> |
getIntersectionList(BlockStoreLocation srcLocation,
BlockOrder srcOrder,
BlockStoreLocation dstLocation,
BlockOrder dstOrder,
int intersectionWidth,
BlockOrder intersectionOrder,
java.util.function.Function<Long,Boolean> blockFilterFunc)
Used to get blocks within an intersection of locations in sorted order.
|
Iterator<Long> |
getIterator(BlockStoreLocation location,
BlockOrder order)
Gets an iterator of block-Ids.
|
List<BlockStoreEventListener> |
getListeners()
Used to acquire and register listeners that are used by this iterator.
|
Pair<List<Long>,List<Long>> |
getSwaps(BlockStoreLocation srcLocation,
BlockOrder srcOrder,
BlockStoreLocation dstLocation,
BlockOrder dstOrder,
int swapRange,
BlockOrder intersectionOrder,
java.util.function.Function<Long,Boolean> blockFilterFunc)
Used to list of blocks, that if swapped, could eliminate overlap between two tiers.
|
public DefaultBlockIterator(BlockMetadataManager metaManager, BlockAnnotator blockAnnotator)
metaManager
- meta managerblockAnnotator
- block annotatorpublic List<BlockStoreEventListener> getListeners()
BlockIterator
getListeners
in interface BlockIterator
public Iterator<Long> getIterator(BlockStoreLocation location, BlockOrder order)
BlockIterator
getIterator
in interface BlockIterator
location
- location to iterate for blocksorder
- order of blockspublic List<Long> getIntersectionList(BlockStoreLocation srcLocation, BlockOrder srcOrder, BlockStoreLocation dstLocation, BlockOrder dstOrder, int intersectionWidth, BlockOrder intersectionOrder, java.util.function.Function<Long,Boolean> blockFilterFunc)
BlockIterator
getIntersectionList
in interface BlockIterator
srcLocation
- source locationsrcOrder
- order for the source locationdstLocation
- destination locationdstOrder
- order for the destination locationintersectionWidth
- width of intersectionintersectionOrder
- the order of intersected blocksblockFilterFunc
- a filter for blockspublic Pair<List<Long>,List<Long>> getSwaps(BlockStoreLocation srcLocation, BlockOrder srcOrder, BlockStoreLocation dstLocation, BlockOrder dstOrder, int swapRange, BlockOrder intersectionOrder, java.util.function.Function<Long,Boolean> blockFilterFunc)
BlockIterator
getSwaps
in interface BlockIterator
srcLocation
- source locationsrcOrder
- order for the source locationdstLocation
- destination locationdstOrder
- order for the destination locationswapRange
- per-tier range of swapintersectionOrder
- the order of intersected blocksblockFilterFunc
- a filter for blockspublic boolean aligned(BlockStoreLocation srcLocation, BlockStoreLocation dstLocation, BlockOrder order, java.util.function.Function<Long,Boolean> blockFilterFunc)
BlockIterator
aligned
in interface BlockIterator
srcLocation
- source locationdstLocation
- destination locationorder
- order of comparison between locationsblockFilterFunc
- a filter for blockstrue
if tiers are alignedCopyright © 2023. All Rights Reserved.