org.apache.hadoop.hdfs
Class ShortCircuitShm.Slot

java.lang.Object
  extended by org.apache.hadoop.hdfs.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 Summary
 boolean addAnchor()
          Try to add an anchor for a given slot.
 ExtendedBlockId getBlockId()
          Get the ExtendedBlockId associated with this slot.
 ShortCircuitShm getShm()
          Get the short-circuit memory segment associated with this Slot.
 ShortCircuitShm.SlotId getSlotId()
          Get the SlotId of this slot, containing both shmId and slotIdx.
 int getSlotIdx()
          Get the Slot index.
 boolean isAnchorable()
           
 boolean isAnchored()
           
 boolean isValid()
           
 void makeAnchorable()
           
 void makeInvalid()
           
 void makeUnanchorable()
           
 void makeValid()
           
 void removeAnchor()
          Remove an anchor for a given slot.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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


Copyright © 2014 Apache Software Foundation. All Rights Reserved.