public class EmulatingBlockIterator extends Object implements BlockIterator
Evictor
implementations.
It works by assuming an order in the eviction plan generated by the evictor.Constructor and Description |
---|
EmulatingBlockIterator(BlockMetadataManager metadataManager,
Evictor evictor)
Creates a block iterator that emulates an
Evictor . |
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 EmulatingBlockIterator(BlockMetadataManager metadataManager, Evictor evictor)
Evictor
.metadataManager
- the metadata managerevictor
- the evictorpublic 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 alignedpublic List<BlockStoreEventListener> getListeners()
BlockIterator
getListeners
in interface BlockIterator
Copyright © 2023. All Rights Reserved.