From d02bb6c5c8306c4d5968c422f13a1d09c553591b Mon Sep 17 00:00:00 2001 From: Robert Kurc Date: Wed, 11 Jun 2025 17:32:54 +0000 Subject: [PATCH 1/9] Accumulo Proxy is now able to build when depending on Accumulo 2.1.3. Several methods were removed or renamed, and workarounds had to be found. However, the actual functionality of the Proxy has not been fully tested yet. --- pom.xml | 4 +- .../java/org/apache/accumulo/proxy/Proxy.java | 64 ++++++++++++++++++- .../apache/accumulo/proxy/ProxyServer.java | 4 ++ .../apache/accumulo/proxy/TServerUtils.java | 15 ++++- .../accumulo/proxy/its/SimpleProxyBase.java | 16 ++--- 5 files changed, 89 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 9f70da8..7e4fd90 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ https://github.com/apache/accumulo-proxy/actions - 2.1.1 + 2.1.3 contrib/Eclipse-Accumulo-Codestyle.xml @@ -214,7 +214,7 @@ org.junit.jupiter junit-jupiter-api - 5.9.2 + 5.10.1 test diff --git a/src/main/java/org/apache/accumulo/proxy/Proxy.java b/src/main/java/org/apache/accumulo/proxy/Proxy.java index 017b298..5c0e4e9 100644 --- a/src/main/java/org/apache/accumulo/proxy/Proxy.java +++ b/src/main/java/org/apache/accumulo/proxy/Proxy.java @@ -22,6 +22,8 @@ import java.io.InputStream; import java.io.UncheckedIOException; import java.nio.file.Files; +import java.util.Collection; +import java.util.List; import java.util.Properties; import org.apache.accumulo.core.cli.Help; @@ -30,6 +32,8 @@ import org.apache.accumulo.core.clientImpl.ClientConfConverter; import org.apache.accumulo.core.conf.ClientProperty; import org.apache.accumulo.core.conf.ConfigurationTypeHelper; +import org.apache.accumulo.core.metrics.MetricsInfo; +import org.apache.accumulo.core.metrics.MetricsProducer; import org.apache.accumulo.core.rpc.SslConnectionParams; import org.apache.accumulo.core.trace.TraceUtil; import org.apache.accumulo.core.util.HostAndPort; @@ -55,6 +59,8 @@ import com.google.auto.service.AutoService; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import io.micrometer.core.instrument.MeterRegistry; +import io.micrometer.core.instrument.Tag; @AutoService(KeywordExecutable.class) public class Proxy implements KeywordExecutable { @@ -250,7 +256,7 @@ public static ServerAddress createProxyServer(HostAndPort address, break; } - TimedProcessor timedProcessor = new TimedProcessor(processor); + TimedProcessor timedProcessor = new TimedProcessor(processor, new ProxyMetricsInfo()); // Create the thrift server with our processor and properties return TServerUtils.startTServer(serverType, timedProcessor, protocolFactory, serverName, @@ -258,4 +264,60 @@ public static ServerAddress createProxyServer(HostAndPort address, ClientConfConverter.toAccumuloConf(props), 1000L, maxFrameSize, sslParams, saslParams, serverSocketTimeout, address); } + + static private class ProxyMetricsInfo implements MetricsInfo { + + @Override + public boolean isMetricsEnabled() { + return false; + } + + @Override + public void addServiceTags(String applicationName, HostAndPort hostAndPort) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'addServiceTags'"); + } + + @Override + public void addCommonTags(List updates) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'addCommonTags'"); + } + + @Override + public Collection getCommonTags() { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'getCommonTags'"); + } + + @Override + public void addRegistry(MeterRegistry registry) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'addRegistry'"); + } + + @Override + public void addMetricsProducers(MetricsProducer... producer) { + return; + } + + @Override + public void init() { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'init'"); + } + + @Override + public MeterRegistry getRegistry() { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'getRegistry'"); + } + + @Override + public void close() { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'close'"); + } + + } } diff --git a/src/main/java/org/apache/accumulo/proxy/ProxyServer.java b/src/main/java/org/apache/accumulo/proxy/ProxyServer.java index 54ad3e4..63bd80f 100644 --- a/src/main/java/org/apache/accumulo/proxy/ProxyServer.java +++ b/src/main/java/org/apache/accumulo/proxy/ProxyServer.java @@ -222,6 +222,8 @@ public ProxyServer(Properties props) { } protected AccumuloClient getClient(String sharedSecret) throws Exception { + // TODO: Get rid of this before committing! + logger.info("Shared secret should be " + this.sharedSecret); if (sharedSecret.equals(this.sharedSecret)) { return client; } else { @@ -946,6 +948,8 @@ public boolean authenticateUser(String sharedSecret, String user, Map()); + final ThreadPoolExecutor pool = builder.build(); // periodically adjust the number of threads we need by checking how busy our threads are ThreadPools.watchCriticalFixedDelay(conf, timeBetweenThreadChecks, () -> { // there is a minor race condition between sampling the current state of the thread pool @@ -276,7 +285,7 @@ private static TServerSocket getSslServerSocket(int port, int timeout, InetAddre TSSLTransportFactory.getServerSocket(port, timeout, params.isClientAuth(), address); } else { tServerSock = TSSLTransportFactory.getServerSocket(port, timeout, address, - params.getTTransportParams()); + params.getTSSLTransportParameters()); } final ServerSocket serverSock = tServerSock.getServerSocket(); diff --git a/src/test/java/org/apache/accumulo/proxy/its/SimpleProxyBase.java b/src/test/java/org/apache/accumulo/proxy/its/SimpleProxyBase.java index 0d71d4e..dac8ab1 100644 --- a/src/test/java/org/apache/accumulo/proxy/its/SimpleProxyBase.java +++ b/src/test/java/org/apache/accumulo/proxy/its/SimpleProxyBase.java @@ -2146,17 +2146,17 @@ public void testConditionalWriter() throws Exception { } private void assertNumericValueConstraintIsPresent() throws Exception { - assertTrue( - Wait.waitFor(() -> client.listConstraints(sharedSecret, tableName) - .containsKey(NumericValueConstraint.class.getName()), 30_000L, 2_000L), - "Expected to find NumericValueConstraint in constraints."); + Wait.waitFor( + () -> client.listConstraints(sharedSecret, tableName) + .containsKey(NumericValueConstraint.class.getName()), + 30_000L, 2_000L, "Expected to find NumericValueConstraint in constraints."); } private void assertNumericValueConstraintIsAbsent() throws Exception { - assertTrue( - Wait.waitFor(() -> !client.listConstraints(sharedSecret, tableName) - .containsKey(NumericValueConstraint.class.getName()), 30_000L, 2_000L), - "Found NumericValueConstraint in constraints, expected it to be absent."); + Wait.waitFor( + () -> !client.listConstraints(sharedSecret, tableName) + .containsKey(NumericValueConstraint.class.getName()), + 30_000L, 2_000L, "Found NumericValueConstraint in constraints, expected it to be absent."); } private void checkKey(String row, String cf, String cq, String val, KeyValue keyValue) { From 6ddfdcddad6e5c580300b70bbc954c6cd204226b Mon Sep 17 00:00:00 2001 From: Robert Kurc Date: Wed, 11 Jun 2025 22:42:15 +0000 Subject: [PATCH 2/9] Removed debug messages that were used in testing that the Proxy works. --- src/main/java/org/apache/accumulo/proxy/Proxy.java | 4 ---- src/main/java/org/apache/accumulo/proxy/ProxyServer.java | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/org/apache/accumulo/proxy/Proxy.java b/src/main/java/org/apache/accumulo/proxy/Proxy.java index 5c0e4e9..6b264a3 100644 --- a/src/main/java/org/apache/accumulo/proxy/Proxy.java +++ b/src/main/java/org/apache/accumulo/proxy/Proxy.java @@ -274,25 +274,21 @@ public boolean isMetricsEnabled() { @Override public void addServiceTags(String applicationName, HostAndPort hostAndPort) { - // TODO Auto-generated method stub throw new UnsupportedOperationException("Unimplemented method 'addServiceTags'"); } @Override public void addCommonTags(List updates) { - // TODO Auto-generated method stub throw new UnsupportedOperationException("Unimplemented method 'addCommonTags'"); } @Override public Collection getCommonTags() { - // TODO Auto-generated method stub throw new UnsupportedOperationException("Unimplemented method 'getCommonTags'"); } @Override public void addRegistry(MeterRegistry registry) { - // TODO Auto-generated method stub throw new UnsupportedOperationException("Unimplemented method 'addRegistry'"); } diff --git a/src/main/java/org/apache/accumulo/proxy/ProxyServer.java b/src/main/java/org/apache/accumulo/proxy/ProxyServer.java index 63bd80f..88adf32 100644 --- a/src/main/java/org/apache/accumulo/proxy/ProxyServer.java +++ b/src/main/java/org/apache/accumulo/proxy/ProxyServer.java @@ -222,8 +222,7 @@ public ProxyServer(Properties props) { } protected AccumuloClient getClient(String sharedSecret) throws Exception { - // TODO: Get rid of this before committing! - logger.info("Shared secret should be " + this.sharedSecret); + if (sharedSecret.equals(this.sharedSecret)) { return client; } else { @@ -948,8 +947,6 @@ public boolean authenticateUser(String sharedSecret, String user, Map Date: Tue, 17 Jun 2025 01:33:41 +0000 Subject: [PATCH 3/9] Added comments explaining the purpose of the ProxyMetricsInfo class inside of Proxy.java. --- .../java/org/apache/accumulo/proxy/Proxy.java | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/src/main/java/org/apache/accumulo/proxy/Proxy.java b/src/main/java/org/apache/accumulo/proxy/Proxy.java index 6b264a3..be467fd 100644 --- a/src/main/java/org/apache/accumulo/proxy/Proxy.java +++ b/src/main/java/org/apache/accumulo/proxy/Proxy.java @@ -265,55 +265,35 @@ public static ServerAddress createProxyServer(HostAndPort address, serverSocketTimeout, address); } + // TODO: This MetricsInfo is a stub Metrics Info to allow the timed processor to build. If Metrics are wanted or needed in a later version of the proxy, this can be updated. static private class ProxyMetricsInfo implements MetricsInfo { @Override - public boolean isMetricsEnabled() { - return false; - } + public boolean isMetricsEnabled() {return false;} @Override - public void addServiceTags(String applicationName, HostAndPort hostAndPort) { - throw new UnsupportedOperationException("Unimplemented method 'addServiceTags'"); - } + public void addServiceTags(String applicationName, HostAndPort hostAndPort) {throw new UnsupportedOperationException("Unimplemented method 'addServiceTags'");} @Override - public void addCommonTags(List updates) { - throw new UnsupportedOperationException("Unimplemented method 'addCommonTags'"); - } + public void addCommonTags(List updates) {throw new UnsupportedOperationException("Unimplemented method 'addCommonTags'");} @Override - public Collection getCommonTags() { - throw new UnsupportedOperationException("Unimplemented method 'getCommonTags'"); - } + public Collection getCommonTags() {throw new UnsupportedOperationException("Unimplemented method 'getCommonTags'");} @Override - public void addRegistry(MeterRegistry registry) { - throw new UnsupportedOperationException("Unimplemented method 'addRegistry'"); - } + public void addRegistry(MeterRegistry registry) {throw new UnsupportedOperationException("Unimplemented method 'addRegistry'");} @Override - public void addMetricsProducers(MetricsProducer... producer) { - return; - } + public void addMetricsProducers(MetricsProducer... producer) {return;} @Override - public void init() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'init'"); - } + public void init() {throw new UnsupportedOperationException("Unimplemented method 'init'");} @Override - public MeterRegistry getRegistry() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getRegistry'"); - } + public MeterRegistry getRegistry() {throw new UnsupportedOperationException("Unimplemented method 'getRegistry'");} @Override - public void close() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'close'"); - } + public void close() {throw new UnsupportedOperationException("Unimplemented method 'close'");} } } From 32bdf14a65bbdfb3c80dc9107d15687465210597 Mon Sep 17 00:00:00 2001 From: Robert Kurc Date: Tue, 17 Jun 2025 01:38:28 +0000 Subject: [PATCH 4/9] Cleaned up new code in TServerUtils involving the construction of a ThreadPoolExecutor. --- .../org/apache/accumulo/proxy/TServerUtils.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/apache/accumulo/proxy/TServerUtils.java b/src/main/java/org/apache/accumulo/proxy/TServerUtils.java index 9e215ed..23cc55e 100644 --- a/src/main/java/org/apache/accumulo/proxy/TServerUtils.java +++ b/src/main/java/org/apache/accumulo/proxy/TServerUtils.java @@ -189,15 +189,12 @@ private static ServerAddress createNonBlockingServer(HostAndPort address, TProce private static ThreadPoolExecutor createSelfResizingThreadPool(final String serverName, final int executorThreads, long threadTimeOut, final AccumuloConfiguration conf, long timeBetweenThreadChecks) { - // Creating a ThreadPoolExecutor builder, giving it all the information, then building. - // Split giving information to the builder into two lines for readability - // TODO: Find out what number the priority should be - final ThreadPoolExecutorBuilder builder = - ThreadPools.getServerThreadPools().getPoolBuilder(serverName + "-ClientPool"); - builder.numCoreThreads(executorThreads).numMaxThreads(executorThreads) - .withTimeOut(threadTimeOut, TimeUnit.MILLISECONDS); - builder.enableThreadPoolMetrics(true).withQueue(new LinkedBlockingQueue<>()); - final ThreadPoolExecutor pool = builder.build(); + // Using a ThreadPoolExecutorBuilder to create the ThreadPool Executor needed for this method + // TODO: Find out what number should go into the priority parameter. + final ThreadPoolExecutor pool = + ThreadPools.getServerThreadPools().getPoolBuilder(serverName + "-ClientPool") + .numCoreThreads(executorThreads).numMaxThreads(executorThreads).withTimeOut(threadTimeOut, TimeUnit.MILLISECONDS) + .enableThreadPoolMetrics(true).withQueue(new LinkedBlockingQueue<>()).build(); // periodically adjust the number of threads we need by checking how busy our threads are ThreadPools.watchCriticalFixedDelay(conf, timeBetweenThreadChecks, () -> { // there is a minor race condition between sampling the current state of the thread pool From 5011608d8a389014e72149f8a84c88f9ea55a4ec Mon Sep 17 00:00:00 2001 From: Robert Kurc Date: Wed, 18 Jun 2025 01:34:46 +0000 Subject: [PATCH 5/9] Fixed dependency errors and formatting. --- pom.xml | 11 ++++++ .../java/org/apache/accumulo/proxy/Proxy.java | 39 ++++++++++++++----- .../apache/accumulo/proxy/TServerUtils.java | 7 ++-- 3 files changed, 43 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 7e4fd90..f16b98d 100644 --- a/pom.xml +++ b/pom.xml @@ -102,6 +102,13 @@ + + io.micrometer + micrometer-bom + 1.12.2 + pom + import + org.apache.logging.log4j log4j-bom @@ -140,6 +147,10 @@ commons-lang 2.6 + + io.micrometer + micrometer-core + org.apache.accumulo accumulo-core diff --git a/src/main/java/org/apache/accumulo/proxy/Proxy.java b/src/main/java/org/apache/accumulo/proxy/Proxy.java index be467fd..b4020d4 100644 --- a/src/main/java/org/apache/accumulo/proxy/Proxy.java +++ b/src/main/java/org/apache/accumulo/proxy/Proxy.java @@ -265,35 +265,54 @@ public static ServerAddress createProxyServer(HostAndPort address, serverSocketTimeout, address); } - // TODO: This MetricsInfo is a stub Metrics Info to allow the timed processor to build. If Metrics are wanted or needed in a later version of the proxy, this can be updated. + // TODO: This MetricsInfo is a stub Metrics Info to allow the timed processor to build. If Metrics + // are wanted or needed in a later version of the proxy, this can be updated. static private class ProxyMetricsInfo implements MetricsInfo { @Override - public boolean isMetricsEnabled() {return false;} + public boolean isMetricsEnabled() { + return false; + } @Override - public void addServiceTags(String applicationName, HostAndPort hostAndPort) {throw new UnsupportedOperationException("Unimplemented method 'addServiceTags'");} + public void addServiceTags(String applicationName, HostAndPort hostAndPort) { + throw new UnsupportedOperationException("Unimplemented method 'addServiceTags'"); + } @Override - public void addCommonTags(List updates) {throw new UnsupportedOperationException("Unimplemented method 'addCommonTags'");} + public void addCommonTags(List updates) { + throw new UnsupportedOperationException("Unimplemented method 'addCommonTags'"); + } @Override - public Collection getCommonTags() {throw new UnsupportedOperationException("Unimplemented method 'getCommonTags'");} + public Collection getCommonTags() { + throw new UnsupportedOperationException("Unimplemented method 'getCommonTags'"); + } @Override - public void addRegistry(MeterRegistry registry) {throw new UnsupportedOperationException("Unimplemented method 'addRegistry'");} + public void addRegistry(MeterRegistry registry) { + throw new UnsupportedOperationException("Unimplemented method 'addRegistry'"); + } @Override - public void addMetricsProducers(MetricsProducer... producer) {return;} + public void addMetricsProducers(MetricsProducer... producer) { + return; + } @Override - public void init() {throw new UnsupportedOperationException("Unimplemented method 'init'");} + public void init() { + throw new UnsupportedOperationException("Unimplemented method 'init'"); + } @Override - public MeterRegistry getRegistry() {throw new UnsupportedOperationException("Unimplemented method 'getRegistry'");} + public MeterRegistry getRegistry() { + throw new UnsupportedOperationException("Unimplemented method 'getRegistry'"); + } @Override - public void close() {throw new UnsupportedOperationException("Unimplemented method 'close'");} + public void close() { + throw new UnsupportedOperationException("Unimplemented method 'close'"); + } } } diff --git a/src/main/java/org/apache/accumulo/proxy/TServerUtils.java b/src/main/java/org/apache/accumulo/proxy/TServerUtils.java index 23cc55e..181ab92 100644 --- a/src/main/java/org/apache/accumulo/proxy/TServerUtils.java +++ b/src/main/java/org/apache/accumulo/proxy/TServerUtils.java @@ -48,7 +48,6 @@ import org.apache.accumulo.core.util.HostAndPort; import org.apache.accumulo.core.util.Pair; import org.apache.accumulo.core.util.threads.ThreadPools; -import org.apache.accumulo.core.util.threads.ThreadPools.ThreadPoolExecutorBuilder; import org.apache.accumulo.core.util.threads.Threads; import org.apache.accumulo.server.rpc.ClientInfoProcessorFactory; import org.apache.accumulo.server.rpc.CustomNonBlockingServer; @@ -191,9 +190,9 @@ private static ThreadPoolExecutor createSelfResizingThreadPool(final String serv long timeBetweenThreadChecks) { // Using a ThreadPoolExecutorBuilder to create the ThreadPool Executor needed for this method // TODO: Find out what number should go into the priority parameter. - final ThreadPoolExecutor pool = - ThreadPools.getServerThreadPools().getPoolBuilder(serverName + "-ClientPool") - .numCoreThreads(executorThreads).numMaxThreads(executorThreads).withTimeOut(threadTimeOut, TimeUnit.MILLISECONDS) + final ThreadPoolExecutor pool = ThreadPools.getServerThreadPools() + .getPoolBuilder(serverName + "-ClientPool").numCoreThreads(executorThreads) + .numMaxThreads(executorThreads).withTimeOut(threadTimeOut, TimeUnit.MILLISECONDS) .enableThreadPoolMetrics(true).withQueue(new LinkedBlockingQueue<>()).build(); // periodically adjust the number of threads we need by checking how busy our threads are ThreadPools.watchCriticalFixedDelay(conf, timeBetweenThreadChecks, () -> { From 0ffb211a0f5396f9c543407d07954b7ce8a0e9d5 Mon Sep 17 00:00:00 2001 From: Robert Kurc Date: Wed, 18 Jun 2025 18:13:53 +0000 Subject: [PATCH 6/9] Updated dependencies to match dependencies in accumulo. Squashed bugs that arose from updating various dependencies. --- pom.xml | 33 +++++++++---------- .../apache/accumulo/proxy/ProxyServer.java | 4 ++- .../accumulo/proxy/its/SimpleProxyBase.java | 6 ++-- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index f16b98d..ec73c33 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ org.apache apache - 29 + 31 org.apache.accumulo accumulo-proxy @@ -89,15 +89,14 @@ contrib/Eclipse-Accumulo-Codestyle.xml - 3.3.4 + 3.3.6 false 11 11 11 - 2.0.6 + 2.0.12 source-release-tar src/main/spotbugs/exclude-filter.xml - 3.0.0-M8 0.17.0 @@ -112,7 +111,7 @@ org.apache.logging.log4j log4j-bom - 2.19.0 + 2.23.1 pom import @@ -128,13 +127,13 @@ com.github.spotbugs spotbugs-annotations - 4.7.3 + 4.8.3 true com.google.auto.service auto-service - 1.0.1 + 1.1.1 true @@ -236,12 +235,12 @@ org.codehaus.mojo versions-maven-plugin - 2.14.2 + 2.16.2 com.mycila license-maven-plugin - 4.1 + 4.3
${session.executionRootDirectory}/contrib/license-header.txt
@@ -266,7 +265,7 @@ org.gaul modernizer-maven-plugin - 2.5.0 + 2.7.0 ${maven.compiler.target} @@ -274,7 +273,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.7.3.0 + 4.7.3.6 true Max @@ -324,7 +323,7 @@ com.github.koraktor mavanagaiata - 1.0.0 + 1.0.1 true @@ -421,22 +420,22 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.5.0 org.codehaus.mojo exec-maven-plugin - 3.0.0 + 3.1.1 net.revelc.code apilyzer-maven-plugin - 1.2.0 + 1.3.0 net.revelc.code.formatter formatter-maven-plugin - 2.21.0 + 2.23.0 ${eclipseFormatterStyle} ${maven.compiler.source} @@ -656,7 +655,7 @@ com.puppycrawl.tools checkstyle - 10.6.0 + 10.12.6
diff --git a/src/main/java/org/apache/accumulo/proxy/ProxyServer.java b/src/main/java/org/apache/accumulo/proxy/ProxyServer.java index 88adf32..49c7809 100644 --- a/src/main/java/org/apache/accumulo/proxy/ProxyServer.java +++ b/src/main/java/org/apache/accumulo/proxy/ProxyServer.java @@ -2119,7 +2119,9 @@ public String createConditionalWriter(String sharedSecret, String tableName, try { ConditionalWriterConfig cwc = new ConditionalWriterConfig(); if (options.getMaxMemory() != 0) { - // TODO + // TODO - This was left blank, I'm not sure why it's here. For now, it will log the max + // memory + logger.info("Max memory: " + options.getMaxMemory()); } if (options.isSetThreads() && options.getThreads() != 0) { cwc.setMaxWriteThreads(options.getThreads()); diff --git a/src/test/java/org/apache/accumulo/proxy/its/SimpleProxyBase.java b/src/test/java/org/apache/accumulo/proxy/its/SimpleProxyBase.java index dac8ab1..5435135 100644 --- a/src/test/java/org/apache/accumulo/proxy/its/SimpleProxyBase.java +++ b/src/test/java/org/apache/accumulo/proxy/its/SimpleProxyBase.java @@ -241,7 +241,8 @@ public void setup(TestInfo info) throws Exception { proxyClient = new TestProxyClient(hostname, proxyPort, factory); client = proxyClient.proxy(); - testName = info.getTestMethod().get().getName(); + testName = info.getTestMethod() + .orElseThrow(() -> new IllegalArgumentException("Test method is missing")).getName(); // Create some unique names for tables, namespaces, etc. String[] uniqueNames = getUniqueNameArray(2); @@ -1194,7 +1195,8 @@ public void attachIteratorsWithScans() throws Exception { assertTrue(scanFromClient.isPresent(), "Could not find any scan matching the client principal"); - ActiveScan scan = scanFromClient.get(); + ActiveScan scan = + scanFromClient.orElseThrow(() -> new IllegalArgumentException("ActiveScan is missing")); assertTrue( ScanState.RUNNING.equals(scan.getState()) || ScanState.QUEUED.equals(scan.getState())); From 6432df2aec6d8f373ac60f314d2044fbe697795f Mon Sep 17 00:00:00 2001 From: Kidcredible <145068316+Kidcredible300@users.noreply.github.com> Date: Thu, 19 Jun 2025 12:42:09 -0400 Subject: [PATCH 7/9] Update Dockerfile Updated versions and hashes of Hadoop, Zookeeper, and Accumulo to fit the versions used in Accumulo 2.1.3. Additionally, updated "ENV name value" to "ENV name=value" (since Docker said that the former was outdated). Tested proxy through docker, confirmed that it functions as normal --- Dockerfile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index b40bfa9..cc8b6c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,22 +19,22 @@ EXPOSE 42424 WORKDIR /opt/accumulo-proxy -ARG HADOOP_VERSION=3.3.4 -ARG ZOOKEEPER_VERSION=3.8.0 -ARG ACCUMULO_VERSION=2.1.1 +ARG HADOOP_VERSION=3.3.6 +ARG ZOOKEEPER_VERSION=3.9.2 +ARG ACCUMULO_VERSION=2.1.3 ARG ACCUMULO_PROXY_VERSION=2.0.0-SNAPSHOT -ARG HADOOP_HASH=ca5e12625679ca95b8fd7bb7babc2a8dcb2605979b901df9ad137178718821097b67555115fafc6dbf6bb32b61864ccb6786dbc555e589694a22bf69147780b4 -ARG ZOOKEEPER_HASH=d66e3a40451f840406901b2cd940992b001f92049a372ae48d8b420891605871cd1ae5f6cceb3b10665491e7abef36a4078dace158bd1e0938fcd3567b5234ca -ARG ACCUMULO_HASH=adb23e56362c2e3e813d07791389b8ca2d5976df8b00a29b607e6ae05ea465eff80ada6d1ec9a9c596df8b4066c51078cd5a4006dc78568ac38f638a1d3895be +ARG HADOOP_HASH=de3eaca2e0517e4b569a88b63c89fae19cb8ac6c01ff990f1ff8f0cc0f3128c8e8a23db01577ca562a0e0bb1b4a3889f8c74384e609cd55e537aada3dcaa9f8a +ARG ZOOKEEPER_HASH=2b5ae02d618a27ca8cd54924855d5344263b7d9dee760181f9d66bafa9230324d2ad31786895f0654c969dc38d4a3d0077f74cc376b58b5fa2fb94beb1ab445f +ARG ACCUMULO_HASH=1a27a144dc31f55ccc8e081b6c1bc6cc0362a8391838c53c166cb45291ff8f35867fd8e4729aa7b2c540f8b721f8c6953281bf589fc7fe320e4dc4d20b87abc4 # Download from Apache mirrors instead of archive #9 -ENV APACHE_DIST_URLS \ +ENV APACHE_DIST_URLS="\ https://www.apache.org/dyn/closer.cgi?action=download&filename= \ # if the version is outdated (or we're grabbing the .asc file), we might have to pull from the dist/archive :/ https://www-us.apache.org/dist/ \ https://www.apache.org/dist/ \ - https://archive.apache.org/dist/ + https://archive.apache.org/dist/" RUN set -eux; \ download_bin() { \ @@ -42,7 +42,7 @@ RUN set -eux; \ local hash="$1"; shift; \ local distFile="$1"; shift; \ local success=; \ - local distUrl=; \ + local distUrl=; \ for distUrl in ${APACHE_DIST_URLS}; do \ if wget -nv -O "/tmp/${f}" "${distUrl}${distFile}"; then \ success=1; \ @@ -63,16 +63,16 @@ RUN tar xzf /tmp/hadoop.tar.gz -C /opt/ && ln -s /opt/hadoop-${HADOOP_VERSION} / RUN tar xzf /tmp/apache-zookeeper.tar.gz -C /opt/ && ln -s /opt/apache-zookeeper-${ZOOKEEPER_VERSION}-bin /opt/apache-zookeeper RUN tar xzf /tmp/accumulo.tar.gz -C /opt/ && ln -s /opt/accumulo-${ACCUMULO_VERSION} /opt/accumulo && sed -i 's/\${ZOOKEEPER_HOME}\/\*/\${ZOOKEEPER_HOME}\/\*\:\${ZOOKEEPER_HOME}\/lib\/\*/g' /opt/accumulo/conf/accumulo-env.sh -ENV HADOOP_HOME /opt/hadoop -ENV ZOOKEEPER_HOME /opt/apache-zookeeper -ENV ACCUMULO_HOME /opt/accumulo +ENV HADOOP_HOME=/opt/hadoop +ENV ZOOKEEPER_HOME=/opt/apache-zookeeper +ENV ACCUMULO_HOME=/opt/accumulo # Add the proxy binary COPY target/accumulo-proxy-${ACCUMULO_PROXY_VERSION}-bin.tar.gz /tmp/ RUN tar xzf /tmp/accumulo-proxy-${ACCUMULO_PROXY_VERSION}-bin.tar.gz -C /opt/accumulo-proxy --strip 1 -ENV ACCUMULO_PROXY_HOME /opt/accumulo-proxy +ENV ACCUMULO_PROXY_HOME=/opt/accumulo-proxy # Ensure Accumulo is on the path. -ENV PATH "${PATH}:${ACCUMULO_HOME}/bin" +ENV PATH="${PATH}:${ACCUMULO_HOME}/bin" CMD ["/opt/accumulo-proxy/bin/accumulo-proxy", "-p", "/opt/accumulo-proxy/conf/proxy.properties"] From 81c6633ea57742fdd6b47a128c2d32c28747d0bd Mon Sep 17 00:00:00 2001 From: Kidcredible <145068316+Kidcredible300@users.noreply.github.com> Date: Sun, 29 Jun 2025 12:30:20 -0400 Subject: [PATCH 8/9] Remove unnecessary comments Co-authored-by: Daniel Roberts --- src/main/java/org/apache/accumulo/proxy/TServerUtils.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/org/apache/accumulo/proxy/TServerUtils.java b/src/main/java/org/apache/accumulo/proxy/TServerUtils.java index 181ab92..6c4af19 100644 --- a/src/main/java/org/apache/accumulo/proxy/TServerUtils.java +++ b/src/main/java/org/apache/accumulo/proxy/TServerUtils.java @@ -188,8 +188,6 @@ private static ServerAddress createNonBlockingServer(HostAndPort address, TProce private static ThreadPoolExecutor createSelfResizingThreadPool(final String serverName, final int executorThreads, long threadTimeOut, final AccumuloConfiguration conf, long timeBetweenThreadChecks) { - // Using a ThreadPoolExecutorBuilder to create the ThreadPool Executor needed for this method - // TODO: Find out what number should go into the priority parameter. final ThreadPoolExecutor pool = ThreadPools.getServerThreadPools() .getPoolBuilder(serverName + "-ClientPool").numCoreThreads(executorThreads) .numMaxThreads(executorThreads).withTimeOut(threadTimeOut, TimeUnit.MILLISECONDS) From 521df745e1742b1c267b4b99403bfd486f6d4018 Mon Sep 17 00:00:00 2001 From: Robert Kurc Date: Sun, 29 Jun 2025 16:34:34 +0000 Subject: [PATCH 9/9] Removed config options from maven-compiler-plugin that caused warnings. --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index ec73c33..ab74d73 100644 --- a/pom.xml +++ b/pom.xml @@ -347,7 +347,6 @@ org.apache.maven.plugins maven-compiler-plugin - true true true @@ -445,7 +444,6 @@ **/thrift-gen-java/**/*.java LF - true true true true