@PublicApi public interface Evictor
Modifier and Type | Interface and Description |
---|---|
static class |
Evictor.Factory
Factory for
Evictor . |
static class |
Evictor.Mode
The eviction mode.
|
Modifier and Type | Method and Description |
---|---|
EvictionPlan |
freeSpaceWithView(long availableBytes,
BlockStoreLocation location,
BlockMetadataEvictorView view)
Frees space with the guaranteed mode.
|
EvictionPlan |
freeSpaceWithView(long availableBytes,
BlockStoreLocation location,
BlockMetadataEvictorView view,
Evictor.Mode mode)
Frees space in the given block store location and with the given view.
|
EvictionPlan freeSpaceWithView(long availableBytes, BlockStoreLocation location, BlockMetadataEvictorView view)
availableBytes
- the amount of free space in bytes to be ensured after evictionlocation
- the location in block storeview
- generated and passed by block storeEvictionPlan
(possibly with empty fields) to get the free space, or null
if no plan is feasibleEvictionPlan freeSpaceWithView(long availableBytes, BlockStoreLocation location, BlockMetadataEvictorView view, Evictor.Mode mode)
StorageDir
in the location has the specific amount of free
space after eviction. The location can be a specific
StorageDir
, or BlockStoreLocation.anyTier()
or
BlockStoreLocation.anyDirInTier(String)
. The view is generated and passed by the
calling LocalBlockStore
. This method returns null if Evictor
fails to propose a feasible plan to meet the requirement.
With the BEST_EFFORT mode, the evictor always returns an eviction plan with toMove and toEvict fields to indicate how to free space. Even if the tier does not have the amount of free space, the evictor returns the plan to free the max space.
If both toMove and toEvict of the plan are empty, it indicates that Evictor
has no
actions to take and the requirement is already met.
Throws an IllegalArgumentException
if the given block location is invalid.
availableBytes
- the amount of free space in bytes to be ensured after evictionlocation
- the location in block storeview
- generated and passed by block storemode
- the eviction modeEvictionPlan
(possibly with empty fields) to get the free space, or null
if no plan is feasibleCopyright © 2023. All Rights Reserved.