public class ReplicaInPipeline extends org.apache.hadoop.hdfs.server.datanode.ReplicaInfo implements ReplicaInPipelineInterface
ReplicaInfo.ReplicaDirInfo| Constructor and Description |
|---|
ReplicaInPipeline(long blockId,
long genStamp,
FsVolumeSpi vol,
File dir)
Constructor for a zero length replica
|
ReplicaInPipeline(ReplicaInPipeline from)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ReplicaOutputStreams |
createStreams(boolean isCreate,
org.apache.hadoop.util.DataChecksum requestedChecksum)
Create output streams for writing to this replica,
one for block file and one for CRC file
|
boolean |
equals(Object o) |
long |
getBytesAcked()
Get the number of bytes acked
|
long |
getBytesOnDisk()
Get the number of bytes that have written to disk
|
org.apache.hadoop.hdfs.server.datanode.ChunkChecksum |
getLastChecksumAndDataLen()
gets the last chunk checksum and the length of the block corresponding
to that checksum
|
HdfsServerConstants.ReplicaState |
getState()
Get the replica state
|
long |
getVisibleLength()
Get the number of bytes that are visible to readers
|
int |
hashCode() |
void |
setBytesAcked(long bytesAcked)
Set the number bytes that have acked
|
void |
setLastChecksumAndDataLen(long dataLength,
byte[] lastChecksum)
store the checksum for the last chunk along with the data length
|
void |
setWriter(Thread writer)
Set the thread that is writing to this replica
|
void |
stopWriter(long xceiverStopTimeout)
Interrupt the writing thread and wait until it dies
|
String |
toString() |
getBlockFile, getMetaFile, getStorageUuid, getVolume, isUnlinked, parseSubDirs, setDir, setUnlinked, unlinkBlockappendStringTo, compareTo, filename2id, getBlockId, getBlockId, getBlockName, getGenerationStamp, getGenerationStamp, getNumBytes, isBlockFilename, isMetaFilename, matchingIdAndGenStamp, readFields, readId, set, setBlockId, setGenerationStamp, setNumBytes, write, writeIdclone, finalize, getClass, notify, notifyAll, wait, wait, waitsetNumBytespublic ReplicaInPipeline(long blockId, long genStamp, FsVolumeSpi vol, File dir)
blockId - block idgenStamp - replica generation stampvol - volume where replica is locateddir - directory path where block and meta files are locatedpublic ReplicaInPipeline(ReplicaInPipeline from)
from - public long getVisibleLength()
org.apache.hadoop.hdfs.server.datanode.ReplicagetVisibleLength in interface org.apache.hadoop.hdfs.server.datanode.Replicapublic HdfsServerConstants.ReplicaState getState()
org.apache.hadoop.hdfs.server.datanode.ReplicagetState in interface org.apache.hadoop.hdfs.server.datanode.Replicapublic long getBytesAcked()
ReplicaInPipelineInterfacegetBytesAcked in interface ReplicaInPipelineInterfacepublic void setBytesAcked(long bytesAcked)
ReplicaInPipelineInterfacesetBytesAcked in interface ReplicaInPipelineInterfacepublic long getBytesOnDisk()
org.apache.hadoop.hdfs.server.datanode.ReplicagetBytesOnDisk in interface org.apache.hadoop.hdfs.server.datanode.Replicapublic void setLastChecksumAndDataLen(long dataLength, byte[] lastChecksum)
ReplicaInPipelineInterfacesetLastChecksumAndDataLen in interface ReplicaInPipelineInterfacedataLength - number of bytes on disklastChecksum - - checksum bytes for the last chunkpublic org.apache.hadoop.hdfs.server.datanode.ChunkChecksum getLastChecksumAndDataLen()
ReplicaInPipelineInterfacegetLastChecksumAndDataLen in interface ReplicaInPipelineInterfacepublic void setWriter(Thread writer)
writer - a thread writing to this replicapublic boolean equals(Object o)
equals in class org.apache.hadoop.hdfs.protocol.Blockpublic void stopWriter(long xceiverStopTimeout) throws IOException
IOException - the waiting is interruptedpublic int hashCode()
hashCode in class org.apache.hadoop.hdfs.protocol.Blockpublic ReplicaOutputStreams createStreams(boolean isCreate, org.apache.hadoop.util.DataChecksum requestedChecksum) throws IOException
ReplicaInPipelineInterfacecreateStreams in interface ReplicaInPipelineInterfaceisCreate - if it is for creationrequestedChecksum - the checksum the writer would prefer to useIOException - if any error occursCopyright © 2014 Apache Software Foundation. All Rights Reserved.