Sender@Private
@Evolving
public interface DataTransferProtocol
| Modifier and Type | Field | Description |
|---|---|---|
static int |
DATA_TRANSFER_VERSION |
Version for data transfers between clients and datanodes
This should change when serialization of DatanodeInfo, not just
when protocol changes.
|
static org.slf4j.Logger |
LOG |
| Modifier and Type | Method | Description |
|---|---|---|
void |
blockChecksum(ExtendedBlock blk,
org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken,
BlockChecksumOptions blockChecksumOptions) |
Get block checksum (MD5 of CRC32).
|
void |
blockGroupChecksum(StripedBlockInfo stripedBlockInfo,
org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken,
long requestedNumBytes,
BlockChecksumOptions blockChecksumOptions) |
Get striped block group checksum (MD5 of CRC32).
|
void |
copyBlock(ExtendedBlock blk,
org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken) |
Copy a block.
|
void |
readBlock(ExtendedBlock blk,
org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken,
java.lang.String clientName,
long blockOffset,
long length,
boolean sendChecksum,
CachingStrategy cachingStrategy) |
Read a block.
|
void |
releaseShortCircuitFds(ShortCircuitShm.SlotId slotId) |
Release a pair of short-circuit FDs requested earlier.
|
void |
replaceBlock(ExtendedBlock blk,
org.apache.hadoop.fs.StorageType storageType,
org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken,
java.lang.String delHint,
DatanodeInfo source,
java.lang.String storageId) |
Receive a block from a source datanode
and then notifies the namenode
to remove the copy from the original datanode.
|
void |
requestShortCircuitFds(ExtendedBlock blk,
org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken,
ShortCircuitShm.SlotId slotId,
int maxVersion,
boolean supportsReceiptVerification) |
Request short circuit access file descriptors from a DataNode.
|
void |
requestShortCircuitShm(java.lang.String clientName) |
Request a short circuit shared memory area from a DataNode.
|
void |
transferBlock(ExtendedBlock blk,
org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken,
java.lang.String clientName,
DatanodeInfo[] targets,
org.apache.hadoop.fs.StorageType[] targetStorageTypes,
java.lang.String[] targetStorageIDs) |
Transfer a block to another datanode.
|
void |
writeBlock(ExtendedBlock blk,
org.apache.hadoop.fs.StorageType storageType,
org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken,
java.lang.String clientName,
DatanodeInfo[] targets,
org.apache.hadoop.fs.StorageType[] targetStorageTypes,
DatanodeInfo source,
BlockConstructionStage stage,
int pipelineSize,
long minBytesRcvd,
long maxBytesRcvd,
long latestGenerationStamp,
org.apache.hadoop.util.DataChecksum requestedChecksum,
CachingStrategy cachingStrategy,
boolean allowLazyPersist,
boolean pinning,
boolean[] targetPinnings,
java.lang.String storageID,
java.lang.String[] targetStorageIDs) |
Write a block to a datanode pipeline.
|
static final org.slf4j.Logger LOG
static final int DATA_TRANSFER_VERSION
void readBlock(ExtendedBlock blk, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken, java.lang.String clientName, long blockOffset, long length, boolean sendChecksum, CachingStrategy cachingStrategy) throws java.io.IOException
blk - the block being read.blockToken - security token for accessing the block.clientName - client's name.blockOffset - offset of the block.length - maximum number of bytes for this read.sendChecksum - if false, the DN should skip reading and sending
checksumscachingStrategy - The caching strategy to use.java.io.IOExceptionvoid writeBlock(ExtendedBlock blk, org.apache.hadoop.fs.StorageType storageType, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken, java.lang.String clientName, DatanodeInfo[] targets, org.apache.hadoop.fs.StorageType[] targetStorageTypes, DatanodeInfo source, BlockConstructionStage stage, int pipelineSize, long minBytesRcvd, long maxBytesRcvd, long latestGenerationStamp, org.apache.hadoop.util.DataChecksum requestedChecksum, CachingStrategy cachingStrategy, boolean allowLazyPersist, boolean pinning, boolean[] targetPinnings, java.lang.String storageID, java.lang.String[] targetStorageIDs) throws java.io.IOException
DatanodeInfo is not required in the
parameter list since the receiver datanode knows its info. However, the
StorageType for storing the replica in the receiver datanode is a
parameter since the receiver datanode may support multiple storage types.blk - the block being written.storageType - for storing the replica in the receiver datanode.blockToken - security token for accessing the block.clientName - client's name.targets - other downstream datanodes in the pipeline.targetStorageTypes - target StorageTypes corresponding
to the target datanodes.source - source datanode.stage - pipeline stage.pipelineSize - the size of the pipeline.minBytesRcvd - minimum number of bytes received.maxBytesRcvd - maximum number of bytes received.latestGenerationStamp - the latest generation stamp of the block.requestedChecksum - the requested checksum mechanismcachingStrategy - the caching strategyallowLazyPersist - hint to the DataNode that the block can be
allocated on transient storage i.e. memory and
written to disk lazilypinning - whether to pin the block, so Balancer won't move it.targetPinnings - whether to pin the block on target datanodestorageID - optional StorageIDs designating where to write the
block. An empty String or null indicates that this
has not been provided.targetStorageIDs - target StorageIDs corresponding to the target
datanodes.java.io.IOExceptionvoid transferBlock(ExtendedBlock blk, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken, java.lang.String clientName, DatanodeInfo[] targets, org.apache.hadoop.fs.StorageType[] targetStorageTypes, java.lang.String[] targetStorageIDs) throws java.io.IOException
BlockConstructionStage.TRANSFER_RBW
or BlockConstructionStage.TRANSFER_FINALIZED.blk - the block being transferred.blockToken - security token for accessing the block.clientName - client's name.targets - target datanodes.targetStorageIDs - StorageID designating where to write the
block.java.io.IOExceptionvoid requestShortCircuitFds(ExtendedBlock blk, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken, ShortCircuitShm.SlotId slotId, int maxVersion, boolean supportsReceiptVerification) throws java.io.IOException
blk - The block to get file descriptors for.blockToken - Security token for accessing the block.slotId - The shared memory slot id to use, or null
to use no slot id.maxVersion - Maximum version of the block data the client
can understand.supportsReceiptVerification - True if the client supports
receipt verification.java.io.IOExceptionvoid releaseShortCircuitFds(ShortCircuitShm.SlotId slotId) throws java.io.IOException
slotId - SlotID used by the earlier file descriptors.java.io.IOExceptionvoid requestShortCircuitShm(java.lang.String clientName)
throws java.io.IOException
clientName - The name of the client.java.io.IOExceptionvoid replaceBlock(ExtendedBlock blk, org.apache.hadoop.fs.StorageType storageType, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken, java.lang.String delHint, DatanodeInfo source, java.lang.String storageId) throws java.io.IOException
blk - the block being replaced.storageType - the StorageType for storing the block.blockToken - security token for accessing the block.delHint - the hint for deleting the block in the original datanode.source - the source datanode for receiving the block.storageId - an optional storage ID to designate where the block is
replaced to.java.io.IOExceptionvoid copyBlock(ExtendedBlock blk, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken) throws java.io.IOException
blk - the block being copied.blockToken - security token for accessing the block.java.io.IOExceptionvoid blockChecksum(ExtendedBlock blk, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken, BlockChecksumOptions blockChecksumOptions) throws java.io.IOException
blk - a block.blockToken - security token for accessing the block.blockChecksumOptions - determines how the block-level checksum is
computed from underlying block metadata.java.io.IOExceptionvoid blockGroupChecksum(StripedBlockInfo stripedBlockInfo, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> blockToken, long requestedNumBytes, BlockChecksumOptions blockChecksumOptions) throws java.io.IOException
stripedBlockInfo - a striped block info.blockToken - security token for accessing the block.requestedNumBytes - requested number of bytes in the block group
to compute the checksum.blockChecksumOptions - determines how the block-level checksum is
computed from underlying block metadata.java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.