140
140
import org .apache .accumulo .core .iterators .IteratorUtil .IteratorScope ;
141
141
import org .apache .accumulo .core .iterators .SortedKeyValueIterator ;
142
142
import org .apache .accumulo .core .manager .state .tables .TableState ;
143
- import org .apache .accumulo .core .manager .thrift .FateOperation ;
144
143
import org .apache .accumulo .core .manager .thrift .FateService ;
145
144
import org .apache .accumulo .core .manager .thrift .ManagerClientService ;
146
145
import org .apache .accumulo .core .manager .thrift .TFateId ;
147
146
import org .apache .accumulo .core .manager .thrift .TFateInstanceType ;
147
+ import org .apache .accumulo .core .manager .thrift .TFateOperation ;
148
148
import org .apache .accumulo .core .metadata .AccumuloTable ;
149
149
import org .apache .accumulo .core .metadata .TServerInstance ;
150
150
import org .apache .accumulo .core .metadata .TabletState ;
@@ -274,7 +274,7 @@ public void create(String tableName, NewTableConfiguration ntc)
274
274
Map <String ,String > opts = ntc .getProperties ();
275
275
276
276
try {
277
- doTableFateOperation (tableName , AccumuloException .class , FateOperation .TABLE_CREATE , args ,
277
+ doTableFateOperation (tableName , AccumuloException .class , TFateOperation .TABLE_CREATE , args ,
278
278
opts );
279
279
} catch (TableNotFoundException e ) {
280
280
// should not happen
@@ -304,7 +304,7 @@ private TFateId beginFateOperation(TFateInstanceType type)
304
304
305
305
// This method is for retrying in the case of network failures;
306
306
// anything else it passes to the caller to deal with
307
- private void executeFateOperation (TFateId opid , FateOperation op , List <ByteBuffer > args ,
307
+ private void executeFateOperation (TFateId opid , TFateOperation op , List <ByteBuffer > args ,
308
308
Map <String ,String > opts , boolean autoCleanUp )
309
309
throws ThriftSecurityException , TException , ThriftTableOperationException {
310
310
while (true ) {
@@ -372,7 +372,7 @@ public String doBulkFateOperation(List<ByteBuffer> args, String tableName)
372
372
EXISTING_TABLE_NAME .validate (tableName );
373
373
374
374
try {
375
- return doFateOperation (FateOperation .TABLE_BULK_IMPORT2 , args , Collections .emptyMap (),
375
+ return doFateOperation (TFateOperation .TABLE_BULK_IMPORT2 , args , Collections .emptyMap (),
376
376
tableName );
377
377
} catch (TableExistsException | NamespaceExistsException e ) {
378
378
// should not happen
@@ -427,14 +427,14 @@ private <T> T handleFateOperation(FateOperationExecutor<T> executor, String tabl
427
427
}
428
428
}
429
429
430
- String doFateOperation (FateOperation op , List <ByteBuffer > args , Map <String ,String > opts ,
430
+ String doFateOperation (TFateOperation op , List <ByteBuffer > args , Map <String ,String > opts ,
431
431
String tableOrNamespaceName )
432
432
throws AccumuloSecurityException , TableExistsException , TableNotFoundException ,
433
433
AccumuloException , NamespaceExistsException , NamespaceNotFoundException {
434
434
return doFateOperation (op , args , opts , tableOrNamespaceName , true );
435
435
}
436
436
437
- String doFateOperation (FateOperation op , List <ByteBuffer > args , Map <String ,String > opts ,
437
+ String doFateOperation (TFateOperation op , List <ByteBuffer > args , Map <String ,String > opts ,
438
438
String tableOrNamespaceName , boolean wait )
439
439
throws AccumuloSecurityException , TableExistsException , TableNotFoundException ,
440
440
AccumuloException , NamespaceExistsException , NamespaceNotFoundException {
@@ -521,7 +521,7 @@ public void addSplits(String tableName, SortedSet<Text> splits)
521
521
return handleFateOperation (() -> {
522
522
TFateInstanceType t = FateInstanceType .fromNamespaceOrTableName (tableName ).toThrift ();
523
523
TFateId opid = beginFateOperation (t );
524
- executeFateOperation (opid , FateOperation .TABLE_SPLIT , args , Map .of (), false );
524
+ executeFateOperation (opid , TFateOperation .TABLE_SPLIT , args , Map .of (), false );
525
525
return new Pair <>(opid , splitsForTablet .getValue ());
526
526
}, tableName );
527
527
} catch (TableExistsException | NamespaceExistsException | NamespaceNotFoundException
@@ -645,8 +645,8 @@ public void merge(String tableName, Text start, Text end)
645
645
end == null ? EMPTY : TextUtil .getByteBuffer (end ));
646
646
Map <String ,String > opts = new HashMap <>();
647
647
try {
648
- doTableFateOperation (tableName , TableNotFoundException .class , FateOperation .TABLE_MERGE , args ,
649
- opts );
648
+ doTableFateOperation (tableName , TableNotFoundException .class , TFateOperation .TABLE_MERGE ,
649
+ args , opts );
650
650
} catch (TableExistsException e ) {
651
651
// should not happen
652
652
throw new AssertionError (e );
@@ -665,7 +665,7 @@ public void deleteRows(String tableName, Text start, Text end)
665
665
Map <String ,String > opts = new HashMap <>();
666
666
try {
667
667
doTableFateOperation (tableName , TableNotFoundException .class ,
668
- FateOperation .TABLE_DELETE_RANGE , args , opts );
668
+ TFateOperation .TABLE_DELETE_RANGE , args , opts );
669
669
} catch (TableExistsException e ) {
670
670
// should not happen
671
671
throw new AssertionError (e );
@@ -760,7 +760,7 @@ public void delete(String tableName)
760
760
List <ByteBuffer > args = List .of (ByteBuffer .wrap (tableName .getBytes (UTF_8 )));
761
761
Map <String ,String > opts = new HashMap <>();
762
762
try {
763
- doTableFateOperation (tableName , TableNotFoundException .class , FateOperation .TABLE_DELETE ,
763
+ doTableFateOperation (tableName , TableNotFoundException .class , TFateOperation .TABLE_DELETE ,
764
764
args , opts );
765
765
} catch (TableExistsException e ) {
766
766
// should not happen
@@ -800,7 +800,7 @@ public void clone(String srcTableName, String newTableName, CloneConfiguration c
800
800
801
801
prependPropertiesToExclude (opts , config .getPropertiesToExclude ());
802
802
803
- doTableFateOperation (newTableName , AccumuloException .class , FateOperation .TABLE_CLONE , args ,
803
+ doTableFateOperation (newTableName , AccumuloException .class , TFateOperation .TABLE_CLONE , args ,
804
804
opts );
805
805
}
806
806
@@ -813,7 +813,7 @@ public void rename(String oldTableName, String newTableName) throws AccumuloSecu
813
813
List <ByteBuffer > args = Arrays .asList (ByteBuffer .wrap (oldTableName .getBytes (UTF_8 )),
814
814
ByteBuffer .wrap (newTableName .getBytes (UTF_8 )));
815
815
Map <String ,String > opts = new HashMap <>();
816
- doTableFateOperation (oldTableName , TableNotFoundException .class , FateOperation .TABLE_RENAME ,
816
+ doTableFateOperation (oldTableName , TableNotFoundException .class , TFateOperation .TABLE_RENAME ,
817
817
args , opts );
818
818
}
819
819
@@ -892,7 +892,7 @@ public void compact(String tableName, CompactionConfig config)
892
892
Map <String ,String > opts = new HashMap <>();
893
893
894
894
try {
895
- doFateOperation (FateOperation .TABLE_COMPACT , args , opts , tableName , config .getWait ());
895
+ doFateOperation (TFateOperation .TABLE_COMPACT , args , opts , tableName , config .getWait ());
896
896
} catch (TableExistsException | NamespaceExistsException e ) {
897
897
// should not happen
898
898
throw new AssertionError (e );
@@ -912,7 +912,7 @@ public void cancelCompaction(String tableName)
912
912
913
913
try {
914
914
doTableFateOperation (tableName , TableNotFoundException .class ,
915
- FateOperation .TABLE_CANCEL_COMPACT , args , opts );
915
+ TFateOperation .TABLE_CANCEL_COMPACT , args , opts );
916
916
} catch (TableExistsException e ) {
917
917
// should not happen
918
918
throw new AssertionError (e );
@@ -1455,17 +1455,17 @@ private void changeTableState(String tableName, boolean wait, TableState newStat
1455
1455
1456
1456
TableId tableId = context .getTableId (tableName );
1457
1457
1458
- FateOperation op = null ;
1458
+ TFateOperation op = null ;
1459
1459
switch (newState ) {
1460
1460
case OFFLINE :
1461
- op = FateOperation .TABLE_OFFLINE ;
1461
+ op = TFateOperation .TABLE_OFFLINE ;
1462
1462
if (tableName .equals (AccumuloTable .METADATA .tableName ())
1463
1463
|| tableName .equals (AccumuloTable .ROOT .tableName ())) {
1464
1464
throw new AccumuloException ("Cannot set table to offline state" );
1465
1465
}
1466
1466
break ;
1467
1467
case ONLINE :
1468
- op = FateOperation .TABLE_ONLINE ;
1468
+ op = TFateOperation .TABLE_ONLINE ;
1469
1469
if (tableName .equals (AccumuloTable .METADATA .tableName ())
1470
1470
|| tableName .equals (AccumuloTable .ROOT .tableName ())) {
1471
1471
// Don't submit a Fate operation for this, these tables can only be online.
@@ -1694,7 +1694,7 @@ public void importTable(String tableName, Set<String> importDirs, ImportConfigur
1694
1694
checkedImportDirs .stream ().map (s -> s .getBytes (UTF_8 )).map (ByteBuffer ::wrap ).forEach (args ::add );
1695
1695
1696
1696
try {
1697
- doTableFateOperation (tableName , AccumuloException .class , FateOperation .TABLE_IMPORT , args ,
1697
+ doTableFateOperation (tableName , AccumuloException .class , TFateOperation .TABLE_IMPORT , args ,
1698
1698
Collections .emptyMap ());
1699
1699
} catch (TableNotFoundException e ) {
1700
1700
// should not happen
@@ -1727,7 +1727,7 @@ public void exportTable(String tableName, String exportDir)
1727
1727
Map <String ,String > opts = Collections .emptyMap ();
1728
1728
1729
1729
try {
1730
- doTableFateOperation (tableName , TableNotFoundException .class , FateOperation .TABLE_EXPORT ,
1730
+ doTableFateOperation (tableName , TableNotFoundException .class , TFateOperation .TABLE_EXPORT ,
1731
1731
args , opts );
1732
1732
} catch (TableExistsException e ) {
1733
1733
// should not happen
@@ -1782,7 +1782,7 @@ public int addConstraint(String tableName, String constraintClassName)
1782
1782
}
1783
1783
1784
1784
private void doTableFateOperation (String tableOrNamespaceName ,
1785
- Class <? extends Exception > namespaceNotFoundExceptionClass , FateOperation op ,
1785
+ Class <? extends Exception > namespaceNotFoundExceptionClass , TFateOperation op ,
1786
1786
List <ByteBuffer > args , Map <String ,String > opts ) throws AccumuloSecurityException ,
1787
1787
AccumuloException , TableExistsException , TableNotFoundException {
1788
1788
try {
@@ -2212,7 +2212,7 @@ public void setTabletAvailability(String tableName, Range range, TabletAvailabil
2212
2212
2213
2213
try {
2214
2214
doTableFateOperation (tableName , AccumuloException .class ,
2215
- FateOperation .TABLE_TABLET_AVAILABILITY , args , opts );
2215
+ TFateOperation .TABLE_TABLET_AVAILABILITY , args , opts );
2216
2216
} catch (TableNotFoundException | TableExistsException e ) {
2217
2217
// should not happen
2218
2218
throw new AssertionError (e );
0 commit comments