Class CachedBlock
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.CachedBlock
- All Implemented Interfaces:
org.apache.hadoop.util.IntrusiveCollection.Element,org.apache.hadoop.util.LightWeightGSet.LinkedElement
@LimitedPrivate("HDFS")
public final class CachedBlock
extends Object
implements org.apache.hadoop.util.IntrusiveCollection.Element, org.apache.hadoop.util.LightWeightGSet.LinkedElement
Represents a cached block.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongGet a list of the datanodes which this block is cached, planned to be cached, or planned to be uncached on.booleangetMark()org.apache.hadoop.util.LightWeightGSet.LinkedElementgetNext()org.apache.hadoop.util.IntrusiveCollection.ElementgetNext(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list) org.apache.hadoop.util.IntrusiveCollection.ElementgetPrev(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list) shortinthashCode()voidinsertInternal(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list, org.apache.hadoop.util.IntrusiveCollection.Element prev, org.apache.hadoop.util.IntrusiveCollection.Element next) booleanisInList(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list) booleanisPresent(DatanodeDescriptor.CachedBlocksList cachedBlocksList) Return true if this CachedBlock is present on the given list.voidremoveInternal(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list) voidsetNext(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list, org.apache.hadoop.util.IntrusiveCollection.Element next) voidsetNext(org.apache.hadoop.util.LightWeightGSet.LinkedElement next) voidsetPrev(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list, org.apache.hadoop.util.IntrusiveCollection.Element prev) voidsetReplicationAndMark(short replication, boolean mark) toString()
-
Constructor Details
-
CachedBlock
public CachedBlock(long blockId, short replication, boolean mark)
-
-
Method Details
-
getBlockId
public long getBlockId() -
hashCode
public int hashCode() -
equals
-
setReplicationAndMark
public void setReplicationAndMark(short replication, boolean mark) -
getMark
public boolean getMark() -
getReplication
public short getReplication() -
isPresent
Return true if this CachedBlock is present on the given list. -
getDatanodes
Get a list of the datanodes which this block is cached, planned to be cached, or planned to be uncached on.- Parameters:
type- If null, this parameter is ignored. If it is non-null, we match only datanodes which have it on this list. SeeDatanodeDescriptor.CachedBlocksList.Typefor a description of all the lists.- Returns:
- The list of datanodes. Modifying this list does not alter the state of the CachedBlock.
-
insertInternal
public void insertInternal(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list, org.apache.hadoop.util.IntrusiveCollection.Element prev, org.apache.hadoop.util.IntrusiveCollection.Element next) - Specified by:
insertInternalin interfaceorg.apache.hadoop.util.IntrusiveCollection.Element
-
setPrev
public void setPrev(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list, org.apache.hadoop.util.IntrusiveCollection.Element prev) - Specified by:
setPrevin interfaceorg.apache.hadoop.util.IntrusiveCollection.Element
-
setNext
public void setNext(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list, org.apache.hadoop.util.IntrusiveCollection.Element next) - Specified by:
setNextin interfaceorg.apache.hadoop.util.IntrusiveCollection.Element
-
removeInternal
public void removeInternal(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list) - Specified by:
removeInternalin interfaceorg.apache.hadoop.util.IntrusiveCollection.Element
-
getPrev
public org.apache.hadoop.util.IntrusiveCollection.Element getPrev(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list) - Specified by:
getPrevin interfaceorg.apache.hadoop.util.IntrusiveCollection.Element
-
getNext
public org.apache.hadoop.util.IntrusiveCollection.Element getNext(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list) - Specified by:
getNextin interfaceorg.apache.hadoop.util.IntrusiveCollection.Element
-
isInList
public boolean isInList(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list) - Specified by:
isInListin interfaceorg.apache.hadoop.util.IntrusiveCollection.Element
-
toString
-
setNext
public void setNext(org.apache.hadoop.util.LightWeightGSet.LinkedElement next) - Specified by:
setNextin interfaceorg.apache.hadoop.util.LightWeightGSet.LinkedElement
-
getNext
public org.apache.hadoop.util.LightWeightGSet.LinkedElement getNext()- Specified by:
getNextin interfaceorg.apache.hadoop.util.LightWeightGSet.LinkedElement
-