Skip to content

Commit

Permalink
HDDS-11287. Code cleanup in XceiverClientSpi (#7043)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghuazhu authored Aug 7, 2024
1 parent 7481790 commit c1b67d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,9 @@ private synchronized void connectToDatanode(DatanodeDetails dn)
OzoneConfigKeys.HDDS_CONTAINER_IPC_PORT_DEFAULT);
}

// Add credential context to the client call
if (LOG.isDebugEnabled()) {
LOG.debug("Nodes in pipeline : {}", pipeline.getNodes());
LOG.debug("Connecting to server : {}", dn.getIpAddress());
LOG.debug("Connecting to server : {}; nodes in pipeline : {}, ",
dn, pipeline.getNodes());
}
ManagedChannel channel = createChannel(dn, port).build();
XceiverClientProtocolServiceStub asyncStub =
Expand Down Expand Up @@ -321,7 +320,6 @@ public ContainerCommandResponseProto sendCommand(
/**
* @param request
* @param dn
* @param pipeline
* In case of getBlock for EC keys, it is required to set replicaIndex for
* every request with the replicaIndex for that DN for which the request is
* sent to. This method unpacks proto and reconstructs request after setting
Expand All @@ -346,8 +344,7 @@ public ContainerCommandResponseProto sendCommand(
ContainerCommandRequestProto request, List<Validator> validators)
throws IOException {
try {
XceiverClientReply reply;
reply = sendCommandWithTraceIDAndRetry(request, validators);
XceiverClientReply reply = sendCommandWithTraceIDAndRetry(request, validators);
return reply.getResponse().get();
} catch (ExecutionException e) {
throw getIOExceptionForSendCommand(request, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ public int getRefcount() {
public ContainerCommandResponseProto sendCommand(
ContainerCommandRequestProto request) throws IOException {
try {
XceiverClientReply reply;
reply = sendCommandAsync(request);
XceiverClientReply reply = sendCommandAsync(request);
return reply.getResponse().get();
} catch (InterruptedException e) {
// Re-interrupt the thread while catching InterruptedException
Expand All @@ -134,8 +133,7 @@ public ContainerCommandResponseProto sendCommand(
List<Validator> validators)
throws IOException {
try {
XceiverClientReply reply;
reply = sendCommandAsync(request);
XceiverClientReply reply = sendCommandAsync(request);
ContainerCommandResponseProto responseProto = reply.getResponse().get();
for (Validator function : validators) {
function.accept(request, responseProto);
Expand Down

0 comments on commit c1b67d4

Please sign in to comment.