Package org.apache.hadoop.hdfs.protocol
Class CacheDirective
java.lang.Object
org.apache.hadoop.hdfs.protocol.CacheDirective
- All Implemented Interfaces:
org.apache.hadoop.util.IntrusiveCollection.Element
@Private
public final class CacheDirective
extends Object
implements org.apache.hadoop.util.IntrusiveCollection.Element
Namenode class that tracks state related to a cached path.
This is an implementation class, not part of the public API.
-
Constructor Summary
ConstructorsConstructorDescriptionCacheDirective(long id, String path, short replication, long expiryTime) CacheDirective(org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo info) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBytesCached(long bytes) voidaddBytesNeeded(long bytes) voidaddFilesCached(long files) voidaddFilesNeeded(long files) booleanlonglonglonglonglonglonggetId()org.apache.hadoop.util.IntrusiveCollection.ElementgetNext(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list) getPath()getPool()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) voidremoveInternal(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list) voidResets the byte and file statistics being tracked by this CacheDirective.voidsetNext(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list, org.apache.hadoop.util.IntrusiveCollection.Element next) voidsetPrev(org.apache.hadoop.util.IntrusiveCollection<? extends org.apache.hadoop.util.IntrusiveCollection.Element> list, org.apache.hadoop.util.IntrusiveCollection.Element prev) org.apache.hadoop.hdfs.protocol.CacheDirectiveEntrytoEntry()org.apache.hadoop.hdfs.protocol.CacheDirectiveInfotoInfo()Returns aCacheDirectiveInfobased on this CacheDirective.org.apache.hadoop.hdfs.protocol.CacheDirectiveStatstoStats()toString()
-
Constructor Details
-
CacheDirective
public CacheDirective(org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo info) -
CacheDirective
-
-
Method Details
-
getId
public long getId() -
getPath
-
getReplication
public short getReplication() -
getPool
-
getExpiryTime
public long getExpiryTime()- Returns:
- When this directive expires, in milliseconds since Unix epoch
-
getExpiryTimeString
- Returns:
- When this directive expires, as an ISO-8601 formatted string.
-
toInfo
public org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo toInfo()Returns aCacheDirectiveInfobased on this CacheDirective.This always sets an absolute expiry time, never a relative TTL.
-
toStats
public org.apache.hadoop.hdfs.protocol.CacheDirectiveStats toStats() -
toEntry
public org.apache.hadoop.hdfs.protocol.CacheDirectiveEntry toEntry() -
toString
-
equals
-
hashCode
public int hashCode() -
resetStatistics
public void resetStatistics()Resets the byte and file statistics being tracked by this CacheDirective. -
getBytesNeeded
public long getBytesNeeded() -
addBytesNeeded
public void addBytesNeeded(long bytes) -
getBytesCached
public long getBytesCached() -
addBytesCached
public void addBytesCached(long bytes) -
getFilesNeeded
public long getFilesNeeded() -
addFilesNeeded
public void addFilesNeeded(long files) -
getFilesCached
public long getFilesCached() -
addFilesCached
public void addFilesCached(long files) -
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
-