ReplicaLocalReplicaInPipeline, ReplicaBeingWrittenpublic interface ReplicaInPipeline extends Replica
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
attemptToSetWriter(java.lang.Thread prevWriter,
java.lang.Thread newWriter) |
Attempt to set the writer to a new value.
|
java.io.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
|
ReplicaInfo |
getReplicaInfo() |
|
void |
interruptThread() |
|
void |
releaseAllBytesReserved() |
Release any disk space reserved for this replica.
|
void |
releaseReplicaInfoBytesReserved() |
Release the reserved space from the ReplicaInfo.
|
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(java.lang.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,
java.util.concurrent.TimeUnit unit) |
Causes the current thread to wait until a minimum length is reached, the
thread is interrupted, or the specified waiting time elapses.
|
getBlockId, getBytesOnDisk, getGenerationStamp, getNumBytes, getState, getStorageUuid, getVisibleLength, getVolume, isOnTransientStoragevoid setNumBytes(long bytesReceived)
bytesReceived - number of bytes receivedlong getBytesAcked()
void setBytesAcked(long bytesAcked)
bytesAcked - number bytes ackedvoid releaseAllBytesReserved()
void releaseReplicaInfoBytesReserved()
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 java.io.IOException
isCreate - if it is for creationrequestedChecksum - the checksum the writer would prefer to usejava.io.IOException - if any error occursjava.io.OutputStream createRestartMetaStream()
throws java.io.IOException
java.io.IOException - if any error occursReplicaInfo getReplicaInfo()
void setWriter(java.lang.Thread writer)
writer - a thread writing to this replicavoid interruptThread()
boolean attemptToSetWriter(java.lang.Thread prevWriter,
java.lang.Thread newWriter)
void stopWriter(long xceiverStopTimeout)
throws java.io.IOException
java.io.IOException - the waiting is interruptedvoid waitForMinLength(long minLength,
long time,
java.util.concurrent.TimeUnit unit)
throws java.io.IOException
minLength - The minimum length to achievetime - the maximum time to waitunit - the time unit of the time argumentjava.io.IOException - if the current thread is interrupted or the minimum
length is not achieved within the time allowed.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.