Class ShortCircuitShm.Slot

java.lang.Object
org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot
Enclosing class:
ShortCircuitShm

public class ShortCircuitShm.Slot extends Object
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 Details

    • getShm

      public ShortCircuitShm getShm()
      Get the short-circuit memory segment associated with this Slot.
      Returns:
      The enclosing short-circuit memory segment.
    • getBlockId

      public ExtendedBlockId getBlockId()
      Get the ExtendedBlockId associated with this slot.
      Returns:
      The ExtendedBlockId of this slot.
    • getSlotId

      public ShortCircuitShm.SlotId 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

      public String toString()
      Overrides:
      toString in class Object