This is an automated email from the ASF dual-hosted git repository.
ddanielr pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.1 by this push:
new 94442d2c48 Remove unreferenced test code (#6129)
94442d2c48 is described below
commit 94442d2c489c49115b47c8591ba0d1e134a889db
Author: Daniel Roberts <[email protected]>
AuthorDate: Tue Feb 17 13:46:44 2026 -0500
Remove unreferenced test code (#6129)
Removes a main method used for testing from BloomFilterLayer
This method was not referenced in any accumulo code.
---
.../accumulo/core/file/BloomFilterLayer.java | 120 ---------------------
1 file changed, 120 deletions(-)
diff --git
a/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
b/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
index 7650ef8572..ff76ef0120 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
@@ -24,12 +24,8 @@ import static
org.apache.accumulo.core.util.threads.ThreadPoolNames.BLOOM_LOADER
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
-import java.io.PrintStream;
import java.security.SecureRandom;
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
@@ -38,11 +34,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.accumulo.core.bloomfilter.DynamicBloomFilter;
import org.apache.accumulo.core.classloader.ClassLoaderUtil;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
-import org.apache.accumulo.core.conf.ConfigurationCopy;
-import org.apache.accumulo.core.conf.DefaultConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.ByteSequence;
-import org.apache.accumulo.core.data.PartialKey;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.dataImpl.KeyExtent;
@@ -52,11 +45,7 @@ import org.apache.accumulo.core.file.rfile.RFile;
import org.apache.accumulo.core.iterators.IteratorEnvironment;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.sample.impl.SamplerConfigurationImpl;
-import org.apache.accumulo.core.spi.crypto.NoCryptoServiceFactory;
import org.apache.accumulo.core.util.threads.ThreadPools;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.io.Text;
import org.apache.hadoop.util.bloom.Key;
import org.apache.hadoop.util.hash.Hash;
import org.slf4j.Logger;
@@ -454,113 +443,4 @@ public class BloomFilterLayer {
reader.setCacheProvider(cacheProvider);
}
}
-
- public static void main(String[] args) throws IOException {
- PrintStream out = System.out;
-
- HashSet<Integer> valsSet = new HashSet<>();
-
- for (int i = 0; i < 100000; i++) {
- valsSet.add(random.nextInt(Integer.MAX_VALUE));
- }
-
- ArrayList<Integer> vals = new ArrayList<>(valsSet);
- Collections.sort(vals);
-
- ConfigurationCopy acuconf = new
ConfigurationCopy(DefaultConfiguration.getInstance());
- acuconf.set(Property.TABLE_BLOOM_ENABLED, "true");
- acuconf.set(Property.TABLE_BLOOM_KEY_FUNCTOR,
- "accumulo.core.file.keyfunctor.ColumnFamilyFunctor");
- acuconf.set(Property.TABLE_FILE_TYPE, RFile.EXTENSION);
- acuconf.set(Property.TABLE_BLOOM_LOAD_THRESHOLD, "1");
- acuconf.set(Property.TSERV_BLOOM_LOAD_MAXCONCURRENT, "1");
-
- Configuration conf = new Configuration();
- FileSystem fs = FileSystem.get(conf);
-
- String suffix = FileOperations.getNewFileExtension(acuconf);
- String fname = "/tmp/test." + suffix;
- FileSKVWriter bmfw = FileOperations.getInstance().newWriterBuilder()
- .forFile(fname, fs, conf,
NoCryptoServiceFactory.NONE).withTableConfiguration(acuconf)
- .build();
-
- long t1 = System.currentTimeMillis();
-
- bmfw.startDefaultLocalityGroup();
-
- for (Integer i : vals) {
- String fi = String.format("%010d", i);
- bmfw.append(new org.apache.accumulo.core.data.Key(new Text("r" + fi),
new Text("cf1")),
- new Value("v" + fi));
- bmfw.append(new org.apache.accumulo.core.data.Key(new Text("r" + fi),
new Text("cf2")),
- new Value("v" + fi));
- }
-
- long t2 = System.currentTimeMillis();
-
- out.printf("write rate %6.2f%n", vals.size() / ((t2 - t1) / 1000.0));
-
- bmfw.close();
-
- t1 = System.currentTimeMillis();
- FileSKVIterator bmfr = FileOperations.getInstance().newReaderBuilder()
- .forFile(fname, fs, conf,
NoCryptoServiceFactory.NONE).withTableConfiguration(acuconf)
- .build();
- t2 = System.currentTimeMillis();
- out.println("Opened " + fname + " in " + (t2 - t1));
-
- t1 = System.currentTimeMillis();
-
- int hits = 0;
- for (int i = 0; i < 5000; i++) {
- int row = random.nextInt(Integer.MAX_VALUE);
- String fi = String.format("%010d", row);
- // bmfr.seek(new Range(new Text("r"+fi)));
- org.apache.accumulo.core.data.Key k1 =
- new org.apache.accumulo.core.data.Key(new Text("r" + fi), new
Text("cf1"));
- bmfr.seek(new Range(k1, true, k1.followingKey(PartialKey.ROW_COLFAM),
false),
- new ArrayList<>(), false);
- if (valsSet.contains(row)) {
- hits++;
- if (!bmfr.hasTop()) {
- out.println("ERROR " + row);
- }
- }
- }
-
- t2 = System.currentTimeMillis();
-
- out.printf("random lookup rate : %6.2f%n", 5000 / ((t2 - t1) / 1000.0));
- out.println("hits = " + hits);
-
- int count = 0;
-
- t1 = System.currentTimeMillis();
-
- for (Integer row : valsSet) {
- String fi = String.format("%010d", row);
- // bmfr.seek(new Range(new Text("r"+fi)));
-
- org.apache.accumulo.core.data.Key k1 =
- new org.apache.accumulo.core.data.Key(new Text("r" + fi), new
Text("cf1"));
- bmfr.seek(new Range(k1, true, k1.followingKey(PartialKey.ROW_COLFAM),
false),
- new ArrayList<>(), false);
-
- if (!bmfr.hasTop()) {
- out.println("ERROR 2 " + row);
- }
-
- count++;
-
- if (count >= 500) {
- break;
- }
- }
-
- t2 = System.currentTimeMillis();
-
- out.printf("existing lookup rate %6.2f%n", 500 / ((t2 - t1) / 1000.0));
- out.println("expected hits 500. Receive hits: " + count);
- bmfr.close();
- }
}