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

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


The following commit(s) were added to refs/heads/main by this push:
     new 699459f904 Trivial - improve method of setting table properties in a 
few tests (#5544)
699459f904 is described below

commit 699459f9041bb343ba0027c345751a4ac3d76298
Author: Dom G. <domgargu...@apache.org>
AuthorDate: Fri May 9 14:54:53 2025 -0400

    Trivial - improve method of setting table properties in a few tests (#5544)
    
    * Use NewTableConfiguration in two test cases instead of setProperty() 
calls after the table was already created
    * removed  a duplicate call to set TABLE_MAJC_RATIO in 
MergeTabletsBaseIT.noChopMergeDeleteAcrossTablets()
---
 .../accumulo/test/functional/BloomFilterIT.java    | 23 ++++++++++++++--------
 .../accumulo/test/functional/ConcurrencyIT.java    |  9 +++++----
 .../test/functional/MergeTabletsBaseIT.java        |  2 --
 3 files changed, 20 insertions(+), 14 deletions(-)

diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java 
b/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java
index 74df211d81..40e17a9e61 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java
@@ -23,6 +23,7 @@ import static 
org.apache.accumulo.core.util.LazySingletons.RANDOM;
 import java.time.Duration;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -33,6 +34,7 @@ import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchScanner;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.admin.NewTableConfiguration;
 import org.apache.accumulo.core.client.admin.TableOperations;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Key;
@@ -79,16 +81,21 @@ public class BloomFilterIT extends AccumuloClusterHarness {
           "1");
       try {
         Thread.sleep(1000);
+        TableOperations tops = c.tableOperations();
+
+        Map<String,String> props = new HashMap<>();
+        props.put(Property.TABLE_INDEXCACHE_ENABLED.getKey(), "false");
+        props.put(Property.TABLE_BLOCKCACHE_ENABLED.getKey(), "false");
+        props.put(Property.TABLE_BLOOM_SIZE.getKey(), "2000000");
+        props.put(Property.TABLE_BLOOM_ERRORRATE.getKey(), "1%");
+        props.put(Property.TABLE_BLOOM_LOAD_THRESHOLD.getKey(), "0");
+        props.put(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey(), "64K");
+        NewTableConfiguration ntc = new NewTableConfiguration();
+        ntc.setProperties(props);
+
         final String[] tables = getUniqueNames(4);
         for (String table : tables) {
-          TableOperations tops = c.tableOperations();
-          tops.create(table);
-          tops.setProperty(table, Property.TABLE_INDEXCACHE_ENABLED.getKey(), 
"false");
-          tops.setProperty(table, Property.TABLE_BLOCKCACHE_ENABLED.getKey(), 
"false");
-          tops.setProperty(table, Property.TABLE_BLOOM_SIZE.getKey(), 
"2000000");
-          tops.setProperty(table, Property.TABLE_BLOOM_ERRORRATE.getKey(), 
"1%");
-          tops.setProperty(table, 
Property.TABLE_BLOOM_LOAD_THRESHOLD.getKey(), "0");
-          tops.setProperty(table, 
Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey(), "64K");
+          tops.create(table, ntc);
         }
         log.info("Writing");
         write(c, tables[0], 1, 0, 2000000000, 500);
diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/ConcurrencyIT.java 
b/test/src/main/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
index 7a1eeac101..32a82096c8 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
@@ -28,6 +28,7 @@ import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.client.admin.NewTableConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
@@ -98,12 +99,12 @@ public class ConcurrencyIT extends AccumuloClusterHarness {
   }
 
   static void runTest(AccumuloClient c, String tableName) throws Exception {
-    c.tableOperations().create(tableName);
+    NewTableConfiguration ntc = new NewTableConfiguration();
+    ntc.setProperties(Map.of(Property.TABLE_MAJC_RATIO.getKey(), "1.0"));
     IteratorSetting is = new IteratorSetting(10, SlowIterator.class);
     SlowIterator.setSleepTime(is, 50);
-    c.tableOperations().attachIterator(tableName, is,
-        EnumSet.of(IteratorScope.minc, IteratorScope.majc));
-    c.tableOperations().setProperty(tableName, 
Property.TABLE_MAJC_RATIO.getKey(), "1.0");
+    ntc.attachIterator(is, EnumSet.of(IteratorScope.minc, IteratorScope.majc));
+    c.tableOperations().create(tableName, ntc);
 
     BatchWriter bw = c.createBatchWriter(tableName);
     for (int i = 0; i < 50; i++) {
diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/MergeTabletsBaseIT.java
 
b/test/src/main/java/org/apache/accumulo/test/functional/MergeTabletsBaseIT.java
index e90990449e..5118874da8 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/functional/MergeTabletsBaseIT.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/functional/MergeTabletsBaseIT.java
@@ -308,8 +308,6 @@ public abstract class MergeTabletsBaseIT extends 
SharedMiniClusterBase {
     try (AccumuloClient c = 
Accumulo.newClient().from(getClientProps()).build()) {
       String tableName = getUniqueNames(1)[0];
       createTableAndDisableCompactions(c, tableName, new 
NewTableConfiguration());
-      // disable compactions
-      c.tableOperations().setProperty(tableName, 
Property.TABLE_MAJC_RATIO.getKey(), "9999");
       final TableId tableId = 
TableId.of(c.tableOperations().tableIdMap().get(tableName));
 
       // First write 1000 rows to a file in the default tablet

Reply via email to