You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kudu.apache.org by "Jean-Daniel Cryans (Code Review)" <ge...@cloudera.org> on 2016/04/26 21:56:22 UTC

[kudu-CR] [java client] Only add the Deferred to KuduRPC.toString if DEBUG is enabled

Jean-Daniel Cryans has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/2873

Change subject: [java client] Only add the Deferred to KuduRPC.toString if DEBUG is enabled
......................................................................

[java client] Only add the Deferred to KuduRPC.toString if DEBUG is enabled

All the KuduRPC daughter classes append their Deferred object when
toString() is called, which gives things like:

KuduRpc(method=Write, tablet=9d66b0bb6019492daca0a607fb0bd64b, attempt=8, DeadlineTracker(timeout=10000, elapsed=6289), Deferred@608776154(state=PENDING, result=null, callback=apply batch response -> callback: mark tablet 9d66b0bb6019492daca0a607fb0bd64b inflight done -> (continuation of Deferred@544649099 after retry RPC@1702110689) -> (continuation of Deferred@956406952 after retry RPC@1415267245) -> (continuation of Deferred@690509936 after retry RPC@756533645) -> (continuation of Deferred@1348564629 after retry RPC@1415510081), errback=apply batch error response -> errback: mark tablet 9d66b0bb6019492daca0a607fb0bd64b inflight done -> (continuation of Deferred@544649099 after retry RPC@1702110689) -> (continuation of Deferred@956406952 after retry RPC@1415267245) -> (continuation of Deferred@690509936 after retry RPC@756533645) -> (continuation of Deferred@1348564629 after retry RPC@1415510081)))

It can be useful to debug what happened to the chaining of deferreds
and callbacks, but usually it's not needed and it looks scary.

This patch makes it so that we only add the Deferred part if DEBUG
is enabled, so by default we'd instead output a more reasonable:

KuduRpc(method=Write, tablet=9d66b0bb6019492daca0a607fb0bd64b, attempt=8, DeadlineTracker(timeout=10000, elapsed=6289))

Change-Id: Iff08c234fef3ac0f0c6c8ec7c63078233c702f18
---
M java/kudu-client/src/main/java/org/kududb/client/KuduRpc.java
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/73/2873/1
-- 
To view, visit http://gerrit.cloudera.org:8080/2873
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff08c234fef3ac0f0c6c8ec7c63078233c702f18
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Jean-Daniel Cryans