accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject [accumulo] branch 1.7 updated: ACCUMULO-4835 Make TableOps throw TableNotFound (#395)
Date Tue, 06 Mar 2018 18:00:11 GMT
This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch 1.7
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/1.7 by this push:
     new 68f70d5  ACCUMULO-4835 Make TableOps throw TableNotFound (#395)
68f70d5 is described below

commit 68f70d5d557ad9ceec8acfb509906dbc19a0cf15
Author: Mike Miller <mmiller@apache.org>
AuthorDate: Tue Mar 6 13:00:07 2018 -0500

    ACCUMULO-4835 Make TableOps throw TableNotFound (#395)
    
    * Also removed redundant Range assignment in loop
---
 .../org/apache/accumulo/core/client/impl/TableOperationsImpl.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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 3015b1d..d976c4d 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
@@ -1069,14 +1069,17 @@ public class TableOperationsImpl extends TableOperationsHelper {
 
       if (Tables.getTableState(context.getInstance(), tableId) != expectedState) {
         Tables.clearCache(context.getInstance());
-        if (Tables.getTableState(context.getInstance(), tableId) != expectedState) {
+        TableState currentState = Tables.getTableState(context.getInstance(), tableId);
+        if (currentState != expectedState) {
           if (!Tables.exists(context.getInstance(), tableId))
             throw new TableDeletedException(tableId);
+          if (currentState == TableState.DELETING)
+            throw new TableNotFoundException(tableId, "", "Table is being deleted.");
           throw new AccumuloException("Unexpected table state " + tableId + " " + Tables.getTableState(context.getInstance(),
tableId) + " != " + expectedState);
         }
       }
 
-      Range range = new KeyExtent(new Text(tableId), null, null).toMetadataRange();
+      Range range;
       if (startRow == null || lastRow == null)
         range = new KeyExtent(new Text(tableId), null, null).toMetadataRange();
       else

-- 
To stop receiving notification emails like this one, please contact
mmiller@apache.org.

Mime
View raw message