Package alluxio.worker.block
Class AllocateOptions
- java.lang.Object
-
- alluxio.worker.block.AllocateOptions
-
public class AllocateOptions extends java.lang.Object
Used to specify various options while allocating space.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canUseReservedSpace()
boolean
equals(java.lang.Object o)
static AllocateOptions
forCreate(long sizeBytes, BlockStoreLocation location)
Creates default allocation options for block create request.static AllocateOptions
forMove(BlockStoreLocation location)
Creates default allocation options for moving a block by a client request.static AllocateOptions
forRequestSpace(long sizeBytes, BlockStoreLocation location)
Creates default allocation options for requesting more space for a block.static AllocateOptions
forTierMove(BlockStoreLocation location)
Creates default allocation options for moving a block during tier-move task.BlockStoreLocation
getLocation()
long
getSize()
int
hashCode()
boolean
isEvictionAllowed()
boolean
isForceLocation()
AllocateOptions
setEvictionAllowed(boolean evictionAllowed)
Sets value for whether eviction is allowed for allocation.AllocateOptions
setForceLocation(boolean forceLocation)
Sets value for whether to enforce location of allocation.AllocateOptions
setLocation(BlockStoreLocation location)
Sets the allocation location.AllocateOptions
setSize(long size)
Sets the allocation size.AllocateOptions
setUseReservedSpace(boolean useReservedSpace)
Sets value for whether this allocation can use reserved space.java.lang.String
toString()
-
-
-
Method Detail
-
forCreate
public static AllocateOptions forCreate(long sizeBytes, BlockStoreLocation location)
Creates default allocation options for block create request. - Locations is not strict - Evicting on destination is allowed- Parameters:
sizeBytes
- size of allocationlocation
- location of allocation- Returns:
- the allocation object initialized with defaults for create
-
forRequestSpace
public static AllocateOptions forRequestSpace(long sizeBytes, BlockStoreLocation location)
Creates default allocation options for requesting more space for a block. - Locations is strict - Evicting on destination is allowed- Parameters:
sizeBytes
- size of allocationlocation
- location of allocation- Returns:
- the allocation object initialized with defaults for requesting space
-
forTierMove
public static AllocateOptions forTierMove(BlockStoreLocation location)
Creates default allocation options for moving a block during tier-move task. - Locations is strict - Evicting on destination is disallowed- Parameters:
location
- location of allocation- Returns:
- the allocation object initialized with defaults for moving
-
forMove
public static AllocateOptions forMove(BlockStoreLocation location)
Creates default allocation options for moving a block by a client request. - Locations is strict - Evicting on destination is allowed- Parameters:
location
- location of allocation- Returns:
- the allocation object initialized with defaults for moving
-
setLocation
public AllocateOptions setLocation(BlockStoreLocation location)
Sets the allocation location.- Parameters:
location
- the allocation location- Returns:
- the updated options
-
setSize
public AllocateOptions setSize(long size)
Sets the allocation size.- Parameters:
size
- the allocation size in bytes- Returns:
- the updated options
-
setForceLocation
public AllocateOptions setForceLocation(boolean forceLocation)
Sets value for whether to enforce location of allocation.- Parameters:
forceLocation
- force location- Returns:
- the updated options
-
setEvictionAllowed
public AllocateOptions setEvictionAllowed(boolean evictionAllowed)
Sets value for whether eviction is allowed for allocation.- Parameters:
evictionAllowed
- eviction allowed- Returns:
- the updated options
-
setUseReservedSpace
public AllocateOptions setUseReservedSpace(boolean useReservedSpace)
Sets value for whether this allocation can use reserved space.- Parameters:
useReservedSpace
- use reserved space- Returns:
- the updated options
-
getLocation
public BlockStoreLocation getLocation()
- Returns:
- the location of allocation
-
getSize
public long getSize()
- Returns:
- the size of allocation
-
isForceLocation
public boolean isForceLocation()
- Returns:
- whether location is to be enforced
-
isEvictionAllowed
public boolean isEvictionAllowed()
- Returns:
- whether eviction is allowed for allocation
-
canUseReservedSpace
public boolean canUseReservedSpace()
- Returns:
- whether this allocation can use reserved space
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-