@ThreadSafe public final class EvictorUtils extends Object
Modifier and Type | Method and Description |
---|---|
static StorageDirView |
getDirWithMaxFreeSpace(long bytesToBeAvailable,
BlockStoreLocation location,
BlockMetadataManagerView mManagerView)
Gets
StorageDirView with max free space. |
static StorageDirView |
selectDirWithRequestedSpace(long bytesToBeAvailable,
BlockStoreLocation location,
BlockMetadataManagerView mManagerView)
Finds a directory in the given location range with capacity upwards of the given bound.
|
public static StorageDirView getDirWithMaxFreeSpace(long bytesToBeAvailable, BlockStoreLocation location, BlockMetadataManagerView mManagerView)
StorageDirView
with max free space.bytesToBeAvailable
- space size to be requestedlocation
- location that the space will be allocated inmManagerView
- a view of block metadata informationStorageDirView
selected@Nullable public static StorageDirView selectDirWithRequestedSpace(long bytesToBeAvailable, BlockStoreLocation location, BlockMetadataManagerView 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.