Class ShortCircuitShm.Slot
java.lang.Object
org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot
- Enclosing class:
- ShortCircuitShm
A slot containing information about a replica.
The format is:
word 0
bit 0:32 Slot flags (see below).
bit 33:63 Anchor count.
word 1:7
Reserved for future use, such as statistics.
Padding is also useful for avoiding false sharing.
Little-endian versus big-endian is not relevant here since both the client
and the server reside on the same computer and use the same orientation.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTry to add an anchor for a given slot.Get the ExtendedBlockId associated with this slot.getShm()Get the short-circuit memory segment associated with this Slot.Get the SlotId of this slot, containing both shmId and slotIdx.intGet the Slot index.booleanbooleanbooleanisValid()voidvoidvoidvoidvoidRemove an anchor for a given slot.toString()
-
Method Details
-
getShm
Get the short-circuit memory segment associated with this Slot.- Returns:
- The enclosing short-circuit memory segment.
-
getBlockId
Get the ExtendedBlockId associated with this slot.- Returns:
- The ExtendedBlockId of this slot.
-
getSlotId
Get the SlotId of this slot, containing both shmId and slotIdx.- Returns:
- The SlotId of this slot.
-
getSlotIdx
public int getSlotIdx()Get the Slot index.- Returns:
- The index of this slot.
-
isValid
public boolean isValid() -
makeValid
public void makeValid() -
makeInvalid
public void makeInvalid() -
isAnchorable
public boolean isAnchorable() -
makeAnchorable
public void makeAnchorable() -
makeUnanchorable
public void makeUnanchorable() -
isAnchored
public boolean isAnchored() -
addAnchor
public boolean addAnchor()Try to add an anchor for a given slot. When a slot is anchored, we know that the block it refers to is resident in memory.- Returns:
- True if the slot is anchored.
-
removeAnchor
public void removeAnchor()Remove an anchor for a given slot. -
toString
-