|
41 | 41 | import static org.apache.accumulo.core.util.LazySingletons.RANDOM;
|
42 | 42 | import static org.apache.accumulo.core.util.Validators.EXISTING_TABLE_NAME;
|
43 | 43 | import static org.apache.accumulo.core.util.Validators.NEW_TABLE_NAME;
|
44 |
| -import static org.apache.accumulo.core.util.Validators.NOT_BUILTIN_TABLE; |
45 | 44 | import static org.apache.accumulo.core.util.threads.ThreadPoolNames.SPLIT_START_POOL;
|
46 | 45 | import static org.apache.accumulo.core.util.threads.ThreadPoolNames.SPLIT_WAIT_POOL;
|
47 | 46 |
|
@@ -223,8 +222,7 @@ public SortedSet<String> list() {
|
223 | 222 | public boolean exists(String tableName) {
|
224 | 223 | EXISTING_TABLE_NAME.validate(tableName);
|
225 | 224 |
|
226 |
| - if (tableName.equals(SystemTables.METADATA.tableName()) |
227 |
| - || tableName.equals(SystemTables.ROOT.tableName())) { |
| 225 | + if (SystemTables.containsTableName(tableName)) { |
228 | 226 | return true;
|
229 | 227 | }
|
230 | 228 |
|
@@ -1517,15 +1515,13 @@ private void changeTableState(String tableName, boolean wait, TableState newStat
|
1517 | 1515 | switch (newState) {
|
1518 | 1516 | case OFFLINE:
|
1519 | 1517 | op = TFateOperation.TABLE_OFFLINE;
|
1520 |
| - if (tableName.equals(SystemTables.METADATA.tableName()) |
1521 |
| - || tableName.equals(SystemTables.ROOT.tableName())) { |
| 1518 | + if (SystemTables.containsTableName(tableName)) { |
1522 | 1519 | throw new AccumuloException("Cannot set table to offline state");
|
1523 | 1520 | }
|
1524 | 1521 | break;
|
1525 | 1522 | case ONLINE:
|
1526 | 1523 | op = TFateOperation.TABLE_ONLINE;
|
1527 |
| - if (tableName.equals(SystemTables.METADATA.tableName()) |
1528 |
| - || tableName.equals(SystemTables.ROOT.tableName())) { |
| 1524 | + if (SystemTables.containsTableName(tableName)) { |
1529 | 1525 | // Don't submit a Fate operation for this, these tables can only be online.
|
1530 | 1526 | return;
|
1531 | 1527 | }
|
@@ -2249,7 +2245,10 @@ private void validatePropertiesToSet(Map<String,String> opts, Map<String,String>
|
2249 | 2245 | public void setTabletAvailability(String tableName, Range range, TabletAvailability availability)
|
2250 | 2246 | throws AccumuloSecurityException, AccumuloException {
|
2251 | 2247 | EXISTING_TABLE_NAME.validate(tableName);
|
2252 |
| - NOT_BUILTIN_TABLE.validate(tableName); |
| 2248 | + if (SystemTables.containsTableName(tableName)) { |
| 2249 | + throw new AccumuloException("Cannot set set tablet availability for table " + tableName); |
| 2250 | + } |
| 2251 | + |
2253 | 2252 | checkArgument(range != null, "range is null");
|
2254 | 2253 | checkArgument(availability != null, "tabletAvailability is null");
|
2255 | 2254 |
|
|
0 commit comments