taklwu commented on code in PR #11102:
URL: https://github.com/apache/ozone/pull/11102#discussion_r4012158185


##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/LocalChunkInputStream.java:
##########
@@ -62,7 +63,9 @@ public class LocalChunkInputStream extends ChunkInputStream
   LocalChunkInputStream(ChunkInfo chunkInfo, BlockID blockId, 
XceiverClientFactory xceiverClientFactory,
       Supplier<Pipeline> pipelineSupplier, boolean verifyChecksum, 
Supplier<Token<?>> tokenSupplier,
       XceiverClientShortCircuit xceiverClientShortCircuit, FileInputStream 
blockInputStream) {
-    super(chunkInfo, blockId, xceiverClientFactory, pipelineSupplier, 
verifyChecksum, tokenSupplier);
+    // Pass null for xceiverClientFactory such readPositioned() is taken, both 
routing reads
+    // and checksum verification are done locally.
+    super(chunkInfo, blockId, null, pipelineSupplier, verifyChecksum, 
tokenSupplier);

Review Comment:
   before this change, even if `createChunkInputStream` should be passing a 
empty `xceiverClientFactory` (null), in the test 
`org.apache.hadoop.ozone.client.rpc.read.TestChunkInputStream` itself,  
`xceiverClientFactory` is not null such that `ChunkInputStream#readPositioned` 
didn't use the `LocalChunkInputStream#readChunk` and created a 
`XceiverClientSpi` client.  see this line for the [XceiverClientSpi client 
assertion 
](https://github.com/apache/ozone/blob/master/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestChunkInputStream.java#L123-L124)
   
   it should be a test issue instead, but since `xceiverClientFactory` should 
not be used with `LocalChunkInputStream`, I fixed it by enforcing the null 
value when `LocalChunkInputStream` is being constructed. noted that the passing 
in `xceiverClientShortCircuit` is not used anywhere at the moment. 



-- 
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]

Reply via email to