From 51d34952d0b6021f867c38c5d39c0d500f9faf9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Sat, 22 May 2021 21:00:20 +0200 Subject: [PATCH] update to Netty 4.1.65, clean up dependencies (drop SSL deps), clean up close flag, show netty version info --- .../java/org/xbib/elx/api/BasicClient.java | 2 +- .../java/org/xbib/elx/api/BulkProcessor.java | 2 ++ .../java/org/xbib/elx/api/SearchMetric.java | 2 ++ elx-common/build.gradle | 3 +-- .../xbib/elx/common/AbstractBasicClient.java | 25 ++++++++++++++----- .../xbib/elx/common/AbstractBulkClient.java | 22 ++++++---------- .../xbib/elx/common/AbstractSearchClient.java | 18 ++++++------- .../org/xbib/elx/common/ClientBuilder.java | 8 +++--- .../xbib/elx/common/DefaultBulkProcessor.java | 13 ++++++---- .../xbib/elx/common/DefaultSearchMetric.java | 19 +++++++++++--- .../org/xbib/elx/common/MockAdminClient.java | 3 ++- .../org/xbib/elx/common/MockBulkClient.java | 3 ++- .../org/xbib/elx/common/MockSearchClient.java | 3 ++- elx-http/build.gradle | 2 -- .../org/xbib/elx/http/HttpAdminClient.java | 10 +++++--- .../org/xbib/elx/http/HttpBulkClient.java | 9 ++++--- .../org/xbib/elx/http/HttpSearchClient.java | 9 ++++--- elx-http/src/test/resources/log4j2-test.xml | 2 +- elx-node/build.gradle | 2 -- elx-transport/build.gradle | 2 -- .../elx/transport/TransportAdminClient.java | 9 ++++--- .../elx/transport/TransportBulkClient.java | 9 ++++--- .../elx/transport/TransportSearchClient.java | 9 ++++--- .../elx/transport/test/TestExtension.java | 4 +-- gradle.properties | 10 ++++---- gradle/test/junit5.gradle | 23 ++--------------- 26 files changed, 119 insertions(+), 104 deletions(-) diff --git a/elx-api/src/main/java/org/xbib/elx/api/BasicClient.java b/elx-api/src/main/java/org/xbib/elx/api/BasicClient.java index cdd05e5..6188d3e 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/BasicClient.java +++ b/elx-api/src/main/java/org/xbib/elx/api/BasicClient.java @@ -8,7 +8,7 @@ import java.util.concurrent.TimeUnit; public interface BasicClient extends Closeable { - void init(Settings settings); + boolean init(Settings settings, String info); void putClusterSetting(String key, Object value, long timeout, TimeUnit timeUnit); diff --git a/elx-api/src/main/java/org/xbib/elx/api/BulkProcessor.java b/elx-api/src/main/java/org/xbib/elx/api/BulkProcessor.java index 7e3235d..23a9327 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/BulkProcessor.java +++ b/elx-api/src/main/java/org/xbib/elx/api/BulkProcessor.java @@ -30,4 +30,6 @@ public interface BulkProcessor extends Closeable, Flushable { void setMaxBulkVolume(long bulkSize); long getMaxBulkVolume(); + + boolean isClosed(); } diff --git a/elx-api/src/main/java/org/xbib/elx/api/SearchMetric.java b/elx-api/src/main/java/org/xbib/elx/api/SearchMetric.java index e190a51..ccc1ed8 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/SearchMetric.java +++ b/elx-api/src/main/java/org/xbib/elx/api/SearchMetric.java @@ -30,4 +30,6 @@ public interface SearchMetric extends Closeable { void start(); void stop(); + + boolean isClosed(); } diff --git a/elx-common/build.gradle b/elx-common/build.gradle index 7cdfdfb..fc26420 100644 --- a/elx-common/build.gradle +++ b/elx-common/build.gradle @@ -2,6 +2,5 @@ dependencies { api project(':elx-api') implementation "org.xbib:time:${rootProject.property('xbib-time.version')}" testImplementation "org.elasticsearch.plugin:transport-netty4-client:${rootProject.property('elasticsearch.version')}" - testImplementation "io.netty:netty-codec-http:${project.property('netty.version')}" - testImplementation "io.netty:netty-transport:${project.property('netty.version')}" + testImplementation "org.xbib:netty-http-client:${project.property('xbib-netty-http.version')}" } diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java index 6fc3024..e9a0a13 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java @@ -4,6 +4,7 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.Version; import org.elasticsearch.action.admin.cluster.health.ClusterHealthAction; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; @@ -44,11 +45,10 @@ public abstract class AbstractBasicClient implements BasicClient { private final ScheduledExecutorService executorService; - private final AtomicBoolean closed; + protected final AtomicBoolean closed; public AbstractBasicClient() { - this.executorService = Executors.newScheduledThreadPool(2, - new DaemonThreadFactory("elx")); + this.executorService = Executors.newScheduledThreadPool(2, new DaemonThreadFactory("elx")); closed = new AtomicBoolean(false); } @@ -68,18 +68,31 @@ public abstract class AbstractBasicClient implements BasicClient { } @Override - public void init(Settings settings) { - this.settings = settings; + public boolean init(Settings settings, String infoString) { if (closed.compareAndSet(false, true)) { + this.settings = settings; + logger.log(Level.INFO, String.format("Elx: %s on %s %s %s Java: %s %s %s %s ES: %s %s", + System.getProperty("user.name"), + System.getProperty("os.name"), + System.getProperty("os.arch"), + System.getProperty("os.version"), + System.getProperty("java.version"), + System.getProperty("java.vm.version"), + System.getProperty("java.vm.vendor"), + System.getProperty("java.vm.name"), + Version.CURRENT, + infoString)); logger.log(Level.INFO, "initializing with settings = " + settings.toDelimitedString(',')); setClient(createClient(settings)); + return true; } + return false; } @Override public void close() throws IOException { if (closed.compareAndSet(false, true)) { - if (executorService != null) { + if (!executorService.isShutdown()) { executorService.shutdownNow(); } closeClient(settings); diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java index a31d151..0d057f4 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java @@ -26,7 +26,6 @@ import org.xbib.elx.api.IndexDefinition; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; import static org.xbib.elx.api.IndexDefinition.TYPE_NAME; @@ -36,19 +35,17 @@ public abstract class AbstractBulkClient extends AbstractBasicClient implements private BulkProcessor bulkProcessor; - private final AtomicBoolean closed; - public AbstractBulkClient() { super(); - closed = new AtomicBoolean(true); } @Override - public void init(Settings settings) { - if (closed.compareAndSet(true, false)) { - super.init(settings); + public boolean init(Settings settings, String info) { + if (super.init(settings, info)) { bulkProcessor = new DefaultBulkProcessor(this, settings); + return true; } + return false; } @Override @@ -65,15 +62,12 @@ public abstract class AbstractBulkClient extends AbstractBasicClient implements @Override public void close() throws IOException { - if (closed.compareAndSet(false, true)) { + if (!bulkProcessor.isClosed()) { + logger.info("closing bulk processor"); ensureClientIsPresent(); - if (bulkProcessor != null) { - logger.info("closing bulk processor"); - bulkProcessor.close(); - } - closeClient(settings); - super.close(); + bulkProcessor.close(); } + super.close(); } @Override diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java index dbff539..090d05e 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java @@ -34,34 +34,30 @@ import java.util.stream.StreamSupport; public abstract class AbstractSearchClient extends AbstractBasicClient implements SearchClient { - private final AtomicBoolean closed; - private SearchMetric searchMetric; public AbstractSearchClient() { super(); - this.closed = new AtomicBoolean(true); } @Override - public void init(Settings settings) { - if (closed.compareAndSet(true, false)) { - super.init(settings); + public boolean init(Settings settings, String info) { + if (super.init(settings, info)) { if (settings.getAsBoolean(Parameters.SEARCH_METRIC_ENABLED.getName(), Parameters.SEARCH_METRIC_ENABLED.getBoolean())) { this.searchMetric = new DefaultSearchMetric(this, settings); searchMetric.init(settings); } + return true; } + return false; } @Override public void close() throws IOException { - if (closed.compareAndSet(false, true)) { - super.close(); - if (searchMetric != null) { - searchMetric.close(); - } + super.close(); + if (!searchMetric.isClosed()) { + searchMetric.close(); } } diff --git a/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java b/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java index 8b4ada5..5214dc7 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java +++ b/elx-common/src/main/java/org/xbib/elx/common/ClientBuilder.java @@ -14,7 +14,6 @@ import org.xbib.elx.api.BasicClient; import org.xbib.elx.api.SearchClientProvider; import java.io.IOException; -import java.util.HashMap; import java.util.Map; import java.util.ServiceLoader; @@ -146,13 +145,12 @@ public class ClientBuilder { @SuppressWarnings("unchecked") public C build() throws IOException { Settings settings = settingsBuilder.build(); - logger.log(Level.INFO, "settings = " + settings.toDelimitedString(',')); if (adminClientProvider != null) { for (AdminClientProvider provider : ServiceLoader.load(AdminClientProvider.class, classLoader)) { if (provider.getClass().isAssignableFrom(adminClientProvider)) { C c = (C) provider.getClient(); c.setClient(client); - c.init(settings); + c.init(settings, null); return c; } } @@ -162,7 +160,7 @@ public class ClientBuilder { if (provider.getClass().isAssignableFrom(bulkClientProvider)) { C c = (C) provider.getClient(); c.setClient(client); - c.init(settings); + c.init(settings, null); return c; } } @@ -172,7 +170,7 @@ public class ClientBuilder { if (provider.getClass().isAssignableFrom(searchClientProvider)) { C c = (C) provider.getClient(); c.setClient(client); - c.init(settings); + c.init(settings, null); return c; } } diff --git a/elx-common/src/main/java/org/xbib/elx/common/DefaultBulkProcessor.java b/elx-common/src/main/java/org/xbib/elx/common/DefaultBulkProcessor.java index 8ef89f1..e72f7f8 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/DefaultBulkProcessor.java +++ b/elx-common/src/main/java/org/xbib/elx/common/DefaultBulkProcessor.java @@ -60,6 +60,8 @@ public class DefaultBulkProcessor implements BulkProcessor { public DefaultBulkProcessor(BulkClient bulkClient, Settings settings) { this.bulkClient = bulkClient; + this.closed = new AtomicBoolean(false); + this.enabled = new AtomicBoolean(false); int maxActionsPerRequest = settings.getAsInt(Parameters.BULK_MAX_ACTIONS_PER_REQUEST.getName(), Parameters.BULK_MAX_ACTIONS_PER_REQUEST.getInteger()); String flushIntervalStr = settings.get(Parameters.BULK_FLUSH_INTERVAL.getName(), @@ -82,17 +84,13 @@ public class DefaultBulkProcessor implements BulkProcessor { this.bulkVolume = maxVolumePerRequest.getBytes(); } this.bulkRequest = new BulkRequest(); - this.closed = new AtomicBoolean(false); - this.enabled = new AtomicBoolean(false); this.executionIdGen = new AtomicLong(); this.permits = settings.getAsInt(Parameters.BULK_PERMITS.getName(), Parameters.BULK_PERMITS.getInteger()); if (permits < 1) { throw new IllegalArgumentException("must not be less 1 permits for bulk indexing"); } this.semaphore = new ResizeableSemaphore(permits); - if (logger.isInfoEnabled()) { - logger.info("bulk processor now active"); - } + logger.info("bulk processor now enabled"); setEnabled(true); } @@ -121,6 +119,11 @@ public class DefaultBulkProcessor implements BulkProcessor { return bulkVolume; } + @Override + public boolean isClosed() { + return closed.get(); + } + @Override public ScheduledExecutorService getScheduler() { return bulkClient.getScheduler(); diff --git a/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchMetric.java b/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchMetric.java index 7611e1b..24cff43 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchMetric.java +++ b/elx-common/src/main/java/org/xbib/elx/common/DefaultSearchMetric.java @@ -12,6 +12,7 @@ import org.xbib.metrics.common.CountMetric; import org.xbib.metrics.common.Meter; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; public class DefaultSearchMetric implements SearchMetric { @@ -37,8 +38,11 @@ public class DefaultSearchMetric implements SearchMetric { private Long stopped; + private final AtomicBoolean closed; + public DefaultSearchMetric(SearchClient searchClient, Settings settings) { + this.closed = new AtomicBoolean(true); totalQuery = new Meter(searchClient.getScheduler()); currentQuery = new CountMetric(); queries = new CountMetric(); @@ -55,7 +59,9 @@ public class DefaultSearchMetric implements SearchMetric { @Override public void init(Settings settings) { - start(); + if (closed.compareAndSet(true, false)) { + start(); + } } @Override @@ -117,10 +123,17 @@ public class DefaultSearchMetric implements SearchMetric { this.future.cancel(true); } + @Override + public boolean isClosed() { + return closed.get(); + } + @Override public void close() { - stop(); - totalQuery.shutdown(); + if (closed.compareAndSet(false, true)) { + stop(); + totalQuery.shutdown(); + } } private void log() { diff --git a/elx-common/src/main/java/org/xbib/elx/common/MockAdminClient.java b/elx-common/src/main/java/org/xbib/elx/common/MockAdminClient.java index 66619fd..dc31d62 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/MockAdminClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/MockAdminClient.java @@ -14,7 +14,8 @@ public class MockAdminClient extends AbstractAdminClient { } @Override - public void init(Settings settings) { + public boolean init(Settings settings, String info) { + return true; } @Override diff --git a/elx-common/src/main/java/org/xbib/elx/common/MockBulkClient.java b/elx-common/src/main/java/org/xbib/elx/common/MockBulkClient.java index 0856fe5..63cd3a0 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/MockBulkClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/MockBulkClient.java @@ -18,7 +18,8 @@ public class MockBulkClient extends AbstractBulkClient { } @Override - public void init(Settings settings) { + public boolean init(Settings settings, String info) { + return true; } @Override diff --git a/elx-common/src/main/java/org/xbib/elx/common/MockSearchClient.java b/elx-common/src/main/java/org/xbib/elx/common/MockSearchClient.java index 82be6ef..c8e8cce 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/MockSearchClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/MockSearchClient.java @@ -14,7 +14,8 @@ public class MockSearchClient extends AbstractSearchClient { } @Override - public void init(Settings settings) { + public boolean init(Settings settings, String info) { + return true; } @Override diff --git a/elx-http/build.gradle b/elx-http/build.gradle index 6a8e8c8..b069967 100644 --- a/elx-http/build.gradle +++ b/elx-http/build.gradle @@ -2,6 +2,4 @@ dependencies{ api project(':elx-common') api "org.xbib:netty-http-client:${project.property('xbib-netty-http.version')}" api "org.elasticsearch.plugin:transport-netty4-client:${rootProject.property('elasticsearch.version')}" - runtimeOnly "org.bouncycastle:bcpkix-jdk15on:${project.property('bouncycastle.version')}" - runtimeOnly "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative.version')}" } diff --git a/elx-http/src/main/java/org/xbib/elx/http/HttpAdminClient.java b/elx-http/src/main/java/org/xbib/elx/http/HttpAdminClient.java index 4e5d4f6..4f3c203 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/HttpAdminClient.java +++ b/elx-http/src/main/java/org/xbib/elx/http/HttpAdminClient.java @@ -9,7 +9,6 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.threadpool.ThreadPool; import org.xbib.elx.common.AbstractAdminClient; -import java.io.IOException; /** * Elasticsearch HTTP admin client. @@ -24,9 +23,12 @@ public class HttpAdminClient extends AbstractAdminClient implements Elasticsearc } @Override - public void init(Settings settings) { - super.init(settings); - helper.init(settings); + public boolean init(Settings settings, String info) { + if (super.init(settings, "Netty: " + io.netty.util.Version.identify())) { + helper.init(settings); + return true; + } + return false; } @Override diff --git a/elx-http/src/main/java/org/xbib/elx/http/HttpBulkClient.java b/elx-http/src/main/java/org/xbib/elx/http/HttpBulkClient.java index 89f26b2..0aae56b 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/HttpBulkClient.java +++ b/elx-http/src/main/java/org/xbib/elx/http/HttpBulkClient.java @@ -23,9 +23,12 @@ public class HttpBulkClient extends AbstractBulkClient implements ElasticsearchC } @Override - public void init(Settings settings) { - super.init(settings); - helper.init(settings); + public boolean init(Settings settings, String info) { + if (super.init(settings, io.netty.util.Version.identify().toString())) { + helper.init(settings); + return true; + } + return false; } @Override diff --git a/elx-http/src/main/java/org/xbib/elx/http/HttpSearchClient.java b/elx-http/src/main/java/org/xbib/elx/http/HttpSearchClient.java index 044efde..28e494d 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/HttpSearchClient.java +++ b/elx-http/src/main/java/org/xbib/elx/http/HttpSearchClient.java @@ -23,9 +23,12 @@ public class HttpSearchClient extends AbstractSearchClient implements Elasticsea } @Override - public void init(Settings settings) { - super.init(settings); - helper.init(settings); + public boolean init(Settings settings, String info) { + if (super.init(settings, "Netty: " + io.netty.util.Version.identify())) { + helper.init(settings); + return true; + } + return false; } @Override diff --git a/elx-http/src/test/resources/log4j2-test.xml b/elx-http/src/test/resources/log4j2-test.xml index 0f90ef1..c097287 100644 --- a/elx-http/src/test/resources/log4j2-test.xml +++ b/elx-http/src/test/resources/log4j2-test.xml @@ -1,7 +1,7 @@ - + diff --git a/elx-node/build.gradle b/elx-node/build.gradle index 6ce98b7..b61dbcf 100644 --- a/elx-node/build.gradle +++ b/elx-node/build.gradle @@ -1,6 +1,4 @@ dependencies { api project(':elx-common') api "org.elasticsearch.plugin:transport-netty4-client:${project.property('elasticsearch.version')}" - api "io.netty:netty-codec-http:${project.property('netty.version')}" - api "io.netty:netty-transport:${project.property('netty.version')}" } diff --git a/elx-transport/build.gradle b/elx-transport/build.gradle index a8313e6..835f3a0 100644 --- a/elx-transport/build.gradle +++ b/elx-transport/build.gradle @@ -1,6 +1,4 @@ dependencies { api project(':elx-common') api "org.elasticsearch.plugin:transport-netty4-client:${rootProject.property('elasticsearch.version')}" - api "io.netty:netty-codec-http:${project.property('netty.version')}" - api "io.netty:netty-transport:${project.property('netty.version')}" } diff --git a/elx-transport/src/main/java/org/xbib/elx/transport/TransportAdminClient.java b/elx-transport/src/main/java/org/xbib/elx/transport/TransportAdminClient.java index ff5a88b..25d6c96 100644 --- a/elx-transport/src/main/java/org/xbib/elx/transport/TransportAdminClient.java +++ b/elx-transport/src/main/java/org/xbib/elx/transport/TransportAdminClient.java @@ -23,9 +23,12 @@ public class TransportAdminClient extends AbstractAdminClient { } @Override - public void init(Settings settings) { - super.init(settings); - helper.init((TransportClient) getClient(), settings); + public boolean init(Settings settings, String info) { + if (super.init(settings, "Netty: " + io.netty.util.Version.identify())) { + helper.init((TransportClient) getClient(), settings); + return true; + } + return false; } @Override diff --git a/elx-transport/src/main/java/org/xbib/elx/transport/TransportBulkClient.java b/elx-transport/src/main/java/org/xbib/elx/transport/TransportBulkClient.java index f7f9166..b08d9d1 100644 --- a/elx-transport/src/main/java/org/xbib/elx/transport/TransportBulkClient.java +++ b/elx-transport/src/main/java/org/xbib/elx/transport/TransportBulkClient.java @@ -23,9 +23,12 @@ public class TransportBulkClient extends AbstractBulkClient { } @Override - public void init(Settings settings) { - super.init(settings); - helper.init((TransportClient) getClient(), settings); + public boolean init(Settings settings, String info) { + if (super.init(settings, "Netty: " + io.netty.util.Version.identify())) { + helper.init((TransportClient) getClient(), settings); + return true; + } + return false; } @Override diff --git a/elx-transport/src/main/java/org/xbib/elx/transport/TransportSearchClient.java b/elx-transport/src/main/java/org/xbib/elx/transport/TransportSearchClient.java index eb39534..5fcba6d 100644 --- a/elx-transport/src/main/java/org/xbib/elx/transport/TransportSearchClient.java +++ b/elx-transport/src/main/java/org/xbib/elx/transport/TransportSearchClient.java @@ -23,9 +23,12 @@ public class TransportSearchClient extends AbstractSearchClient { } @Override - public void init(Settings settings) { - super.init(settings); - helper.init((TransportClient) getClient(), settings); + public boolean init(Settings settings, String info) { + if (super.init(settings, "Netty: " + io.netty.util.Version.identify())) { + helper.init((TransportClient) getClient(), settings); + return true; + } + return false; } @Override diff --git a/elx-transport/src/test/java/org/xbib/elx/transport/test/TestExtension.java b/elx-transport/src/test/java/org/xbib/elx/transport/test/TestExtension.java index 8617479..e8672c1 100644 --- a/elx-transport/src/test/java/org/xbib/elx/transport/test/TestExtension.java +++ b/elx-transport/src/test/java/org/xbib/elx/transport/test/TestExtension.java @@ -163,8 +163,8 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft .put(Parameters.PORT.getName(), port) .put(Parameters.CLUSTER_TARGET_HEALTH.getName(), "YELLOW") .put(Parameters.CLUSTER_TARGET_HEALTH_TIMEOUT.getName(), "1m") - .put(Parameters.BULK_METRIC_ENABLED.getName(), Boolean.FALSE) - .put(Parameters.SEARCH_METRIC_ENABLED.getName(), Boolean.FALSE) + .put(Parameters.BULK_METRIC_ENABLED.getName(), Boolean.TRUE) + .put(Parameters.SEARCH_METRIC_ENABLED.getName(), Boolean.TRUE) .build(); } diff --git a/gradle.properties b/gradle.properties index 5a74bcf..ff49a21 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,11 +5,11 @@ version = 7.10.2.11 gradle.wrapper.version = 6.6.1 xbib-metrics.version = 2.1.0 xbib-time.version = 2.1.0 -xbib-netty-http.version = 4.1.65.0 elasticsearch.version = 7.10.2 # ES 7.10.2 uses Jackson 2.10.4 jackson.version = 2.12.3 -netty.version = 4.1.65.Final -tcnative.version = 2.0.39.Final -bouncycastle.version = 1.68 -log4j.version = 2.14.0 +# ES 7.10.2. uses Netty 4.1.49 +xbib-netty-http.version = 4.1.65.0 +# ES 7.10.2 uses log4j2 2.11.1 +log4j.version = 2.14.1 +junit.version = 5.7.1 diff --git a/gradle/test/junit5.gradle b/gradle/test/junit5.gradle index 9ee64d3..79f16ba 100644 --- a/gradle/test/junit5.gradle +++ b/gradle/test/junit5.gradle @@ -1,5 +1,5 @@ -def junitVersion = project.hasProperty('junit.version')?project.property('junit.version'):'5.7.0' +def junitVersion = project.hasProperty('junit.version')?project.property('junit.version'):'5.7.1' def hamcrestVersion = project.hasProperty('hamcrest.version')?project.property('hamcrest.version'):'2.2' dependencies { @@ -11,30 +11,11 @@ dependencies { test { useJUnitPlatform() - // for Lucene to access jdk.internal.ref and jdk.internal.misc in Java 11+ jvmArgs = [ // gradle default of 512m is too less for ES bulk indexing '-Xmx2g', '-Xms2g', - // do we need tricks with G1GC and real memory circuit breaker? - /*'-XX:+UseG1GC', - '-XX:+ParallelRefProcEnabled', - '-XX:MaxGCPauseMillis=50', - '-XX:+UnlockExperimentalVMOptions', - '-XX:+DisableExplicitGC', - '-XX:+AlwaysPreTouch', - '-XX:G1NewSizePercent=30', - '-XX:G1MaxNewSizePercent=40', - '-XX:G1HeapRegionSize=8M', - '-XX:G1ReservePercent=20', - '-XX:G1HeapWastePercent=5', - '-XX:G1MixedGCCountTarget=4', - '-XX:InitiatingHeapOccupancyPercent=15', - '-XX:G1MixedGCLiveThresholdPercent=90', - '-XX:G1RSetUpdatingPauseTimePercent=5', - '-XX:SurvivorRatio=32', - '-XX:+PerfDisableSharedMem', - '-XX:MaxTenuringThreshold=1',*/ + // for Lucene to access jdk.internal.ref and jdk.internal.misc in Java 11+ '--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED', '--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED', '--add-opens=java.base/java.nio=ALL-UNNAMED'