dlmarion commented on code in PR #3294:
URL: https://github.com/apache/accumulo/pull/3294#discussion_r1166982115


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocatorImpl.java:
##########
@@ -542,70 +549,99 @@ public TabletLocation locateTablet(ClientContext context, 
Text row, boolean skip
   }
 
   @Override
-  public long onDemandTabletsOnlined() {
-    return onDemandTabletsOnlinedCount.get();
+  public long getTabletHostingRequestCount() {
+    return tabletHostingRequestCount.get();
+  }
+
+  @VisibleForTesting
+  public void resetTabletHostingRequestCount() {
+    tabletHostingRequestCount.set(0);
   }
 
-  private void bringOnDemandTabletsOnline(ClientContext context, Range range)
+  @VisibleForTesting
+  public void enableTabletHostingRequests(boolean enabled) {
+    HOSTING_ENABLED.set(enabled);
+  }
+
+  private void requestTabletHosting(ClientContext context, Range range)
       throws AccumuloException, AccumuloSecurityException {
 
-    // Confirm that table is in an on-demand state. Don't throw an exception
+    if (!HOSTING_ENABLED.get()) {
+      return;
+    }
+
+    // System tables should always be hosted
+    if (RootTable.ID == tableId || MetadataTable.ID == tableId) {
+      return;
+    }
+
+    // Confirm that table is in an online state. Don't throw an exception
     // if the table is not found, calling code will already handle it.
     try {
       String tableName = context.getTableName(tableId);
-      if (!context.tableOperations().isOnDemand(tableName)) {
-        log.trace("bringOnDemandTabletsOnline: table {} is not in ondemand 
state", tableId);
+      if (!context.tableOperations().isOnline(tableName)) {
+        log.trace("requestTabletHosting: table {} is not online", tableId);
         return;
       }
     } catch (TableNotFoundException e) {
-      log.trace("bringOnDemandTabletsOnline: table not found: {}", tableId);
+      log.trace("requestTabletHosting: table not found: {}", tableId);

Review Comment:
   Updated based on your suggestion in d579d7b



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