accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] milleruntime closed pull request #393: Add TableOfflineException to TableOps.addSplits
Date Thu, 01 Mar 2018 15:32:46 GMT
milleruntime closed pull request #393: Add TableOfflineException to TableOps.addSplits
URL: https://github.com/apache/accumulo/pull/393
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
index 0c3e0e6c60..3015b1dd73 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
@@ -394,6 +394,9 @@ public void addSplits(String tableName, SortedSet<Text> partitionKeys)
throws Ta
           if (excep instanceof TableNotFoundException) {
             TableNotFoundException tnfe = (TableNotFoundException) excep;
             throw new TableNotFoundException(tableId, tableName, "Table not found by background
thread", tnfe);
+          } else if (excep instanceof TableOfflineException) {
+            log.debug("TableOfflineException occurred in background thread. Throwing new
exception", excep);
+            throw new TableOfflineException(context.getInstance(), tableId);
           } else if (excep instanceof AccumuloSecurityException) {
             // base == background accumulo security exception
             AccumuloSecurityException base = (AccumuloSecurityException) excep;
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
index e02629918f..dc040a6eb9 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
@@ -22,7 +22,6 @@
 import java.util.Random;
 import java.util.TreeSet;
 
-import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.TableOfflineException;
@@ -58,12 +57,6 @@ public void visit(State state, Environment env, Properties props) throws
Excepti
       log.debug("AddSplits " + tableName + " failed, doesnt exist");
     } catch (TableOfflineException e) {
       log.debug("AddSplits " + tableName + " failed, offline");
-    } catch (AccumuloException ae) {
-      Throwable cause = ae.getCause();
-      if (cause != null && cause instanceof TableOfflineException)
-        log.debug("AddSplits " + tableName + " failed, offline");
-      else
-        throw ae;
     }
   }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message