milleruntime closed pull request #395: ACCUMULO-4835 Make TableOps throw TableNotFound URL: https://github.com/apache/accumulo/pull/395
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 3015b1dd73..d976c4d93e 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 @@ private void waitForTableStateTransition(String tableId, TableState expectedStat 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 ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services