public class ReplicaInPipeline extends ReplicaInfo implements ReplicaInPipelineInterface
ReplicaInfo.ReplicaDirInfoBLOCK_FILE_PREFIX, blockFilePattern, METADATA_EXTENSION, metaFilePattern| 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,
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, 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, waitsetNumBytesgetBlockId, getGenerationStamp, getNumBytespublic 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()
ReplicagetVisibleLength in interface Replicapublic HdfsServerConstants.ReplicaState getState()
Replicapublic long getBytesAcked()
ReplicaInPipelineInterfacegetBytesAcked in interface ReplicaInPipelineInterfacepublic void setBytesAcked(long bytesAcked)
ReplicaInPipelineInterfacesetBytesAcked in interface ReplicaInPipelineInterfacepublic long getBytesOnDisk()
ReplicagetBytesOnDisk in interface 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 void stopWriter(long xceiverStopTimeout)
throws IOException
IOException - the waiting is interruptedpublic ReplicaOutputStreams createStreams(boolean isCreate, DataChecksum requestedChecksum) throws IOException
ReplicaInPipelineInterfacecreateStreams in interface ReplicaInPipelineInterfaceisCreate - if it is for creationrequestedChecksum - the checksum the writer would prefer to useIOException - if any error occurspublic String toString()
toString in class ReplicaInfoCopyright © 2013 Apache Software Foundation. All rights reserved.