ctubbsii commented on code in PR #6470:
URL: https://github.com/apache/accumulo/pull/6470#discussion_r3554044184


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocator.java:
##########
@@ -131,8 +131,8 @@ static synchronized boolean isEnabled() {
   }
 
   static synchronized void disable() {
-    clearLocators();
     enabled = false;
+    clearLocators();

Review Comment:
   I'm not sure changing this order matters.



##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocator.java:
##########
@@ -116,7 +116,7 @@ public boolean equals(LocatorKey lk) {
   private static final HashMap<LocatorKey,TabletLocator> locators = new 
HashMap<>();
   private static final HashMap<LocatorKey,OfflineTabletLocatorImpl> 
offlineLocators =
       new HashMap<>();
-  private static boolean enabled = true;
+  private static volatile boolean enabled = true;

Review Comment:
   +1



##########
core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java:
##########
@@ -631,51 +631,63 @@ private synchronized TableZooHelper tableZooHelper() {
   }
 
   public TableId getTableId(String tableName) throws TableNotFoundException {
+    ensureOpen();
     return tableZooHelper().getTableId(tableName);
   }
 
   public TableId _getTableIdDetectNamespaceNotFound(String tableName)
       throws NamespaceNotFoundException, TableNotFoundException {
+    ensureOpen();
     return tableZooHelper()._getTableIdDetectNamespaceNotFound(tableName);
   }
 
   public String getTableName(TableId tableId) throws TableNotFoundException {
+    ensureOpen();
     return tableZooHelper().getTableName(tableId);
   }
 
   public Map<String,TableId> getTableNameToIdMap() {
+    ensureOpen();
     return tableZooHelper().getTableMap().getNameToIdMap();
   }
 
   public Map<TableId,String> getTableIdToNameMap() {
+    ensureOpen();
     return tableZooHelper().getTableMap().getIdtoNameMap();
   }
 
   public boolean tableNodeExists(TableId tableId) {
+    ensureOpen();
     return tableZooHelper().tableNodeExists(tableId);
   }
 
   public void clearTableListCache() {
+    ensureOpen();
     tableZooHelper().clearTableListCache();
   }
 
   public String getPrintableTableInfoFromId(TableId tableId) {
+    ensureOpen();
     return tableZooHelper().getPrintableTableInfoFromId(tableId);
   }
 
   public String getPrintableTableInfoFromName(String tableName) {
+    ensureOpen();
     return tableZooHelper().getPrintableTableInfoFromName(tableName);
   }
 
   public TableState getTableState(TableId tableId) {
+    ensureOpen();
     return tableZooHelper().getTableState(tableId, false);
   }
 
   public TableState getTableState(TableId tableId, boolean clearCachedState) {
+    ensureOpen();
     return tableZooHelper().getTableState(tableId, clearCachedState);
   }
 
   public NamespaceId getNamespaceId(TableId tableId) throws 
TableNotFoundException {
+    ensureOpen();

Review Comment:
   The first thing that tableZooHelper() does is ensureOpen(), so this check is 
redundant on all the calls that are calling tableZooHelper()



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

Reply via email to