@Private
public class DFSPacket
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static long |
HEART_BEAT_SEQNO |
| Constructor | Description |
|---|---|
DFSPacket(byte[] buf,
int chunksPerPkt,
long offsetInBlock,
long seqno,
int checksumSize,
boolean lastPacketInBlock) |
Create a new packet.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addTraceParent(org.apache.hadoop.tracing.Span span) |
Add a trace parent span for this packet.
|
void |
addTraceParent(org.apache.hadoop.tracing.SpanContext ctx) |
|
org.apache.hadoop.tracing.Span |
getSpan() |
|
org.apache.hadoop.tracing.SpanContext[] |
getTraceParents() |
Get the trace parent spans for this packet.
|
void |
setSpan(org.apache.hadoop.tracing.Span span) |
|
java.lang.String |
toString() |
|
void |
writeChecksum(byte[] inarray,
int off,
int len) |
Write checksums to this packet
|
void |
writeData(java.nio.ByteBuffer inBuffer,
int len) |
|
void |
writeTo(java.io.DataOutputStream stm) |
Write the full packet, including the header, to the given output stream.
|
public static final long HEART_BEAT_SEQNO
public DFSPacket(byte[] buf,
int chunksPerPkt,
long offsetInBlock,
long seqno,
int checksumSize,
boolean lastPacketInBlock)
buf - the buffer storing data and checksumschunksPerPkt - maximum number of chunks per packet.offsetInBlock - offset in bytes into the HDFS block.seqno - the sequence number of this packetchecksumSize - the size of checksumlastPacketInBlock - if this is the last packetpublic void writeData(java.nio.ByteBuffer inBuffer,
int len)
throws java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelExceptionpublic void writeChecksum(byte[] inarray,
int off,
int len)
throws java.nio.channels.ClosedChannelException
inarray - input array of checksumsoff - the offset of checksums to writelen - the length of checksums to writejava.nio.channels.ClosedChannelExceptionpublic void writeTo(java.io.DataOutputStream stm)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void addTraceParent(org.apache.hadoop.tracing.Span span)
Trace parent spans for a packet are the trace spans responsible for adding data to that packet. We store them as an array of longs for efficiency.
Protected by the DFSOutputStream dataQueue lock.
public void addTraceParent(org.apache.hadoop.tracing.SpanContext ctx)
public org.apache.hadoop.tracing.SpanContext[] getTraceParents()
Will always be non-null.
Protected by the DFSOutputStream dataQueue lock.
public void setSpan(org.apache.hadoop.tracing.Span span)
public org.apache.hadoop.tracing.Span getSpan()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.