public interface ReplicaInPipeline
extends org.apache.hadoop.hdfs.server.datanode.Replica
| Modifier and Type | Method and Description | 
|---|---|
| boolean | attemptToSetWriter(Thread prevWriter,
                  Thread newWriter)Attempt to set the writer to a new value. | 
| OutputStream | createRestartMetaStream()Create an output stream to write restart metadata in case of datanode
 shutting down for quick restart. | 
| 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 | 
| long | getBytesAcked()Get the number of bytes acked | 
| ChunkChecksum | getLastChecksumAndDataLen()gets the last chunk checksum and the length of the block corresponding
 to that checksum | 
| org.apache.hadoop.hdfs.server.datanode.ReplicaInfo | getReplicaInfo() | 
| void | interruptThread() | 
| void | releaseAllBytesReserved()Release any disk space reserved for this replica. | 
| 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 | setNumBytes(long bytesReceived)Set the number of bytes received | 
| 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. | 
| void | waitForMinLength(long minLength,
                long time,
                TimeUnit unit)Causes the current thread to wait until a minimum length is reached, the
 thread is interrupted, or the specified waiting time elapses. | 
void setNumBytes(long bytesReceived)
bytesReceived - number of bytes receivedlong getBytesAcked()
void setBytesAcked(long bytesAcked)
bytesAcked - number bytes ackedvoid releaseAllBytesReserved()
void setLastChecksumAndDataLen(long dataLength,
                               byte[] lastChecksum)
dataLength - number of bytes on disklastChecksum - - checksum bytes for the last chunkChunkChecksum getLastChecksumAndDataLen()
ReplicaOutputStreams createStreams(boolean isCreate, org.apache.hadoop.util.DataChecksum requestedChecksum) throws IOException
isCreate - if it is for creationrequestedChecksum - the checksum the writer would prefer to useIOException - if any error occursOutputStream createRestartMetaStream() throws IOException
IOException - if any error occursorg.apache.hadoop.hdfs.server.datanode.ReplicaInfo getReplicaInfo()
void setWriter(Thread writer)
writer - a thread writing to this replicavoid interruptThread()
boolean attemptToSetWriter(Thread prevWriter, Thread newWriter)
void stopWriter(long xceiverStopTimeout)
         throws IOException
IOException - the waiting is interruptedvoid waitForMinLength(long minLength,
                      long time,
                      TimeUnit unit)
               throws IOException
minLength - The minimum length to achievetime - the maximum time to waitunit - the time unit of the time argumentIOException - if the current thread is interrupted or the minimum
           length is not achieved within the time allowed.Copyright © 2008–2023 Apache Software Foundation. All rights reserved.