You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Jean-Daniel Cryans (Code Review)" <ge...@cloudera.org> on 2016/07/07 18:14:43 UTC
[kudu-CR] RFC [java client] Redo how we manage exceptions
Hello Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/3055
to look at the new patch set (#2).
Change subject: RFC [java client] Redo how we manage exceptions
......................................................................
RFC [java client] Redo how we manage exceptions
Right now the exceptions are hard to handle in the Java client. They're all
generic and you need to do a lot of introspection. For example, if you try
to create a table that already exists, you need to start searching the
exception's message to know if it's that or some other problem that gave
you the error.
With this patch we now only have two kinds of concrete exceptions. Here's the tree:
KuduException
|
\-> RecoverableException
|
\-> NonRecoverableException
The parent class has a new field, `status`, which is your regular Kudu Status
object. Wherever we can we try to recreate the Status objects that are sent
to us from the servers, else we create our own. Now for the example above we
can just query the exception's status with `isNotFound()`.
There's more work than just what's in this patch. We could convert all the
generic exceptions caused by Deferreds into KuduException by using a single
errback, then our sync APIs could return that too.
But first I'd like to get some comments on my approach.
Change-Id: Iba6e8a022d7a5391c3657cbdc9d3f06f951be048
---
M java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java
M java/kudu-client/src/main/java/org/kududb/client/AsyncKuduScanner.java
M java/kudu-client/src/main/java/org/kududb/client/AsyncKuduSession.java
D java/kudu-client/src/main/java/org/kududb/client/ConnectionResetException.java
M java/kudu-client/src/main/java/org/kududb/client/GetMasterRegistrationReceived.java
D java/kudu-client/src/main/java/org/kududb/client/InvalidResponseException.java
M java/kudu-client/src/main/java/org/kududb/client/KuduClient.java
M java/kudu-client/src/main/java/org/kududb/client/KuduException.java
M java/kudu-client/src/main/java/org/kududb/client/KuduRpc.java
D java/kudu-client/src/main/java/org/kududb/client/KuduServerException.java
D java/kudu-client/src/main/java/org/kududb/client/MasterErrorException.java
M java/kudu-client/src/main/java/org/kududb/client/NoLeaderMasterFoundException.java
M java/kudu-client/src/main/java/org/kududb/client/NonCoveredRangeException.java
M java/kudu-client/src/main/java/org/kududb/client/NonRecoverableException.java
M java/kudu-client/src/main/java/org/kududb/client/PleaseThrottleException.java
M java/kudu-client/src/main/java/org/kududb/client/RecoverableException.java
M java/kudu-client/src/main/java/org/kududb/client/RowResultIterator.java
M java/kudu-client/src/main/java/org/kududb/client/Status.java
M java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
D java/kudu-client/src/main/java/org/kududb/client/TabletServerErrorException.java
M java/kudu-client/src/test/java/org/kududb/client/TestAsyncKuduSession.java
M java/kudu-client/src/test/java/org/kududb/client/TestKuduSession.java
M java/kudu-client/src/test/java/org/kududb/client/TestKuduTable.java
23 files changed, 201 insertions(+), 365 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/55/3055/2
--
To view, visit http://gerrit.cloudera.org:8080/3055
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iba6e8a022d7a5391c3657cbdc9d3f06f951be048
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dan Burkert <da...@cloudera.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>