org.apache.hadoop.hdfs.server.datanode
Class FinalizedReplica

java.lang.Object
  extended by org.apache.hadoop.hdfs.protocol.Block
      extended by org.apache.hadoop.hdfs.server.datanode.ReplicaInfo
          extended by org.apache.hadoop.hdfs.server.datanode.FinalizedReplica
All Implemented Interfaces:
Comparable<org.apache.hadoop.hdfs.protocol.Block>, org.apache.hadoop.hdfs.server.datanode.Replica, org.apache.hadoop.io.Writable

public class FinalizedReplica
extends org.apache.hadoop.hdfs.server.datanode.ReplicaInfo

This class describes a replica that has been finalized.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.datanode.ReplicaInfo
ReplicaInfo.ReplicaDirInfo
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hdfs.protocol.Block
BLOCK_FILE_PREFIX, blockFilePattern, METADATA_EXTENSION, metaFilePattern
 
Constructor Summary
FinalizedReplica(org.apache.hadoop.hdfs.protocol.Block block, FsVolumeSpi vol, File dir)
          Constructor
FinalizedReplica(FinalizedReplica from)
          Copy constructor.
FinalizedReplica(long blockId, long len, long genStamp, FsVolumeSpi vol, File dir)
          Constructor
 
Method Summary
 boolean equals(Object o)
           
 long getBytesOnDisk()
          Get the number of bytes that have written to disk
 HdfsServerConstants.ReplicaState getState()
          Get the replica state
 long getVisibleLength()
          Get the number of bytes that are visible to readers
 int hashCode()
           
 boolean isUnlinked()
          check if this replica has already been unlinked.
 void setUnlinked()
          set that this replica is unlinked
 String toString()
           
 
Methods inherited from class org.apache.hadoop.hdfs.server.datanode.ReplicaInfo
getBlockFile, getMetaFile, getStorageUuid, getVolume, parseSubDirs, setDir, unlinkBlock
 
Methods inherited from class org.apache.hadoop.hdfs.protocol.Block
appendStringTo, compareTo, filename2id, getBlockId, getBlockId, getBlockName, getGenerationStamp, getGenerationStamp, getNumBytes, isBlockFilename, isMetaFilename, matchingIdAndGenStamp, readFields, readId, set, setBlockId, setGenerationStamp, setNumBytes, write, writeId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.hdfs.server.datanode.Replica
getBlockId, getGenerationStamp, getNumBytes
 

Constructor Detail

FinalizedReplica

public FinalizedReplica(long blockId,
                        long len,
                        long genStamp,
                        FsVolumeSpi vol,
                        File dir)
Constructor

Parameters:
blockId - block id
len - replica length
genStamp - replica generation stamp
vol - volume where replica is located
dir - directory path where block and meta files are located

FinalizedReplica

public FinalizedReplica(org.apache.hadoop.hdfs.protocol.Block block,
                        FsVolumeSpi vol,
                        File dir)
Constructor

Parameters:
block - a block
vol - volume where replica is located
dir - directory path where block and meta files are located

FinalizedReplica

public FinalizedReplica(FinalizedReplica from)
Copy constructor.

Parameters:
from -
Method Detail

getState

public HdfsServerConstants.ReplicaState getState()
Description copied from interface: org.apache.hadoop.hdfs.server.datanode.Replica
Get the replica state

Returns:
the replica state

isUnlinked

public boolean isUnlinked()
Description copied from class: org.apache.hadoop.hdfs.server.datanode.ReplicaInfo
check if this replica has already been unlinked.

Overrides:
isUnlinked in class org.apache.hadoop.hdfs.server.datanode.ReplicaInfo
Returns:
true if the replica has already been unlinked or no need to be detached; false otherwise

setUnlinked

public void setUnlinked()
Description copied from class: org.apache.hadoop.hdfs.server.datanode.ReplicaInfo
set that this replica is unlinked

Overrides:
setUnlinked in class org.apache.hadoop.hdfs.server.datanode.ReplicaInfo

getVisibleLength

public long getVisibleLength()
Description copied from interface: org.apache.hadoop.hdfs.server.datanode.Replica
Get the number of bytes that are visible to readers

Returns:
the number of bytes that are visible to readers

getBytesOnDisk

public long getBytesOnDisk()
Description copied from interface: org.apache.hadoop.hdfs.server.datanode.Replica
Get the number of bytes that have written to disk

Returns:
the number of bytes that have written to disk

equals

public boolean equals(Object o)
Overrides:
equals in class org.apache.hadoop.hdfs.protocol.Block

hashCode

public int hashCode()
Overrides:
hashCode in class org.apache.hadoop.hdfs.protocol.Block

toString

public String toString()
Overrides:
toString in class org.apache.hadoop.hdfs.server.datanode.ReplicaInfo


Copyright © 2014 Apache Software Foundation. All Rights Reserved.