adoroszlai commented on code in PR #6779:
URL: https://github.com/apache/ozone/pull/6779#discussion_r1631915027
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/ChunkInputStream.java:
##########
@@ -290,13 +293,27 @@ protected synchronized void releaseClient() {
}
}
+ /**
+ * Updates DatanodeBlockId which based on blockId.
+ */
+ private void updateDatanodeBlockId() throws IOException {
+ DatanodeDetails closestNode = pipelineSupplier.get().getClosestNode();
+ int replicaIdx = pipelineSupplier.get().getReplicaIndex(closestNode);
+ ContainerProtos.DatanodeBlockID.Builder builder =
blockID.getDatanodeBlockIDProtobufBuilder();
+ if (replicaIdx > 0) {
+ builder.setReplicaIndex(replicaIdx);
+ }
+ datanodeBlockID = builder.build();
+ }
+
/**
* Acquire new client if previous one was released.
*/
protected synchronized void acquireClient() throws IOException {
if (xceiverClientFactory != null && xceiverClient == null) {
xceiverClient = xceiverClientFactory.acquireClientForReadData(
pipelineSupplier.get());
+ updateDatanodeBlockId();
Review Comment:
There is one more `pipelineSupplier.get()` leftover in
`updateDatanodeBlockId()`:
https://github.com/apache/ozone/blob/1476d596119dada3fbc1ab1ea247d3bf54cc24bd/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/ChunkInputStream.java#L301
--
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]