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

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

commit 422d48a4325bb11b9aaae1ec8c61bdae4afca214
Merge: afe2857935 ebf7054d1f
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Mon Mar 4 12:51:34 2024 +0000

    Merge branch 'main' into elasticity

 assemble/bin/accumulo-cluster                                 | 10 +++++++++-
 .../accumulo/core/conf/cluster/ClusterConfigParser.java       |  8 ++++++--
 .../accumulo/core/conf/cluster/ClusterConfigParserTest.java   | 11 ++++++++---
 .../core/conf/cluster/cluster-with-optional-services.yaml     |  3 ++-
 4 files changed, 25 insertions(+), 7 deletions(-)

diff --cc 
core/src/main/java/org/apache/accumulo/core/conf/cluster/ClusterConfigParser.java
index 0c465564d9,e00570154a..c4ebf8c7ec
--- 
a/core/src/main/java/org/apache/accumulo/core/conf/cluster/ClusterConfigParser.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/conf/cluster/ClusterConfigParser.java
@@@ -39,23 -39,13 +39,24 @@@ import edu.umd.cs.findbugs.annotations.
  public class ClusterConfigParser {
  
    private static final String PROPERTY_FORMAT = "%s=\"%s\"%n";
 -  private static final String[] SECTIONS = new String[] {"manager", 
"monitor", "gc", "tserver"};
 -
 -  private static final Set<String> VALID_CONFIG_KEYS = Set.of("manager", 
"monitor", "gc", "tserver",
 -      "tservers_per_host", "sservers_per_host", "compaction.coordinator", 
"compactors_per_host");
 +  private static final String COMPACTOR_PREFIX = "compactor.";
++  private static final String COMPACTORS_PER_HOST_KEY = "compactors_per_host";
 +  private static final String GC_KEY = "gc";
 +  private static final String MANAGER_KEY = "manager";
 +  private static final String MONITOR_KEY = "monitor";
 +  private static final String SSERVER_PREFIX = "sserver.";
 +  private static final String SSERVERS_PER_HOST_KEY = "sservers_per_host";
 +  private static final String TSERVER_PREFIX = "tserver.";
 +  private static final String TSERVERS_PER_HOST_KEY = "tservers_per_host";
 +
 +  private static final String[] UNGROUPED_SECTIONS =
 +      new String[] {MANAGER_KEY, MONITOR_KEY, GC_KEY};
 +
-   private static final Set<String> VALID_CONFIG_KEYS =
-       Set.of(MANAGER_KEY, MONITOR_KEY, GC_KEY, SSERVERS_PER_HOST_KEY, 
TSERVERS_PER_HOST_KEY);
++  private static final Set<String> VALID_CONFIG_KEYS = Set.of(MANAGER_KEY, 
MONITOR_KEY, GC_KEY,
++      SSERVERS_PER_HOST_KEY, TSERVERS_PER_HOST_KEY, COMPACTORS_PER_HOST_KEY);
  
    private static final Set<String> VALID_CONFIG_PREFIXES =
 -      Set.of("compaction.compactor.", "sserver.");
 +      Set.of(COMPACTOR_PREFIX, SSERVER_PREFIX, TSERVER_PREFIX);
  
    private static final Predicate<String> VALID_CONFIG_SECTIONS =
        section -> VALID_CONFIG_KEYS.contains(section)
diff --cc 
core/src/test/java/org/apache/accumulo/core/conf/cluster/ClusterConfigParserTest.java
index 148b5e4f24,1410dc569a..189e48afc3
--- 
a/core/src/test/java/org/apache/accumulo/core/conf/cluster/ClusterConfigParserTest.java
+++ 
b/core/src/test/java/org/apache/accumulo/core/conf/cluster/ClusterConfigParserTest.java
@@@ -63,15 -63,17 +63,16 @@@ public class ClusterConfigParserTest 
      assertEquals("localhost1 localhost2", contents.get("monitor"));
      assertTrue(contents.containsKey("gc"));
      assertEquals("localhost", contents.get("gc"));
 -    assertTrue(contents.containsKey("tserver"));
 -    assertEquals("localhost1 localhost2 localhost3 localhost4", 
contents.get("tserver"));
 -    assertFalse(contents.containsKey("compaction"));
 -    assertFalse(contents.containsKey("compaction.coordinator"));
 -    assertFalse(contents.containsKey("compaction.compactor"));
 -    assertFalse(contents.containsKey("compaction.compactor.queue"));
 -    assertFalse(contents.containsKey("compaction.compactor.q1"));
 -    assertFalse(contents.containsKey("compaction.compactor.q2"));
 +    assertFalse(contents.containsKey("tserver"));
 +    assertTrue(contents.containsKey("tserver.default"));
 +    assertEquals("localhost1 localhost2 localhost3 localhost4", 
contents.get("tserver.default"));
 +    assertFalse(contents.containsKey("compactor"));
 +    assertFalse(contents.containsKey("compactor.queue"));
 +    assertFalse(contents.containsKey("compactor.q1"));
 +    assertFalse(contents.containsKey("compactor.q2"));
      assertFalse(contents.containsKey("tservers_per_host"));
      assertFalse(contents.containsKey("sservers_per_host"));
+     assertFalse(contents.containsKey("compactors_per_host"));
    }
  
    @Test
