Class PipelineAck
java.lang.Object
org.apache.hadoop.hdfs.protocol.datatransfer.PipelineAck
Pipeline Acknowledgment
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptiondefault constructorPipelineAck(long seqno, int[] replies) Constructor assuming no next DN in pipelinePipelineAck(long seqno, int[] replies, long downstreamAckTimeNanos) Constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic intcombineHeader(PipelineAck.ECN ecn, org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status status) static intcombineHeader(PipelineAck.ECN ecn, org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status status, PipelineAck.SLOW slow) longGet the time elapsed for downstream ack RTT in nanosecondsstatic PipelineAck.ECNgetECNFromHeader(int header) intgetFlag(int i) intgetHeaderFlag(int i) get the header flag of ith replyshortGet the number of repliesorg.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.StatusReturns the OOB status if this ack contains one.static org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.StatusGet the Restart OOB ack statuslonggetSeqno()Get the sequence numberstatic PipelineAck.SLOWgetSLOWFromHeader(int header) static org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.StatusgetStatusFromHeader(int header) static booleanisRestartOOBStatus(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status st) return true if it is the restart OOB status codebooleanCheck if this ack contains error statusvoidWritable interfacestatic intsetSLOWForHeader(int old, PipelineAck.SLOW slow) static intsetStatusForHeader(int old, org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status status) toString()voidwrite(OutputStream out)
-
Field Details
-
UNKOWN_SEQNO
public static final long UNKOWN_SEQNO- See Also:
-
-
Constructor Details
-
PipelineAck
public PipelineAck()default constructor -
PipelineAck
public PipelineAck(long seqno, int[] replies) Constructor assuming no next DN in pipeline- Parameters:
seqno- sequence numberreplies- an array of replies
-
PipelineAck
public PipelineAck(long seqno, int[] replies, long downstreamAckTimeNanos) Constructor- Parameters:
seqno- sequence numberreplies- an array of repliesdownstreamAckTimeNanos- ack RTT in nanoseconds, 0 if no next DN in pipeline
-
-
Method Details
-
getSeqno
public long getSeqno()Get the sequence number- Returns:
- the sequence number
-
getNumOfReplies
public short getNumOfReplies()Get the number of replies- Returns:
- the number of replies
-
getHeaderFlag
public int getHeaderFlag(int i) get the header flag of ith reply -
getFlag
public int getFlag(int i) -
getDownstreamAckTimeNanos
public long getDownstreamAckTimeNanos()Get the time elapsed for downstream ack RTT in nanoseconds- Returns:
- time elapsed for downstream ack in nanoseconds, 0 if no next DN in pipeline
-
isSuccess
public boolean isSuccess()Check if this ack contains error status- Returns:
- true if all statuses are SUCCESS
-
getOOBStatus
public org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status getOOBStatus()Returns the OOB status if this ack contains one.- Returns:
- null if it is not an OOB ack.
-
getRestartOOBStatus
public static org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status getRestartOOBStatus()Get the Restart OOB ack status -
isRestartOOBStatus
public static boolean isRestartOOBStatus(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status st) return true if it is the restart OOB status code -
readFields
Writable interface- Throws:
IOException
-
write
- Throws:
IOException
-
toString
-
getStatusFromHeader
public static org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status getStatusFromHeader(int header) -
getECNFromHeader
-
getSLOWFromHeader
-
setStatusForHeader
public static int setStatusForHeader(int old, org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status status) -
setSLOWForHeader
-
combineHeader
public static int combineHeader(PipelineAck.ECN ecn, org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status status) -
combineHeader
public static int combineHeader(PipelineAck.ECN ecn, org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status status, PipelineAck.SLOW slow)
-