Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ private XceiverClientReply sendCommandWithRetry(
responseProto = null;
} catch (ExecutionException e) {
LOG.debug("Failed to execute command {} on datanode {}",
request, dn.getUuid(), e);
request, dn, e);
if (Status.fromThrowable(e.getCause()).getCode()
== Status.UNAUTHENTICATED.getCode()) {
throw new SCMSecurityException("Failed to authenticate with "
Expand Down Expand Up @@ -433,7 +433,7 @@ public XceiverClientReply sendCommandAsync(
UUID dnId = dn.getUuid();
if (LOG.isDebugEnabled()) {
LOG.debug("Send command {} to datanode {}",
request.getCmdType(), dn.getNetworkFullPath());
request.getCmdType(), dn.getIpAddress());
}
final CompletableFuture<ContainerCommandResponseProto> replyFuture =
new CompletableFuture<>();
Expand All @@ -452,17 +452,29 @@ public XceiverClientReply sendCommandAsync(
public void onNext(ContainerCommandResponseProto value) {
replyFuture.complete(value);
metrics.decrPendingContainerOpsMetrics(request.getCmdType());
long cost = System.nanoTime() - requestTime;
metrics.addContainerOpsLatency(request.getCmdType(),
System.nanoTime() - requestTime);
cost);
if (LOG.isDebugEnabled()) {
LOG.debug("Executed command {} on datanode {}, cost = {}, "
+ "cmdType = {}", request, dn,
cost, request.getCmdType());
}
semaphore.release();
}

@Override
public void onError(Throwable t) {
replyFuture.completeExceptionally(t);
metrics.decrPendingContainerOpsMetrics(request.getCmdType());
long cost = System.nanoTime() - requestTime;
metrics.addContainerOpsLatency(request.getCmdType(),
System.nanoTime() - requestTime);
if (LOG.isDebugEnabled()) {
LOG.debug("Executed command {} on datanode {}, cost = {}, "
+ "cmdType = {}", request, dn,
cost, request.getCmdType());
}
semaphore.release();
}

Expand Down