LiuGuH commented on code in PR #5719:
URL: https://github.com/apache/hadoop/pull/5719#discussion_r1625937706
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java:
##########
@@ -1078,6 +1079,44 @@ public void blockGroupChecksum(final StripedBlockInfo
stripedBlockInfo,
datanode.metrics.addBlockChecksumOp(elapsed());
}
+ @Override
+ public void copyBlockCrossNamespace(
+ final ExtendedBlock srcBlock, final Token<BlockTokenIdentifier>
srcBlockToken,
+ final ExtendedBlock targetBlock, final Token<BlockTokenIdentifier>
targetBlockToken,
+ final DatanodeInfo targetDN) throws IOException {
+ updateCurrentThreadName("Copying block cross namespace " + srcBlock);
+ final DataOutputStream reply = getBufferedOutputStream();
+ try {
+ // Check access
+ checkAccess(reply, true, srcBlock, srcBlockToken,
+ Op.COPY_BLOCK_CROSS_NAMESPACE, BlockTokenIdentifier.AccessMode.COPY);
Review Comment:
If we use namenode.getBlockLocations() , the blockToken AccessMode is
BlockTokenIdentifier.AccessMode.READ. I also test in a real hdfs cluster
with FastCopy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]