@ThreadSafe public final class EvictorUtils extends Object
Modifier and Type | Method and Description |
---|---|
static StorageDirView |
getDirWithMaxFreeSpace(long bytesToBeAvailable,
BlockStoreLocation location,
BlockMetadataEvictorView metadataView)
Gets
StorageDirView with max free space. |
static StorageDirView |
selectDirWithRequestedSpace(long bytesToBeAvailable,
BlockStoreLocation location,
BlockMetadataEvictorView mManagerView)
Finds a directory in the given location range with capacity upwards of the given bound.
|
public static StorageDirView getDirWithMaxFreeSpace(long bytesToBeAvailable, BlockStoreLocation location, BlockMetadataEvictorView metadataView)
StorageDirView
with max free space.bytesToBeAvailable
- space size to be requestedlocation
- location that the space will be allocated inmetadataView
- a view of block metadata informationStorageDirView
selected@Nullable public static StorageDirView selectDirWithRequestedSpace(long bytesToBeAvailable, BlockStoreLocation location, BlockMetadataEvictorView mManagerView)
bytesToBeAvailable
- the capacity boundlocation
- the location rangemManagerView
- the storage manager viewStorageDirView
in the range of location that already
has availableBytes larger than bytesToBeAvailable, otherwise nullCopyright © 2023. All Rights Reserved.