This is an automated email from the ASF dual-hosted git repository.

domgarguilo pushed a commit to branch elasticity
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/elasticity by this push:
     new 7a54f64282 Fix onDemand javadoc and comments (#3268)
7a54f64282 is described below

commit 7a54f64282206c060471a757b14b3374095b670b
Author: Dom G <[email protected]>
AuthorDate: Mon Apr 3 11:17:26 2023 -0400

    Fix onDemand javadoc and comments (#3268)
---
 .../accumulo/core/client/admin/TableOperations.java  | 16 ++++++++--------
 .../accumulo/core/clientImpl/TabletLocatorImpl.java  |  2 +-
 .../java/org/apache/accumulo/core/conf/Property.java |  4 ++--
 .../accumulo/core/metrics/MetricsProducer.java       |  5 +++--
 .../core/spi/ondemand/OnDemandTabletUnloader.java    |  2 +-
 .../apache/accumulo/server/tables/TableManager.java  |  2 +-
 .../org/apache/accumulo/tserver/TabletServer.java    | 20 ++++++++++----------
 .../tserver/metrics/TabletServerMetrics.java         |  4 ++--
 .../test/functional/ManagerAssignmentIT.java         | 12 ++++++------
 .../test/functional/TabletStateChangeIteratorIT.java | 10 +++++-----
 10 files changed, 39 insertions(+), 38 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java 
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
index 6d8e464b54..5ec2f64338 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
@@ -1014,9 +1014,9 @@ public interface TableOperations {
   }
 
   /**
-   * Initiates setting a table to ondemand state, but does not wait for action 
to complete
+   * Initiates setting a table to an on-demand state, but does not wait for 
action to complete
    *
-   * @param tableName the table to take online
+   * @param tableName the table to set to an on-demand state
    * @throws AccumuloException when there is a general accumulo error
    * @throws AccumuloSecurityException when the user does not have the proper 
permissions
    * @since 3.1.0
@@ -1025,10 +1025,10 @@ public interface TableOperations {
       throws AccumuloSecurityException, AccumuloException, 
TableNotFoundException;
 
   /**
-   * Initiates setting a table to ondemand state, optionally waits for action 
to complete
+   * Initiates setting a table to an on-demand state, optionally waits for 
action to complete
    *
-   * @param tableName the table to take online
-   * @param wait if true, then will not return until table is online
+   * @param tableName the table to set to an on-demand state
+   * @param wait if true, then will not return until table state is set to an 
on-demand state
    * @throws AccumuloException when there is a general accumulo error
    * @throws AccumuloSecurityException when the user does not have the proper 
permissions
    * @since 3.1.0
@@ -1037,12 +1037,12 @@ public interface TableOperations {
       throws AccumuloSecurityException, AccumuloException, 
TableNotFoundException;
 
   /**
-   * Check if a table is ondemand through its current goal state only. Could 
run into issues if the
+   * Check if a table is on-demand through its current goal state only. Could 
run into issues if the
    * current state of the table is in between states. If you require a 
specific state, call
-   * <code>ondemand(tableName, true)</code>, this will wait until the table 
reaches the desired
+   * <code>onDemand(tableName, true)</code>, this will wait until the table 
reaches the desired
    * state before proceeding.
    *
-   * @param tableName the table to check if online
+   * @param tableName the table to check if in an on-demand state
    * @throws AccumuloException when there is a general accumulo error
    * @return true if table's goal state is online
    * @since 3.1.0
diff --git 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocatorImpl.java 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocatorImpl.java
index 4df37834a4..6674a09bdf 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocatorImpl.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocatorImpl.java
@@ -549,7 +549,7 @@ public class TabletLocatorImpl extends TabletLocator {
   private void bringOnDemandTabletsOnline(ClientContext context, Range range)
       throws AccumuloException, AccumuloSecurityException {
 
-    // Confirm that table is in an onDemand state. Don't throw an exception
+    // Confirm that table is in an on-demand state. Don't throw an exception
     // if the table is not found, calling code will already handle it.
     try {
       String tableName = context.getTableName(tableId);
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java 
b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
index a8e485f7c8..5678d2d418 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
@@ -750,7 +750,7 @@ public enum Property {
       "2.1.1"),
   
TSERV_ONDEMAND_UNLOADER_INTERVAL("tserver.ondemand.tablet.unloader.interval", 
"10m",
       PropertyType.TIMEDURATION,
-      "The interval at which the TabletServer will check if onDemand tablets 
can be unloaded",
+      "The interval at which the TabletServer will check if on-demand tablets 
can be unloaded",
       "3.1.0"),
 
   // accumulo garbage collector properties
@@ -890,7 +890,7 @@ public enum Property {
       "Options for the table compaction configuror", "2.1.0"),
   TABLE_ONDEMAND_UNLOADER("tserver.ondemand.tablet.unloader",
       "org.apache.accumulo.core.spi.ondemand.DefaultOnDemandTabletUnloader", 
PropertyType.CLASSNAME,
-      "The class that will be used to determine which onDemand Tablets to 
unload.", "3.1.0"),
+      "The class that will be used to determine which on-demand Tablets to 
unload.", "3.1.0"),
 
   // Crypto-related properties
   @Experimental
diff --git 
a/core/src/main/java/org/apache/accumulo/core/metrics/MetricsProducer.java 
b/core/src/main/java/org/apache/accumulo/core/metrics/MetricsProducer.java
index 284892babc..60be9e88a2 100644
--- a/core/src/main/java/org/apache/accumulo/core/metrics/MetricsProducer.java
+++ b/core/src/main/java/org/apache/accumulo/core/metrics/MetricsProducer.java
@@ -291,14 +291,15 @@ import io.micrometer.core.instrument.MeterRegistry;
  * <td></td>
  * <td>{@link #METRICS_TSERVER_TABLETS_ONLINE_ONDEMAND}</td>
  * <td>Gauge</td>
- * <td>Represents the number of ondemand tablets that are online</td>
+ * <td>Represents the number of on-demand tablets that are online</td>
  * </tr>
  * <tr>
  * <td></td>
  * <td></td>
  * <td>{@link #METRICS_TSERVER_TABLETS_ONDEMAND_UNLOADED_FOR_MEM}</td>
  * <td>Gauge</td>
- * <td>Represents the number of ondemand tablets that were unloaded due to low 
memory condition</td>
+ * <td>Represents the number of on-demand tablets that were unloaded due to 
low memory
+ * condition</td>
  * </tr>
  * <tr>
  * <td>N/A</td>
diff --git 
a/core/src/main/java/org/apache/accumulo/core/spi/ondemand/OnDemandTabletUnloader.java
 
b/core/src/main/java/org/apache/accumulo/core/spi/ondemand/OnDemandTabletUnloader.java
index f9116e4137..6f4eacda8d 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/spi/ondemand/OnDemandTabletUnloader.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/spi/ondemand/OnDemandTabletUnloader.java
@@ -25,7 +25,7 @@ import org.apache.accumulo.core.data.TabletId;
 import org.apache.accumulo.core.spi.common.ServiceEnvironment;
 
 /**
- * Object used by the TabletServer to determine which onDemand Tablets to 
unload for a Table
+ * Object used by the TabletServer to determine which on-demand Tablets to 
unload for a Table
  *
  * @since 3.1.0
  */
diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java 
b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
index 7ce767d17c..d831f9d527 100644
--- 
a/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
+++ 
b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
@@ -189,7 +189,7 @@ public class TableManager {
       log.error("FATAL Failed to transition table to state {}", newState);
       throw new RuntimeException(e);
     }
-    // Remove onDemand columns from all tablets
+    // Remove on-demand columns from all tablets
     if (tableId != RootTable.ID && tableId != MetadataTable.ID
         && (newState == TableState.ONLINE || newState == TableState.OFFLINE)) {
       try (TabletsMutator mutator = context.getAmple().mutateTablets()) {
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index da228b8eb8..5308542e17 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -1359,8 +1359,8 @@ public class TabletServer extends AbstractServer 
implements TabletHostingServer
     }
 
     // It's possible, from a tablet split or merge for example,
-    // that there is an onDemand tablet that is hosted for which
-    // we have no access time. Add any missing online onDemand
+    // that there is an on-demand tablet that is hosted for which
+    // we have no access time. Add any missing online on-demand
     // tablets
     online.forEach((k, v) -> {
       if (v.isOnDemand() && !onDemandTabletAccessTimes.containsKey(k)) {
@@ -1368,21 +1368,21 @@ public class TabletServer extends AbstractServer 
implements TabletHostingServer
       }
     });
 
-    log.debug("Evaluating online onDemand tablets: {}", 
onDemandTabletAccessTimes);
+    log.debug("Evaluating online on-demand tablets: {}", 
onDemandTabletAccessTimes);
 
     if (onDemandTabletAccessTimes.isEmpty()) {
       return;
     }
 
     // If the TabletServer is running low on memory, don't call the SPI
-    // plugin to evaluate which onDemand tablets to unload, just get the
-    // onDemand tablet with the oldest access time and unload it.
+    // plugin to evaluate which on-demand tablets to unload, just get the
+    // on-demand tablet with the oldest access time and unload it.
     if (getContext().getLowMemoryDetector().isRunningLowOnMemory()) {
       final SortedMap<Long,KeyExtent> timeSortedOnDemandExtents = new 
TreeMap<>();
       onDemandTabletAccessTimes.forEach((k, v) -> 
timeSortedOnDemandExtents.put(v.get(), k));
       Long oldestAccessTime = timeSortedOnDemandExtents.firstKey();
       KeyExtent oldestKeyExtent = 
timeSortedOnDemandExtents.get(oldestAccessTime);
-      log.warn("Unloading onDemand tablet: {} for table: {} due to low 
memory", oldestKeyExtent,
+      log.warn("Unloading on-demand tablet: {} for table: {} due to low 
memory", oldestKeyExtent,
           oldestKeyExtent.tableId());
       
getContext().getAmple().mutateTablet(oldestKeyExtent).deleteOnDemand().mutate();
       onDemandUnloadedLowMemory.addAndGet(1);
@@ -1418,7 +1418,7 @@ public class TabletServer extends AbstractServer 
implements TabletHostingServer
     Set<TableId> tableIds = sortedOnDemandExtents.keySet().stream().map((k) -> 
{
       return k.tableId();
     }).distinct().collect(Collectors.toSet());
-    log.debug("Tables that have online onDemand tablets: {}", tableIds);
+    log.debug("Tables that have online on-demand tablets: {}", tableIds);
     final Map<TableId,OnDemandTabletUnloader> unloaders = new HashMap<>();
     tableIds.forEach(tid -> {
       TableConfiguration tconf = getContext().getTableConfiguration(tid);
@@ -1432,7 +1432,7 @@ public class TabletServer extends AbstractServer 
implements TabletHostingServer
           | IllegalArgumentException | InvocationTargetException | 
NoSuchMethodException
           | SecurityException e) {
         log.error(
-            "Error constructing OnDemandTabletUnloader implementation, not 
unloading onDemand tablets",
+            "Error constructing OnDemandTabletUnloader implementation, not 
unloading on-demand tablets",
             e);
         return;
       }
@@ -1443,13 +1443,13 @@ public class TabletServer extends AbstractServer 
implements TabletHostingServer
               .filter((e) -> e.getKey().tableId().equals(tid))
               .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));
       Set<KeyExtent> onDemandTabletsToUnload = new HashSet<>();
-      log.debug("Evaluating onDemand tablets for unload for table {}, extents 
{}", tid,
+      log.debug("Evaluating on-demand tablets for unload for table {}, extents 
{}", tid,
           subset.keySet());
       UnloaderParams params = new UnloaderParamsImpl(tid, new 
ServiceEnvironmentImpl(context),
           subset, onDemandTabletsToUnload);
       unloaders.get(tid).evaluate(params);
       onDemandTabletsToUnload.forEach(ke -> {
-        log.debug("Unloading onDemand tablet: {} for table: {}", ke, tid);
+        log.debug("Unloading on-demand tablet: {} for table: {}", ke, tid);
         getContext().getAmple().mutateTablet(ke).deleteOnDemand().mutate();
       });
     });
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetrics.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetrics.java
index b1e60d7e47..49b0e013b7 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetrics.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetrics.java
@@ -63,11 +63,11 @@ public class TabletServerMetrics implements MetricsProducer 
{
     Gauge
         .builder(METRICS_TSERVER_TABLETS_ONLINE_ONDEMAND, util,
             TabletServerMetricsUtil::getOnDemandOnlineCount)
-        .description("Number of online ondemand tablets").register(registry);
+        .description("Number of online on-demand tablets").register(registry);
     Gauge
         .builder(METRICS_TSERVER_TABLETS_ONDEMAND_UNLOADED_FOR_MEM, util,
             TabletServerMetricsUtil::getOnDemandUnloadedLowMem)
-        .description("Number of online ondemand tablets unloaded due to low 
memory")
+        .description("Number of online on-demand tablets unloaded due to low 
memory")
         .register(registry);
     Gauge.builder(METRICS_TSERVER_TABLETS_ONLINE, util, 
TabletServerMetricsUtil::getOnlineCount)
         .description("Number of online tablets").register(registry);
diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
 
b/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
index f73133167c..b5a2c19a36 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
@@ -127,7 +127,7 @@ public class ManagerAssignmentIT extends 
SharedMiniClusterBase {
       assertNull(offline.current);
       assertEquals(flushed.getCurrentServer(), offline.getLastServer());
 
-      // set the table to ondemand
+      // set the table to on-demand
       c.tableOperations().onDemand(tableName, true);
       TabletLocationState ondemand = getTabletLocationState(c, tableId);
       assertNull(ondemand.future);
@@ -160,7 +160,7 @@ public class ManagerAssignmentIT extends 
SharedMiniClusterBase {
       c.tableOperations().onDemand(tableName, true);
       assertTrue(c.tableOperations().isOnDemand(tableName));
 
-      // The ondemand tablets should be unassigned
+      // The on-demand tablets should be unassigned
       List<TabletStats> stats = getTabletStats(c, tableId);
       while (stats.size() > 0) {
         Thread.sleep(50);
@@ -202,7 +202,7 @@ public class ManagerAssignmentIT extends 
SharedMiniClusterBase {
       c.tableOperations().onDemand(tableName, true);
       assertTrue(c.tableOperations().isOnDemand(tableName));
 
-      // The ondemand tablets should be unassigned
+      // The on-demand tablets should be unassigned
       List<TabletStats> stats = getTabletStats(c, tableId);
       while (stats.size() > 0) {
         Thread.sleep(50);
@@ -254,7 +254,7 @@ public class ManagerAssignmentIT extends 
SharedMiniClusterBase {
       c.tableOperations().onDemand(tableName, true);
       assertTrue(c.tableOperations().isOnDemand(tableName));
 
-      // The ondemand tablets should be unassigned
+      // The on-demand tablets should be unassigned
       List<TabletStats> stats = getTabletStats(c, tableId);
       while (stats.size() > 0) {
         Thread.sleep(50);
@@ -296,7 +296,7 @@ public class ManagerAssignmentIT extends 
SharedMiniClusterBase {
       c.tableOperations().onDemand(tableName, true);
       assertTrue(c.tableOperations().isOnDemand(tableName));
 
-      // Wait 2x the TabletGroupWatcher interval for ondemand
+      // Wait 2x the TabletGroupWatcher interval for on-demand
       // tablets to be unassigned.
       Thread.sleep(10000);
 
@@ -349,7 +349,7 @@ public class ManagerAssignmentIT extends 
SharedMiniClusterBase {
       c.tableOperations().onDemand(tableName, true);
       assertTrue(c.tableOperations().isOnDemand(tableName));
 
-      // Wait 2x the TabletGroupWatcher interval for ondemand
+      // Wait 2x the TabletGroupWatcher interval for on-demand
       // tablets to be unassigned.
       Thread.sleep(10000);
 
diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java
 
b/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java
index 8f36b27124..ab5ee13360 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java
@@ -107,7 +107,7 @@ public class TabletStateChangeIteratorIT extends 
AccumuloClusterHarness {
       createTable(client, t2, false);
       createTable(client, t3, true);
       createTable(client, t4, false);
-      client.tableOperations().onDemand(t4, true); // t4 is an ondemand table
+      client.tableOperations().onDemand(t4, true); // t4 is an on-demand table
 
       // examine a clone of the metadata table, so we can manipulate it
       copyTable(client, MetadataTable.NAME, metaCopy1);
@@ -157,17 +157,17 @@ public class TabletStateChangeIteratorIT extends 
AccumuloClusterHarness {
       assertEquals(1, findTabletsNeedingAttention(client, metaCopy3, state),
           "Should have 1 tablet that needs a metadata repair");
 
-      // test the ondemand online tablet case
+      // test the on-demand online tablet case
       state = new State(client);
       onDemandFirstTablet(client, metaCopy4, t4);
       assertEquals(1, findTabletsNeedingAttention(client, metaCopy4, state),
-          "Should have 1 tablet that is ondemand and needs to be hosted");
+          "Should have 1 tablet that is on-demand and needs to be hosted");
 
-      // test the ondemand offline tablet case
+      // test the on-demand offline tablet case
       state = new State(client);
       removeOnDemandMarkers(client, state, metaCopy4, t4);
       assertEquals(1, findTabletsNeedingAttention(client, metaCopy4, state),
-          "Should have 1 tablet that is ondemand and needs to be unloaded");
+          "Should have 1 tablet that is on-demand and needs to be unloaded");
 
       // clean up
       dropTables(client, t1, t2, t3, t4, metaCopy1, metaCopy2, metaCopy3, 
metaCopy4);

Reply via email to