You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "cshannon (via GitHub)" <gi...@apache.org> on 2023/03/18 15:57:24 UTC

[GitHub] [accumulo] cshannon commented on a diff in pull request #3220: Add ondemand table state

cshannon commented on code in PR #3220:
URL: https://github.com/apache/accumulo/pull/3220#discussion_r1141041069


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java:
##########
@@ -1511,6 +1511,60 @@ public void online(String tableName, boolean wait)
     }
   }
 
+  @Override
+  public boolean isOnDemand(String tableName) throws AccumuloException, TableNotFoundException {
+    EXISTING_TABLE_NAME.validate(tableName);
+
+    if (tableName.equals(MetadataTable.NAME) || tableName.equals(RootTable.NAME)) {
+      return false;
+    }
+
+    TableId tableId = context.getTableId(tableName);
+    TableState expectedState = context.getTableState(tableId, true);
+    return expectedState == TableState.ONDEMAND;
+  }
+
+  @Override
+  public void onDemand(String tableName)
+      throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
+    onDemand(tableName, false);
+  }
+
+  @Override
+  public void onDemand(String tableName, boolean wait)

Review Comment:
   This method seems like an (almost) identical copy of the online(tablename, wait) method except for the check for MetadataTable/Root. I am thinking we should be able to re-use the logic here by creating a helper method and just pass in the state that we are transitioning too so we don't need to copy/paste.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org