chungen0126 commented on code in PR #6613:
URL: https://github.com/apache/ozone/pull/6613#discussion_r1792383957
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockInputStreamFactoryImpl.java:
##########
@@ -86,11 +89,27 @@ public BlockExtendedInputStream create(ReplicationConfig
repConfig,
return new ECBlockInputStreamProxy((ECReplicationConfig)repConfig,
blockInfo, xceiverFactory, refreshFunction,
ecBlockStreamFactory, config);
+ } else if (config.isStreamReadBlock() &&
allDataNodesSupportStreamBlock(pipeline)) {
+ return new StreamBlockInput(
+ blockInfo.getBlockID(), blockInfo.getLength(),
+ pipeline, token, xceiverFactory, refreshFunction, config);
} else {
return new BlockInputStream(blockInfo,
pipeline, token, xceiverFactory, refreshFunction,
config);
}
}
+ private boolean allDataNodesSupportStreamBlock(Pipeline pipeline) {
+ // return true only if all DataNodes in the pipeline are on a version
+ // that supports for reading a block by streaming chunks..
+ for (DatanodeDetails dn : pipeline.getNodes()) {
+ if (dn.getCurrentVersion() <
+ STEAM_BLOCK_SUPPORT.toProtoValue()) {
Review Comment:
done
--
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]