dlmarion commented on code in PR #3220:
URL: https://github.com/apache/accumulo/pull/3220#discussion_r1142395725
##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java:
##########
@@ -1479,36 +1463,90 @@ public void online(String tableName)
online(tableName, false);
}
- @Override
- public void online(String tableName, boolean wait)
+ private void changeTableState(String tableName, boolean wait, TableState
newState)
throws AccumuloSecurityException, AccumuloException,
TableNotFoundException {
EXISTING_TABLE_NAME.validate(tableName);
TableId tableId = context.getTableId(tableName);
- /**
- * ACCUMULO-4574 if table is already online return without executing fate
operation.
- */
- if (isOnline(tableName)) {
- if (wait) {
- waitForTableStateTransition(tableId, TableState.ONLINE);
- }
- return;
+
+ FateOperation op = null;
+ switch (newState) {
+ case OFFLINE:
+ op = FateOperation.TABLE_OFFLINE;
+ break;
+ case ONDEMAND:
+ op = FateOperation.TABLE_ONDEMAND;
+ if (tableName.equals(MetadataTable.NAME) ||
tableName.equals(RootTable.NAME)) {
Review Comment:
Yeah, I was just copying what was there, but I did notice that it was not
consistent. Root and Metadata should always be online, right? Enforce client
side that OFFLINE and ONDEMAND does *not* work for those tables.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]