From 2c117be26e97cb4caf3c7d8cd051272d96762eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Thu, 4 Jun 2020 21:15:31 +0200 Subject: [PATCH] update to Jackson 2.11, Log4j 2.13.3, fix node client tests --- .../main/java/org/xbib/elx/node/NodeClientHelper.java | 1 + .../java/org/xbib/elx/node/test/BulkClientTest.java | 6 ++++++ .../java/org/xbib/elx/node/test/DuplicateIDTest.java | 1 + .../java/org/xbib/elx/node/test/IndexPruneTest.java | 2 ++ .../java/org/xbib/elx/node/test/IndexShiftTest.java | 2 ++ .../test/java/org/xbib/elx/node/test/SearchTest.java | 2 ++ .../test/java/org/xbib/elx/node/test/SmokeTest.java | 2 ++ .../java/org/xbib/elx/node/test/TestExtension.java | 1 + gradle.properties | 10 +++++----- 9 files changed, 22 insertions(+), 5 deletions(-) diff --git a/elx-node/src/main/java/org/xbib/elx/node/NodeClientHelper.java b/elx-node/src/main/java/org/xbib/elx/node/NodeClientHelper.java index 6f6aef0..411d311 100644 --- a/elx-node/src/main/java/org/xbib/elx/node/NodeClientHelper.java +++ b/elx-node/src/main/java/org/xbib/elx/node/NodeClientHelper.java @@ -53,6 +53,7 @@ public class NodeClientHelper { .put("node.client", true) .put("node.master", false) .put("node.data", false) + .put("path.home", settings.get("path.home")) .build(); logger.info("creating node client on {} with effective settings {}", version, effectiveSettings.getAsMap()); diff --git a/elx-node/src/test/java/org/xbib/elx/node/test/BulkClientTest.java b/elx-node/src/test/java/org/xbib/elx/node/test/BulkClientTest.java index d98e45d..ffbe41b 100644 --- a/elx-node/src/test/java/org/xbib/elx/node/test/BulkClientTest.java +++ b/elx-node/src/test/java/org/xbib/elx/node/test/BulkClientTest.java @@ -43,6 +43,7 @@ class BulkClientTest { void testSingleDoc() throws Exception { final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) + .put(helper.getNodeSettings()) .put(Parameters.MAX_ACTIONS_PER_REQUEST.name(), MAX_ACTIONS_PER_REQUEST) .put(Parameters.FLUSH_INTERVAL.name(), TimeValue.timeValueSeconds(30)) .build(); @@ -65,6 +66,7 @@ class BulkClientTest { void testNewIndex() throws Exception { final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) + .put(helper.getNodeSettings()) .put(Parameters.FLUSH_INTERVAL.name(), TimeValue.timeValueSeconds(5)) .build(); bulkClient.newIndex("test"); @@ -75,9 +77,11 @@ class BulkClientTest { void testMapping() throws Exception { try (NodeAdminClient adminClient = ClientBuilder.builder(helper.client("1")) .setAdminClientProvider(NodeAdminClientProvider.class) + .put(helper.getNodeSettings()) .build(); NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) + .put(helper.getNodeSettings()) .build()) { XContentBuilder builder = JsonXContent.contentBuilder() .startObject() @@ -99,6 +103,7 @@ class BulkClientTest { long numactions = ACTIONS; final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) + .put(helper.getNodeSettings()) .put(Parameters.MAX_ACTIONS_PER_REQUEST.name(), MAX_ACTIONS_PER_REQUEST) .put(Parameters.FLUSH_INTERVAL.name(), TimeValue.timeValueSeconds(60)) .build(); @@ -130,6 +135,7 @@ class BulkClientTest { logger.info("maxthreads={} maxactions={} maxloop={}", maxthreads, maxActionsPerRequest, actions); final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) + .put(helper.getNodeSettings()) .put(Parameters.MAX_CONCURRENT_REQUESTS.name(), maxthreads) .put(Parameters.MAX_ACTIONS_PER_REQUEST.name(), maxActionsPerRequest) .put(Parameters.FLUSH_INTERVAL.name(), TimeValue.timeValueSeconds(60)) diff --git a/elx-node/src/test/java/org/xbib/elx/node/test/DuplicateIDTest.java b/elx-node/src/test/java/org/xbib/elx/node/test/DuplicateIDTest.java index 6751350..d694ee5 100644 --- a/elx-node/src/test/java/org/xbib/elx/node/test/DuplicateIDTest.java +++ b/elx-node/src/test/java/org/xbib/elx/node/test/DuplicateIDTest.java @@ -35,6 +35,7 @@ class DuplicateIDTest { long numactions = ACTIONS; try (NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) + .put(helper.getNodeSettings()) .put(Parameters.MAX_ACTIONS_PER_REQUEST.name(), MAX_ACTIONS_PER_REQUEST) .build()) { bulkClient.newIndex("test"); diff --git a/elx-node/src/test/java/org/xbib/elx/node/test/IndexPruneTest.java b/elx-node/src/test/java/org/xbib/elx/node/test/IndexPruneTest.java index cf4821e..1e8670f 100644 --- a/elx-node/src/test/java/org/xbib/elx/node/test/IndexPruneTest.java +++ b/elx-node/src/test/java/org/xbib/elx/node/test/IndexPruneTest.java @@ -35,9 +35,11 @@ class IndexPruneTest { void testPrune() throws IOException { try (NodeAdminClient adminClient = ClientBuilder.builder(helper.client("1")) .setAdminClientProvider(NodeAdminClientProvider.class) + .put(helper.getNodeSettings()) .build(); NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) + .put(helper.getNodeSettings()) .build()) { Settings settings = Settings.builder() .put("index.number_of_shards", 1) diff --git a/elx-node/src/test/java/org/xbib/elx/node/test/IndexShiftTest.java b/elx-node/src/test/java/org/xbib/elx/node/test/IndexShiftTest.java index 0b1dddb..0c79ffb 100644 --- a/elx-node/src/test/java/org/xbib/elx/node/test/IndexShiftTest.java +++ b/elx-node/src/test/java/org/xbib/elx/node/test/IndexShiftTest.java @@ -35,9 +35,11 @@ class IndexShiftTest { void testIndexShift() throws Exception { try (NodeAdminClient adminClient = ClientBuilder.builder(helper.client("1")) .setAdminClientProvider(NodeAdminClientProvider.class) + .put(helper.getNodeSettings()) .build(); NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) + .put(helper.getNodeSettings()) .build()) { Settings settings = Settings.builder() .put("index.number_of_shards", 1) diff --git a/elx-node/src/test/java/org/xbib/elx/node/test/SearchTest.java b/elx-node/src/test/java/org/xbib/elx/node/test/SearchTest.java index 2fa2f0b..33dd290 100644 --- a/elx-node/src/test/java/org/xbib/elx/node/test/SearchTest.java +++ b/elx-node/src/test/java/org/xbib/elx/node/test/SearchTest.java @@ -39,6 +39,7 @@ class SearchTest { long numactions = ACTIONS; final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) + .put(helper.getNodeSettings()) .put(Parameters.MAX_ACTIONS_PER_REQUEST.name(), MAX_ACTIONS_PER_REQUEST) .build(); try (bulkClient) { @@ -59,6 +60,7 @@ class SearchTest { assertNull(bulkClient.getBulkController().getLastBulkError()); try (NodeSearchClient searchClient = ClientBuilder.builder(helper.client("1")) .setSearchClientProvider(NodeSearchClientProvider.class) + .put(helper.getNodeSettings()) .build()) { Stream stream = searchClient.search(qb -> qb .setIndices("test") diff --git a/elx-node/src/test/java/org/xbib/elx/node/test/SmokeTest.java b/elx-node/src/test/java/org/xbib/elx/node/test/SmokeTest.java index 2a8892d..d747566 100644 --- a/elx-node/src/test/java/org/xbib/elx/node/test/SmokeTest.java +++ b/elx-node/src/test/java/org/xbib/elx/node/test/SmokeTest.java @@ -32,9 +32,11 @@ class SmokeTest { void smokeTest() throws Exception { try (NodeAdminClient adminClient = ClientBuilder.builder(helper.client("1")) .setAdminClientProvider(NodeAdminClientProvider.class) + .put(helper.getNodeSettings()) .build(); NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) + .put(helper.getNodeSettings()) .build()) { IndexDefinition indexDefinition = adminClient.buildIndexDefinitionFromSettings("test_smoke", Settings.EMPTY); diff --git a/elx-node/src/test/java/org/xbib/elx/node/test/TestExtension.java b/elx-node/src/test/java/org/xbib/elx/node/test/TestExtension.java index e394c9f..991cb43 100644 --- a/elx-node/src/test/java/org/xbib/elx/node/test/TestExtension.java +++ b/elx-node/src/test/java/org/xbib/elx/node/test/TestExtension.java @@ -180,6 +180,7 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft Settings getNodeSettings() { return Settings.builder() + .put("name", "elx-client") // for Threadpool name .put("cluster.name", getClusterName()) .put("path.home", getHome()) .build(); diff --git a/gradle.properties b/gradle.properties index 8df8c01..0305a00 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,17 +1,17 @@ group = org.xbib name = elx -version = 2.2.1.18 +version = 2.2.1.19 gradle.wrapper.version = 6.4.1 xbib-metrics.version = 2.1.0 xbib-guice.version = 4.4.2 xbib-guava.version = 28.1 -xbib-netty-http.version = 4.1.49.0 +xbib-netty-http.version = 4.1.49.1 elasticsearch.version = 2.2.1 -jackson.version = 2.9.10 +# jackson.version = 2.9.10 +jackson.version = 2.11.0 jna.version = 4.5.2 -log4j.version = 2.13.1 +log4j.version = 2.13.3 mustache.version = 0.9.5 jts.version = 1.13 -junit.version = 5.6.2 asciidoclet.version = 1.5.4