@@@ -83,7 -85,7 +84,7 @@@
      Map<String,String> contents =
          ClusterConfigParser.parseConfiguration(new 
File(configFile.toURI()).getAbsolutePath());
  
--    assertEquals(13, contents.size());
++    assertEquals(14, contents.size());
      assertTrue(contents.containsKey("manager"));
      assertEquals("localhost1 localhost2", contents.get("manager"));
      assertTrue(contents.containsKey("monitor"));
@@@ -168,10 -170,10 +171,11 @@@
      expected.put("MANAGER_HOSTS", "localhost1 localhost2");
      expected.put("MONITOR_HOSTS", "localhost1 localhost2");
      expected.put("GC_HOSTS", "localhost");
 -    expected.put("TSERVER_HOSTS", "localhost1 localhost2 localhost3 
localhost4");
 +    expected.put("TSERVER_GROUPS", "default");
 +    expected.put("TSERVER_HOSTS_default", "localhost1 localhost2 localhost3 
localhost4");
      expected.put("NUM_TSERVERS", "${NUM_TSERVERS:=1}");
      expected.put("NUM_SSERVERS", "${NUM_SSERVERS:=1}");
+     expected.put("NUM_COMPACTORS", "${NUM_COMPACTORS:=1}");
  
      expected.replaceAll((k, v) -> '"' + v + '"');
  
@@@ -219,19 -221,18 +223,20 @@@
      expected.put("MANAGER_HOSTS", "localhost1 localhost2");
      expected.put("MONITOR_HOSTS", "localhost1 localhost2");
      expected.put("GC_HOSTS", "localhost");
 -    expected.put("TSERVER_HOSTS", "localhost1 localhost2 localhost3 
localhost4");
 -    expected.put("COORDINATOR_HOSTS", "localhost1 localhost2");
 -    expected.put("COMPACTION_QUEUES", "q1 q2");
 +    expected.put("COMPACTOR_GROUPS", "q1 q2");
      expected.put("COMPACTOR_HOSTS_q1", "localhost1 localhost2");
      expected.put("COMPACTOR_HOSTS_q2", "localhost3 localhost4");
 -    expected.put("SSERVER_GROUPS", "default highmem cheap");
 +    expected.put("SSERVER_GROUPS", "cheap default highmem");
 +    expected.put("SSERVER_HOSTS_cheap", "burstyvm1 burstyvm2");
      expected.put("SSERVER_HOSTS_default", "localhost1 localhost2");
      expected.put("SSERVER_HOSTS_highmem", "hmvm1 hmvm2 hmvm3");
 -    expected.put("SSERVER_HOSTS_cheap", "burstyvm1 burstyvm2");
 +    expected.put("TSERVER_GROUPS", "cheap default highmem");
 +    expected.put("TSERVER_HOSTS_cheap", "localhost5 localhost6");
 +    expected.put("TSERVER_HOSTS_default", "localhost1 localhost2");
 +    expected.put("TSERVER_HOSTS_highmem", "localhost3 localhost4");
      expected.put("NUM_TSERVERS", "${NUM_TSERVERS:=2}");
-     expected.put("NUM_SSERVERS", "${NUM_SSERVERS:=1}");
+     expected.put("NUM_SSERVERS", "${NUM_SSERVERS:=2}");
+     expected.put("NUM_COMPACTORS", "${NUM_COMPACTORS:=3}");
  
      expected.replaceAll((k, v) -> {
        return '"' + v + '"';
diff --cc 
core/src/test/resources/org/apache/accumulo/core/conf/cluster/cluster-with-optional-services.yaml
index e2fa0d3d43,104857951b..deb7bba0b4
--- 
a/core/src/test/resources/org/apache/accumulo/core/conf/cluster/cluster-with-optional-services.yaml
+++ 
b/core/src/test/resources/org/apache/accumulo/core/conf/cluster/cluster-with-optional-services.yaml
@@@ -51,13 -46,18 +51,14 @@@ sserver
      - burstyvm1
      - burstyvm2
  
 -compaction:
 -  coordinator:
 +compactor:
 +  q1:
      - localhost1
      - localhost2
 -  compactor:
 -    - q1:
 -        - localhost1
 -        - localhost2
 -    - q2:
 -        - localhost3
 -        - localhost4
 +  q2:
 +    - localhost3
 +    - localhost4
  
  tservers_per_host: 2
- sservers_per_host: 1
+ sservers_per_host: 2
+ compactors_per_host: 3

Reply via email to