ctubbsii commented on a change in pull request #1899:
URL: https://github.com/apache/accumulo/pull/1899#discussion_r574721044



##########
File path: 
server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
##########
@@ -556,14 +557,15 @@ private void manageMemory() {
                 continue;
               }
               Tablet tablet = tabletReport.getTablet();
-              if 
(!tablet.initiateMinorCompaction(MinorCompactionReason.SYSTEM)) {
-                if (tablet.isClosed()) {
+              var state = 
context.getTableManager().getTableState(tablet.getExtent().tableId());
+              if 
(!tablet.initiateMinorCompaction(MinorCompactionReason.SYSTEM, state)) {
+                if (tablet.isClosed() || state.equals(TableState.DELETING)) {

Review comment:
       Enums should always be compared using `==` instead of `.equals()`:
   
   ```suggestion
                   if (tablet.isClosed() || state == TableState.DELETING) {
   ```

##########
File path: 
server/tserver/src/main/java/org/apache/accumulo/tserver/memory/LargestFirstMemoryManager.java
##########
@@ -147,6 +148,11 @@ protected boolean tableExists(TableId tableId) {
     return context.getTableConfiguration(tableId) != null;
   }
 
+  private boolean tableBeingDeleted(TableId tableId) {
+    var state = context.getTableManager().getTableState(tableId);
+    return state.equals(TableState.DELETING);

Review comment:
       Should use `==` to compare enum.
   
   ```suggestion
       return context.getTableManager().getTableState(tableId) == 
TableState.DELETING;
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to