This is an automated email from the ASF dual-hosted git repository.

marcuse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cassandra-diff.git


The following commit(s) were added to refs/heads/master by this push:
     new c8670b0  Enrich error message on request exceptions (#7)
c8670b0 is described below

commit c8670b0fdcfebd0edbf9e43ef3cc6d46cde36b0f
Author: Yifan Cai <[email protected]>
AuthorDate: Mon Apr 13 23:30:56 2020 -0700

    Enrich error message on request exceptions (#7)
---
 .../java/org/apache/cassandra/diff/DiffCluster.java   | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/spark-job/src/main/java/org/apache/cassandra/diff/DiffCluster.java 
b/spark-job/src/main/java/org/apache/cassandra/diff/DiffCluster.java
index 4e108e3..4bbd81c 100644
--- a/spark-job/src/main/java/org/apache/cassandra/diff/DiffCluster.java
+++ b/spark-job/src/main/java/org/apache/cassandra/diff/DiffCluster.java
@@ -86,8 +86,10 @@ public class DiffCluster implements AutoCloseable
         try {
             return 
Uninterruptibles.getUninterruptibly(fetchPartitionKeys(table, prevToken, 
token));
         }
-        catch (ExecutionException e) {
-            throw new RuntimeException(e);
+        catch (ExecutionException ex) {
+            throw new RuntimeException(String.format("Unable to get partition 
keys (%s, %s] in table (%s) from cluster (%s)",
+                                                     prevToken, token, table, 
clusterId.name()),
+                                       ex);
         }
     }
 
@@ -118,9 +120,16 @@ public class DiffCluster implements AutoCloseable
     }
 
     public Iterator<Row> getPartition(TableSpec table, PartitionKey key, 
boolean shouldReverse) {
-        return readPartition(table.getTable(), key, shouldReverse)
-               .getUninterruptibly()
-               .iterator();
+        try {
+            return readPartition(table.getTable(), key, shouldReverse)
+                       .getUninterruptibly()
+                       .iterator();
+        }
+        catch (Exception ex) {
+            throw new RuntimeException(String.format("Unable to get partition 
(%s) in table (%s) from cluster (%s)",
+                                                     
key.getTokenAsBigInteger(), table, clusterId.name()),
+                                       ex);
+        }
     }
 
     private ResultSetFuture readPartition(String table, final PartitionKey 
key, boolean shouldReverse) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to