From a21e0aef5e946f30db2ad0fb9ae84185ca5fb9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Fri, 29 Jan 2021 01:17:06 +0100 Subject: [PATCH] adapting to ES 7.10.2 --- .travis.yml | 3 - .../java/org/xbib/elx/api/AdminClient.java | 4 +- .../xbib/elx/common/AbstractAdminClient.java | 65 ++++++---- .../xbib/elx/common/AbstractBasicClient.java | 4 +- .../elx/common/DefaultBulkController.java | 10 +- .../java/org/xbib/elx/common/Parameters.java | 12 +- .../xbib/elx/common/test/TestExtension.java | 4 +- elx-common/src/test/resources/log4j2-test.xml | 4 + elx-http/build.gradle | 6 +- .../java/org/xbib/elx/http/HttpAction.java | 7 +- .../org/xbib/elx/http/HttpActionContext.java | 8 +- .../org/xbib/elx/http/HttpActionFuture.java | 98 --------------- .../org/xbib/elx/http/HttpBulkClient.java | 2 +- .../node/info/HttpNodesInfoAction.java | 16 +-- .../cluster/state/HttpClusterStateAction.java | 119 ++++++++++++------ .../indices/alias/get/HttpGetAliasAction.java | 14 +-- .../indices/create/HttpCreateIndexAction.java | 39 +----- .../mapping/get/HttpGetMappingsAction.java | 8 +- .../elx/http/action/bulk/HttpBulkAction.java | 4 - .../elx/http/action/get/HttpGetAction.java | 2 +- .../http/action/index/HttpIndexAction.java | 4 +- .../xbib/elx/http/test/IndexShiftTest.java | 6 +- .../org/xbib/elx/http/test/SearchTest.java | 16 ++- .../org/xbib/elx/http/test/TestExtension.java | 14 ++- elx-http/src/test/resources/log4j2-test.xml | 6 +- .../org/xbib/elx/node/NodeClientHelper.java | 3 +- .../xbib/elx/node/test/BulkClientTest.java | 12 +- .../xbib/elx/node/test/DuplicateIDTest.java | 2 +- .../xbib/elx/node/test/IndexPruneTest.java | 4 +- .../xbib/elx/node/test/IndexShiftTest.java | 10 +- .../org/xbib/elx/node/test/SearchTest.java | 4 +- .../org/xbib/elx/node/test/SmokeTest.java | 4 +- .../org/xbib/elx/node/test/TestExtension.java | 25 ++-- elx-node/src/test/resources/log4j2-test.xml | 4 + .../elx/transport/test/IndexShiftTest.java | 6 +- .../elx/transport/test/TestExtension.java | 4 +- .../src/test/resources/log4j2-test.xml | 4 + gradle.properties | 19 ++- gradle/wrapper/gradle-wrapper.jar | Bin 58910 -> 59203 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 2 +- gradlew.bat | 21 +--- 42 files changed, 258 insertions(+), 343 deletions(-) delete mode 100644 .travis.yml delete mode 100644 elx-http/src/main/java/org/xbib/elx/http/HttpActionFuture.java diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 94d2a22..0000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: java -jdk: - - openjdk11 diff --git a/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java b/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java index a7264ab..f6e58fb 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java +++ b/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java @@ -99,9 +99,9 @@ public interface AdminClient extends BasicClient { * Resolve alias. * * @param alias the alias - * @return this index name behind the alias or the alias if there is no index + * @return the index names behind the alias or an empty list if there is no such index */ - String resolveAlias(String alias); + List resolveAlias(String alias); /** * Resolve alias to all connected indices, sort index names with most recent timestamp on top, return this index diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java index 4bf3ab4..f888e47 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java @@ -33,9 +33,10 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.cluster.metadata.AliasMetaData; -import org.elasticsearch.cluster.metadata.AliasOrIndex; -import org.elasticsearch.cluster.metadata.MappingMetaData; +import org.elasticsearch.cluster.metadata.AliasMetadata; +import org.elasticsearch.cluster.metadata.IndexAbstraction; +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; @@ -64,7 +65,6 @@ import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; -import java.nio.charset.StandardCharsets; import java.time.LocalDate; import java.time.ZoneId; import java.time.format.DateTimeFormatter; @@ -76,7 +76,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.SortedMap; import java.util.TreeMap; import java.util.TreeSet; import java.util.concurrent.ExecutionException; @@ -231,19 +230,30 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements } @Override - public String resolveAlias(String alias) { + public List resolveAlias(String alias) { + if (alias == null) { + return List.of(); + } ensureClientIsPresent(); ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.blocks(false); - clusterStateRequest.metaData(true); + clusterStateRequest.metadata(true); clusterStateRequest.nodes(false); clusterStateRequest.routingTable(false); clusterStateRequest.customs(false); ClusterStateResponse clusterStateResponse = client.execute(ClusterStateAction.INSTANCE, clusterStateRequest).actionGet(); - SortedMap map = clusterStateResponse.getState().getMetaData().getAliasAndIndexLookup(); - AliasOrIndex aliasOrIndex = map.get(alias); - return aliasOrIndex != null ? aliasOrIndex.getIndices().iterator().next().getIndex().getName() : null; + IndexAbstraction indexAbstraction = clusterStateResponse.getState().getMetadata() + .getIndicesLookup().get(alias); + if (indexAbstraction == null) { + return List.of(); + } + List indexMetadata = indexAbstraction.getIndices(); + if (indexMetadata == null) { + return List.of(); + } + return indexMetadata.stream().map(im -> im.getIndex().getName()) + .sorted().collect(Collectors.toList()); } @Override @@ -283,8 +293,9 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements } waitForCluster("YELLOW", 30L, TimeUnit.SECONDS); // two situations: 1. a new alias 2. there is already an old index with the alias - String oldIndex = resolveAlias(index); - Map oldAliasMap = index.equals(oldIndex) ? null : getAliases(oldIndex); + List oldIndices = resolveAlias(index); + String oldIndex = oldIndices.stream().findFirst().orElse(null); + Map oldAliasMap = getAliases(oldIndex); logger.debug("old index = {} old alias map = {}", oldIndex, oldAliasMap); final List newAliases = new ArrayList<>(); final List moveAliases = new ArrayList<>(); @@ -466,9 +477,10 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements String dateTimePattern = settings.get("dateTimePattern"); if (dateTimePattern != null) { // check if index name with current date already exists, resolve to it - fullIndexName = resolveAlias(indexName + DateTimeFormatter.ofPattern(dateTimePattern) - .withZone(ZoneId.systemDefault()) // not GMT - .format(LocalDate.now())); + String dateAppendix = DateTimeFormatter.ofPattern(dateTimePattern) + .withZone(ZoneId.systemDefault()) // not GMT + .format(LocalDate.now()); + fullIndexName = resolveAlias(indexName + dateAppendix).stream().findFirst().orElse(index); } else { // check if index name already exists, resolve to it fullIndexName = resolveMostRecentIndex(indexName); @@ -510,12 +522,12 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements ensureClientIsPresent(); GetMappingsRequest getMappingsRequest = new GetMappingsRequest().indices(index); GetMappingsResponse getMappingsResponse = client.execute(GetMappingsAction.INSTANCE, getMappingsRequest).actionGet(); - ImmutableOpenMap> map = getMappingsResponse.getMappings(); + ImmutableOpenMap> map = getMappingsResponse.getMappings(); map.keys().forEach((Consumer>) stringObjectCursor -> { - ImmutableOpenMap mappings = map.get(stringObjectCursor.value); - for (ObjectObjectCursor cursor : mappings) { + ImmutableOpenMap mappings = map.get(stringObjectCursor.value); + for (ObjectObjectCursor cursor : mappings) { String mappingName = cursor.key; - MappingMetaData mappingMetaData = cursor.value; + MappingMetadata mappingMetaData = cursor.value; checkMapping(index, mappingName, mappingMetaData); } }); @@ -568,21 +580,20 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements private Map getFilters(GetAliasesResponse getAliasesResponse) { Map result = new HashMap<>(); - for (ObjectObjectCursor> object : getAliasesResponse.getAliases()) { - List aliasMetaDataList = object.value; - for (AliasMetaData aliasMetaData : aliasMetaDataList) { - if (aliasMetaData.filteringRequired()) { - result.put(aliasMetaData.alias(), - new String(aliasMetaData.getFilter().uncompressed(), StandardCharsets.UTF_8)); + for (ObjectObjectCursor> object : getAliasesResponse.getAliases()) { + List aliasMetadataList = object.value; + for (AliasMetadata aliasMetadata : aliasMetadataList) { + if (aliasMetadata.filteringRequired()) { + result.put(aliasMetadata.alias(),aliasMetadata.getFilter().string()); } else { - result.put(aliasMetaData.alias(), null); + result.put(aliasMetadata.alias(), null); } } } return result; } - private void checkMapping(String index, String type, MappingMetaData mappingMetaData) { + private void checkMapping(String index, String type, MappingMetadata mappingMetaData) { try { SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client, SearchAction.INSTANCE) .setIndices(index) 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 891bb8b..6fc0547 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 @@ -44,7 +44,6 @@ public abstract class AbstractBasicClient implements BasicClient { @Override public void setClient(ElasticsearchClient client) { - logger.log(Level.INFO, "setting client = " + client); this.client = client; } @@ -56,7 +55,7 @@ public abstract class AbstractBasicClient implements BasicClient { @Override public void init(Settings settings) throws IOException { if (closed.compareAndSet(false, true)) { - logger.log(Level.INFO, "initializing with settings = " + settings.toDelimitedString(',')); + logger.log(Level.DEBUG, "initializing with settings = " + settings.toDelimitedString(',')); this.settings = settings; setClient(createClient(settings)); } else { @@ -102,7 +101,6 @@ public abstract class AbstractBasicClient implements BasicClient { @Override public void waitForShards(long maxWaitTime, TimeUnit timeUnit) { ensureClientIsPresent(); - logger.info("waiting for cluster shard settling"); TimeValue timeout = toTimeValue(maxWaitTime, timeUnit); ClusterHealthRequest clusterHealthRequest = new ClusterHealthRequest() .waitForNoInitializingShards(true) diff --git a/elx-common/src/main/java/org/xbib/elx/common/DefaultBulkController.java b/elx-common/src/main/java/org/xbib/elx/common/DefaultBulkController.java index 9c935dc..4996c71 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/DefaultBulkController.java +++ b/elx-common/src/main/java/org/xbib/elx/common/DefaultBulkController.java @@ -70,16 +70,16 @@ public class DefaultBulkController implements BulkController { public void init(Settings settings) { bulkMetric.init(settings); int maxActionsPerRequest = settings.getAsInt(Parameters.MAX_ACTIONS_PER_REQUEST.name(), - Parameters.DEFAULT_MAX_ACTIONS_PER_REQUEST.getNum()); + Parameters.DEFAULT_MAX_ACTIONS_PER_REQUEST.asInteger()); int maxConcurrentRequests = settings.getAsInt(Parameters.MAX_CONCURRENT_REQUESTS.name(), - Parameters.DEFAULT_MAX_CONCURRENT_REQUESTS.getNum()); + Parameters.DEFAULT_MAX_CONCURRENT_REQUESTS.asInteger()); TimeValue flushIngestInterval = settings.getAsTime(Parameters.FLUSH_INTERVAL.name(), - TimeValue.timeValueSeconds(Parameters.DEFAULT_FLUSH_INTERVAL.getNum())); + TimeValue.timeValueSeconds(Parameters.DEFAULT_FLUSH_INTERVAL.asInteger())); ByteSizeValue maxVolumePerRequest = settings.getAsBytesSize(Parameters.MAX_VOLUME_PER_REQUEST.name(), - ByteSizeValue.parseBytesSizeValue(Parameters.DEFAULT_MAX_VOLUME_PER_REQUEST.getString(), + ByteSizeValue.parseBytesSizeValue(Parameters.DEFAULT_MAX_VOLUME_PER_REQUEST.asString(), "maxVolumePerRequest")); boolean enableBulkLogging = settings.getAsBoolean(Parameters.ENABLE_BULK_LOGGING.name(), - Parameters.ENABLE_BULK_LOGGING.getValue()); + Parameters.ENABLE_BULK_LOGGING.asBool()); BulkListener bulkListener = new DefaultBulkListener(this, bulkMetric, enableBulkLogging); this.bulkProcessor = DefaultBulkProcessor.builder(bulkClient.getClient(), bulkListener) .setBulkActions(maxActionsPerRequest) diff --git a/elx-common/src/main/java/org/xbib/elx/common/Parameters.java b/elx-common/src/main/java/org/xbib/elx/common/Parameters.java index 73819e1..e53a56d 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/Parameters.java +++ b/elx-common/src/main/java/org/xbib/elx/common/Parameters.java @@ -20,11 +20,11 @@ public enum Parameters { FLUSH_INTERVAL("flush_interval"); - boolean flag; + private boolean flag = false; - int num; + private int num = -1; - String string; + private String string; Parameters(boolean flag) { this.flag = flag; @@ -38,15 +38,15 @@ public enum Parameters { this.string = string; } - boolean getValue() { + public boolean asBool() { return flag; } - int getNum() { + public int asInteger() { return num; } - String getString() { + public String asString() { return string; } } diff --git a/elx-common/src/test/java/org/xbib/elx/common/test/TestExtension.java b/elx-common/src/test/java/org/xbib/elx/common/test/TestExtension.java index e8a3b56..3cf0bf9 100644 --- a/elx-common/src/test/java/org/xbib/elx/common/test/TestExtension.java +++ b/elx-common/src/test/java/org/xbib/elx/common/test/TestExtension.java @@ -84,9 +84,9 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft .getOrComputeIfAbsent(key + count.get(), key -> create(), Helper.class); logger.info("starting cluster with helper " + helper + " at " + helper.getHome()); helper.startNode("1"); - NodesInfoRequest nodesInfoRequest = new NodesInfoRequest().transport(true); + NodesInfoRequest nodesInfoRequest = new NodesInfoRequest().addMetric(NodesInfoRequest.Metric.TRANSPORT.metricName()); NodesInfoResponse response = helper.client("1").execute(NodesInfoAction.INSTANCE, nodesInfoRequest).actionGet(); - TransportAddress address = response.getNodes().get(0).getTransport().getAddress().publishAddress(); + TransportAddress address = response.getNodes().get(0).getNode().getAddress(); String host = address.address().getHostName(); int port = address.address().getPort(); try { diff --git a/elx-common/src/test/resources/log4j2-test.xml b/elx-common/src/test/resources/log4j2-test.xml index 6c323f8..d2a79b4 100644 --- a/elx-common/src/test/resources/log4j2-test.xml +++ b/elx-common/src/test/resources/log4j2-test.xml @@ -9,5 +9,9 @@ + + + + \ No newline at end of file diff --git a/elx-http/build.gradle b/elx-http/build.gradle index 36da0d6..981ebc2 100644 --- a/elx-http/build.gradle +++ b/elx-http/build.gradle @@ -5,9 +5,5 @@ dependencies{ api "org.elasticsearch.plugin:transport-netty4-client:${rootProject.property('elasticsearch.version')}" api "org.xbib:netty-http-client:${project.property('xbib-netty-http.version')}" runtimeOnly "org.bouncycastle:bcpkix-jdk15on:${project.property('bouncycastle.version')}" - if (Os.isFamily(Os.FAMILY_MAC)) { - runtimeOnly "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative-legacy-macosx.version')}" - } else if (Os.isFamily(Os.FAMILY_UNIX)) { - runtimeOnly "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative.version')}" - } + runtimeOnly "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative.version')}" } diff --git a/elx-http/src/main/java/org/xbib/elx/http/HttpAction.java b/elx-http/src/main/java/org/xbib/elx/http/HttpAction.java index 5aa54f2..0cdf1e8 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/HttpAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/HttpAction.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestStatus; import org.xbib.net.URL; +import org.xbib.netty.http.client.api.ClientTransport; import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.client.api.Transport; import org.xbib.netty.http.common.HttpResponse; import java.io.IOException; @@ -78,7 +78,10 @@ public abstract class HttpAction extends BaseFuture implements ActionFuture, ActionListener { - - private Transport httpClientTransport; - - HttpActionFuture setHttpClientTransport(Transport httpClientTransport) { - this.httpClientTransport = httpClientTransport; - return this; - } - - @Override - public T actionGet() { - try { - httpClientTransport.get(); - return get(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new IllegalStateException("future got interrupted", e); - } catch (ExecutionException e) { - throw rethrowExecutionException(e); - } - } - - @Override - public T actionGet(String timeout) { - return actionGet(TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".actionGet.timeout")); - } - - @Override - public T actionGet(long timeoutMillis) { - return actionGet(timeoutMillis, TimeUnit.MILLISECONDS); - } - - @Override - public T actionGet(TimeValue timeout) { - return actionGet(timeout.millis(), TimeUnit.MILLISECONDS); - } - - @Override - public T actionGet(long timeout, TimeUnit unit) { - try { - return get(timeout, unit); - } catch (TimeoutException e) { - throw new ElasticsearchTimeoutException(e); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new IllegalStateException("Future got interrupted", e); - } catch (ExecutionException e) { - throw rethrowExecutionException(e); - } - } - - private static RuntimeException rethrowExecutionException(ExecutionException e) { - if (e.getCause() instanceof ElasticsearchException) { - ElasticsearchException esEx = (ElasticsearchException) e.getCause(); - Throwable root = esEx.unwrapCause(); - if (root instanceof ElasticsearchException) { - return (ElasticsearchException) root; - } else if (root instanceof RuntimeException) { - return (RuntimeException) root; - } - return new UncategorizedExecutionException("Failed execution", root); - } else if (e.getCause() instanceof RuntimeException) { - return (RuntimeException) e.getCause(); - } else { - return new UncategorizedExecutionException("Failed execution", e); - } - } - - @Override - public void onResponse(L result) { - set(convert(result)); - } - - @Override - public void onFailure(Exception e) { - setException(e); - } - - @SuppressWarnings("unchecked") - private T convert(L listenerResponse) { - return (T) listenerResponse; - } -} 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 a9a9ac0..b88cf83 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 @@ -29,7 +29,7 @@ public class HttpBulkClient extends AbstractBulkClient implements ElasticsearchC } @Override - protected ElasticsearchClient createClient(Settings settings) throws IOException { + protected ElasticsearchClient createClient(Settings settings) { return this; } diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/admin/cluster/node/info/HttpNodesInfoAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/admin/cluster/node/info/HttpNodesInfoAction.java index d2b562d..1867d65 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/admin/cluster/node/info/HttpNodesInfoAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/admin/cluster/node/info/HttpNodesInfoAction.java @@ -42,28 +42,28 @@ public class HttpNodesInfoAction extends HttpAction metrics = new LinkedList<>(); - if (request.http()) { + if (request.requestedMetrics().contains(NodesInfoRequest.Metric.HTTP.metricName())) { metrics.add("http"); } - if (request.jvm()) { + if (request.requestedMetrics().contains(NodesInfoRequest.Metric.JVM.metricName())) { metrics.add("jvm"); } - if (request.os()) { + if (request.requestedMetrics().contains(NodesInfoRequest.Metric.OS.metricName())) { metrics.add("os"); } - if (request.plugins()) { + if (request.requestedMetrics().contains(NodesInfoRequest.Metric.PLUGINS.metricName())) { metrics.add("plugins"); } - if (request.process()) { + if (request.requestedMetrics().contains(NodesInfoRequest.Metric.PROCESS.metricName())) { metrics.add("process"); } - if (request.settings()) { + if (request.requestedMetrics().contains(NodesInfoRequest.Metric.SETTINGS.metricName())) { metrics.add("settings"); } - if (request.threadPool()) { + if (request.requestedMetrics().contains(NodesInfoRequest.Metric.THREAD_POOL.metricName())) { metrics.add("thread_pool"); } - if (request.transport()) { + if (request.requestedMetrics().contains(NodesInfoRequest.Metric.TRANSPORT.metricName())) { metrics.add("transport"); } if (!metrics.isEmpty()) { diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/admin/cluster/state/HttpClusterStateAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/admin/cluster/state/HttpClusterStateAction.java index 2f4693c..dd7f605 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/admin/cluster/state/HttpClusterStateAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/admin/cluster/state/HttpClusterStateAction.java @@ -1,16 +1,20 @@ package org.xbib.elx.http.action.admin.cluster.state; import com.carrotsearch.hppc.LongArrayList; +import org.apache.logging.log4j.Level; +import org.elasticsearch.Version; import org.elasticsearch.action.admin.cluster.state.ClusterStateAction; import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest; import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; +import org.elasticsearch.action.admin.indices.rollover.RolloverInfo; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.AliasMetaData; -import org.elasticsearch.cluster.metadata.IndexMetaData; -import org.elasticsearch.cluster.metadata.IndexTemplateMetaData; -import org.elasticsearch.cluster.metadata.MappingMetaData; -import org.elasticsearch.cluster.metadata.MetaData; +import org.elasticsearch.cluster.coordination.CoordinationMetadata; +import org.elasticsearch.cluster.metadata.AliasMetadata; +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; +import org.elasticsearch.cluster.metadata.MappingMetadata; +import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.CheckedFunction; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.compress.CompressedXContent; @@ -36,10 +40,6 @@ public class HttpClusterStateAction extends HttpAction list = new ArrayList<>(); - if (request.metaData()) { + if (request.metadata()) { list.add("metadata"); } if (request.blocks()) { @@ -79,10 +79,9 @@ public class HttpClusterStateAction extends HttpAction mappingSource = MapBuilder.newMapBuilder().put(currentFieldName, parser.mapOrdered()).map(); - builder.putMapping(new MappingMetaData(currentFieldName, mappingSource)); + Map mappingSource = + MapBuilder.newMapBuilder().put(currentFieldName, parser.mapOrdered()).map(); + builder.putMapping(new MappingMetadata(currentFieldName, mappingSource)); } else { throw new IllegalArgumentException("Unexpected token: " + token); } } } else if (KEY_ALIASES.equals(currentFieldName)) { while (parser.nextToken() != XContentParser.Token.END_OBJECT) { - builder.putAlias(AliasMetaData.Builder.fromXContent(parser)); + builder.putAlias(AliasMetadata.Builder.fromXContent(parser)); } } else if (KEY_IN_SYNC_ALLOCATIONS.equals(currentFieldName)) { while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { @@ -215,13 +226,30 @@ public class HttpClusterStateAction extends HttpAction mapping = parser.mapOrdered(); if (mapping.size() == 1) { String mappingType = mapping.keySet().iterator().next(); - builder.putMapping(new MappingMetaData(mappingType, mapping)); + builder.putMapping(new MappingMetadata(mappingType, mapping)); } } } @@ -247,22 +275,31 @@ public class HttpClusterStateAction extends HttpAction> aliasesBuilder = ImmutableOpenMap.builder(); + ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser); + ImmutableOpenMap.Builder> aliasesBuilder = ImmutableOpenMap.builder(); while (parser.nextToken() != XContentParser.Token.END_OBJECT) { if (parser.currentToken() == XContentParser.Token.FIELD_NAME) { String indexName = parser.currentName(); if (parser.nextToken() == XContentParser.Token.START_OBJECT) { - List parseInside = parseAliases(parser); + List parseInside = parseAliases(parser); aliasesBuilder.put(indexName, parseInside); } } @@ -57,8 +57,8 @@ public class HttpGetAliasAction extends HttpAction parseAliases(XContentParser parser) throws IOException { - List aliases = new ArrayList<>(); + private static List parseAliases(XContentParser parser) throws IOException { + List aliases = new ArrayList<>(); XContentParser.Token token; String currentFieldName = null; while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { @@ -67,7 +67,7 @@ public class HttpGetAliasAction extends HttpAction { - public static final ParseField MAPPINGS = new ParseField("mappings"); - public static final ParseField SETTINGS = new ParseField("settings"); - public static final ParseField ALIASES = new ParseField("aliases"); - @Override public CreateIndexAction getActionInstance() { return CreateIndexAction.INSTANCE; @@ -34,7 +24,7 @@ public class HttpCreateIndexAction extends HttpAction entityParser(HttpResponse httpResponse) { return CreateIndexResponse::fromXContent; } - - // fixed version from CreateIndexRequest - use only one mapping - private XContentBuilder toXContent(CreateIndexRequest createIndexRequest, - XContentBuilder builder) throws IOException { - builder.startObject(); - builder.startObject(SETTINGS.getPreferredName()); - createIndexRequest.settings().toXContent(builder, ToXContent.EMPTY_PARAMS); - builder.endObject(); - // there is only an empty or a single entry for mappings - if (createIndexRequest.mappings().isEmpty()) { - // ES wants a mappings element with an empty map - builder.startObject(MAPPINGS.getPreferredName()); - builder.endObject(); - } else { - Map mappingAsMap = createIndexRequest.mappings(); - String mappingString = mappingAsMap.values().iterator().next().toString(); - builder.field(MAPPINGS.getPreferredName()); - builder.map(XContentHelper.convertToMap(new BytesArray(mappingString), false, XContentType.JSON).v2()); - } - builder.startObject(ALIASES.getPreferredName()); - for (Alias alias : createIndexRequest.aliases()) { - alias.toXContent(builder, ToXContent.EMPTY_PARAMS); - } - builder.endObject(); - builder.endObject(); - return builder; - } } diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/mapping/get/HttpGetMappingsAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/mapping/get/HttpGetMappingsAction.java index 3fdeacf..6a69acb 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/mapping/get/HttpGetMappingsAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/mapping/get/HttpGetMappingsAction.java @@ -3,7 +3,7 @@ package org.xbib.elx.http.action.admin.indices.mapping.get; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsAction; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; -import org.elasticsearch.cluster.metadata.MappingMetaData; +import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.common.CheckedFunction; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.collect.ImmutableOpenMap; @@ -41,12 +41,12 @@ public class HttpGetMappingsAction extends HttpAction map = parser.map(); - ImmutableOpenMap.Builder> builder = new ImmutableOpenMap.Builder<>(); + ImmutableOpenMap.Builder> builder = new ImmutableOpenMap.Builder<>(); for (Map.Entry entry : map.entrySet()) { final String indexName = entry.getKey(); final Map mapping = (Map) ((Map) entry.getValue()).get(MAPPINGS.getPreferredName()); - ImmutableOpenMap.Builder typeBuilder = new ImmutableOpenMap.Builder<>(); - MappingMetaData mmd = new MappingMetaData("_doc", mapping); + ImmutableOpenMap.Builder typeBuilder = new ImmutableOpenMap.Builder<>(); + MappingMetadata mmd = new MappingMetadata("_doc", mapping); typeBuilder.put("_doc", mmd); builder.put(indexName, typeBuilder.build()); } diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/bulk/HttpBulkAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/bulk/HttpBulkAction.java index 2bef62f..0349ea3 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/bulk/HttpBulkAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/bulk/HttpBulkAction.java @@ -2,7 +2,6 @@ package org.xbib.elx.http.action.bulk; import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.bulk.BulkAction; -import org.elasticsearch.action.bulk.BulkItemResponse; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.delete.DeleteRequest; @@ -33,7 +32,6 @@ public class HttpBulkAction extends HttpAction { IndexRequest indexRequest = (IndexRequest) actionRequest; bulkContent.append("{\"").append(indexRequest.opType().getLowercase()).append("\":{"); bulkContent.append("\"_index\":\"").append(indexRequest.index()).append("\""); - bulkContent.append(",\"_type\":\"").append("_doc").append("\""); if (indexRequest.id() != null) { bulkContent.append(",\"_id\":\"").append(indexRequest.id()).append("\""); } @@ -53,7 +51,6 @@ public class HttpBulkAction extends HttpAction { UpdateRequest updateRequest = (UpdateRequest) actionRequest; bulkContent.append("{\"update\":{"); bulkContent.append("\"_index\":\"").append(updateRequest.index()).append("\""); - bulkContent.append(",\"_type\":\"").append("_doc").append("\""); bulkContent.append(",\"_id\":\"").append(updateRequest.id()).append("\""); if (updateRequest.routing() != null) { bulkContent.append(",\"_routing\":\"").append(updateRequest.routing()).append("\""); @@ -75,7 +72,6 @@ public class HttpBulkAction extends HttpAction { DeleteRequest deleteRequest = (DeleteRequest) actionRequest; bulkContent.append("{\"delete\":{"); bulkContent.append("\"_index\":\"").append(deleteRequest.index()).append("\""); - bulkContent.append(",\"_type\":\"").append("_doc").append("\""); bulkContent.append(",\"_id\":\"").append(deleteRequest.id()).append("\""); if (deleteRequest.routing() != null) { bulkContent.append(",\"_routing\":\"").append(deleteRequest.routing()).append("\""); // _routing diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpGetAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpGetAction.java index fef8e38..5d48f97 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpGetAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpGetAction.java @@ -21,7 +21,7 @@ public class HttpGetAction extends HttpAction { @Override protected Request.Builder createHttpRequest(String url, GetRequest request) { - return newGetRequest(url, "/" + request.index() + "/_doc/" + "/" + request.id()); + return newGetRequest(url, "/" + request.index() + "/_doc/" + request.id()); } @Override diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/index/HttpIndexAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/index/HttpIndexAction.java index f54de02..4dba25f 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/index/HttpIndexAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/index/HttpIndexAction.java @@ -1,6 +1,7 @@ package org.xbib.elx.http.action.index; import org.elasticsearch.action.ActionType; +import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.index.IndexAction; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexResponse; @@ -21,7 +22,8 @@ public class HttpIndexAction extends HttpAction { @Override protected Request.Builder createHttpRequest(String url, IndexRequest request) { - return newPutRequest(url, "/" + request.index() + "/_doc/" + request.id(), + String optype = request.opType() == DocWriteRequest.OpType.CREATE ? "_create" : "_doc"; + return newPutRequest(url, "/" + request.index() + "/" + optype + "/" + request.id(), request.source()); } diff --git a/elx-http/src/test/java/org/xbib/elx/http/test/IndexShiftTest.java b/elx-http/src/test/java/org/xbib/elx/http/test/IndexShiftTest.java index 25ca051..60db3c2 100644 --- a/elx-http/src/test/java/org/xbib/elx/http/test/IndexShiftTest.java +++ b/elx-http/src/test/java/org/xbib/elx/http/test/IndexShiftTest.java @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.Map; import java.util.concurrent.TimeUnit; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -67,7 +68,7 @@ class IndexShiftTest { assertTrue(aliases.containsKey("b")); assertTrue(aliases.containsKey("c")); assertTrue(aliases.containsKey("test")); - String resolved = adminClient.resolveAlias("test"); + String resolved = adminClient.resolveAlias("test").stream().findFirst().orElse(null); logger.log(Level.DEBUG, "resolved = " + resolved); aliases = adminClient.getAliases(resolved); logger.log(Level.DEBUG, "aliases = " + aliases); @@ -99,7 +100,8 @@ class IndexShiftTest { assertTrue(aliases.containsKey("d")); assertTrue(aliases.containsKey("e")); assertTrue(aliases.containsKey("f")); - resolved = adminClient.resolveAlias("test"); + resolved = adminClient.resolveAlias("test").stream().findFirst().orElse(null); + assertNotNull(resolved); aliases = adminClient.getAliases(resolved); assertTrue(aliases.containsKey("a")); assertTrue(aliases.containsKey("b")); diff --git a/elx-http/src/test/java/org/xbib/elx/http/test/SearchTest.java b/elx-http/src/test/java/org/xbib/elx/http/test/SearchTest.java index 3ed603e..074293f 100644 --- a/elx-http/src/test/java/org/xbib/elx/http/test/SearchTest.java +++ b/elx-http/src/test/java/org/xbib/elx/http/test/SearchTest.java @@ -4,6 +4,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; @@ -15,6 +16,7 @@ import org.xbib.elx.http.HttpBulkClient; import org.xbib.elx.http.HttpBulkClientProvider; import org.xbib.elx.http.HttpSearchClient; import org.xbib.elx.http.HttpSearchClientProvider; +import java.util.Optional; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; @@ -52,8 +54,10 @@ class SearchTest { bulkClient.waitForResponses(30L, TimeUnit.SECONDS); bulkClient.refreshIndex("test"); assertEquals(numactions, bulkClient.getSearchableDocs("test")); + bulkClient.index("test", "0", false, "{\"name\":\"Hello\"}"); + bulkClient.flush(); } - assertEquals(numactions, bulkClient.getBulkController().getBulkMetric().getSucceeded().getCount()); + assertEquals(numactions + 1, bulkClient.getBulkController().getBulkMetric().getSucceeded().getCount()); if (bulkClient.getBulkController().getLastBulkError() != null) { logger.error("error", bulkClient.getBulkController().getLastBulkError()); } @@ -62,12 +66,14 @@ class SearchTest { .setSearchClientProvider(HttpSearchClientProvider.class) .put(helper.getHttpSettings()) .build()) { + Optional responseOptional = searchClient.get(grb -> grb.setIndex("test").setId("0")); + assertEquals("{\"name\":\"Hello\"}", responseOptional.get().getSourceAsString()); Stream stream = searchClient.search(qb -> qb .setIndices("test") .setQuery(QueryBuilders.matchAllQuery()), TimeValue.timeValueMinutes(1), 10); long count = stream.count(); - assertEquals(numactions, count); + assertEquals(numactions + 1, count); Stream ids = searchClient.getIds(qb -> qb .setIndices("test") .setQuery(QueryBuilders.matchAllQuery())); @@ -76,9 +82,9 @@ class SearchTest { logger.info(id); idcount.incrementAndGet(); }); - assertEquals(numactions, idcount.get()); - assertEquals(13, searchClient.getSearchMetric().getQueries().getCount()); - assertEquals(2, searchClient.getSearchMetric().getSucceededQueries().getCount()); + assertEquals(numactions + 1, idcount.get()); + assertEquals(15, searchClient.getSearchMetric().getQueries().getCount()); + assertEquals(3, searchClient.getSearchMetric().getSucceededQueries().getCount()); assertEquals(0, searchClient.getSearchMetric().getEmptyQueries().getCount()); } } diff --git a/elx-http/src/test/java/org/xbib/elx/http/test/TestExtension.java b/elx-http/src/test/java/org/xbib/elx/http/test/TestExtension.java index 5e05fae..82452a5 100644 --- a/elx-http/src/test/java/org/xbib/elx/http/test/TestExtension.java +++ b/elx-http/src/test/java/org/xbib/elx/http/test/TestExtension.java @@ -1,5 +1,6 @@ package org.xbib.elx.http.test; +import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchTimeoutException; @@ -18,6 +19,7 @@ import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.http.HttpInfo; import org.elasticsearch.node.Node; import org.elasticsearch.node.NodeValidationException; import org.elasticsearch.plugins.Plugin; @@ -84,11 +86,14 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft .getOrComputeIfAbsent(key + count.get(), key -> create(), Helper.class); logger.info("starting cluster with helper " + helper + " at " + helper.getHome()); helper.startNode("1"); - NodesInfoRequest nodesInfoRequest = new NodesInfoRequest().transport(true); + NodesInfoRequest nodesInfoRequest = new NodesInfoRequest() + .clear() + .addMetric(NodesInfoRequest.Metric.HTTP.metricName()); NodesInfoResponse response = helper.client("1"). execute(NodesInfoAction.INSTANCE, nodesInfoRequest).actionGet(); - TransportAddress address = response.getNodes().get(0).getHttp().getAddress().publishAddress(); + TransportAddress address = response.getNodes().get(0).getInfo(HttpInfo.class).getAddress().publishAddress(); helper.httpHost = address.address().getHostName(); helper.httpPort = address.address().getPort(); + logger.log(Level.INFO, "http host = " + helper.httpHost + " port = " + helper.httpPort); try { ClusterHealthResponse healthResponse = helper.client("1").execute(ClusterHealthAction.INSTANCE, new ClusterHealthRequest().waitForStatus(ClusterHealthStatus.GREEN) @@ -191,8 +196,8 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft return Settings.builder() .put("cluster.name", getClusterName()) .put("path.home", getHome()) - .put("cluster.initial_master_nodes", "1") - .put("discovery.seed_hosts", "127.0.0.1:9300") + //.put("cluster.initial_master_nodes", "1") + //.put("discovery.seed_hosts", "127.0.0.1:9300") .build(); } @@ -226,6 +231,7 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft Settings nodeSettings = Settings.builder() .put(getNodeSettings()) .put("node.name", id) + .put("path.data", getHome() + "/data-" + id) .build(); List> plugins = Collections.singletonList(Netty4Plugin.class); Node node = new MockNode(nodeSettings, plugins); diff --git a/elx-http/src/test/resources/log4j2-test.xml b/elx-http/src/test/resources/log4j2-test.xml index 6c323f8..367d41a 100644 --- a/elx-http/src/test/resources/log4j2-test.xml +++ b/elx-http/src/test/resources/log4j2-test.xml @@ -9,5 +9,9 @@ + + + + - \ No newline at end of file + 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 f1894f1..03ad4bc 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 @@ -4,7 +4,6 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.client.ElasticsearchClient; -import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; @@ -58,6 +57,8 @@ public class NodeClientHelper { + " " + System.getProperty("java.vm.version"); Settings effectiveSettings = Settings.builder() .put(settings.filter(key -> !isPrivateSettings(key))) + // We have to keep the legacy settings. This means a lot of noise in the log files abut deprecation and failed handshaking. + // Clearly, ES wants to annoy users of embedded master-less, data-less nodes. .put("node.master", false) .put("node.data", false) // "node.processors" 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 777b1c0..c84cf4c 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,7 +43,7 @@ class BulkClientTest { void testSingleDoc() throws Exception { final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .put(Parameters.MAX_ACTIONS_PER_REQUEST.name(), MAX_ACTIONS_PER_REQUEST) .put(Parameters.FLUSH_INTERVAL.name(), TimeValue.timeValueSeconds(30)) .build(); @@ -66,7 +66,7 @@ class BulkClientTest { void testNewIndex() throws Exception { final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .put(Parameters.FLUSH_INTERVAL.name(), TimeValue.timeValueSeconds(5)) .build(); bulkClient.newIndex("test"); @@ -77,11 +77,11 @@ class BulkClientTest { void testMapping() throws Exception { try (NodeAdminClient adminClient = ClientBuilder.builder(helper.client("1")) .setAdminClientProvider(NodeAdminClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .build(); NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .build()) { XContentBuilder builder = JsonXContent.contentBuilder() .startObject() @@ -101,7 +101,7 @@ class BulkClientTest { long numactions = ACTIONS; final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .put(Parameters.MAX_ACTIONS_PER_REQUEST.name(), MAX_ACTIONS_PER_REQUEST) .put(Parameters.FLUSH_INTERVAL.name(), TimeValue.timeValueSeconds(60)) .build(); @@ -131,7 +131,7 @@ class BulkClientTest { final long actions = ACTIONS; final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .put(Parameters.MAX_CONCURRENT_REQUESTS.name(), maxthreads) .put(Parameters.MAX_ACTIONS_PER_REQUEST.name(), MAX_ACTIONS_PER_REQUEST) .build(); 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 098a235..0a4c377 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,7 +35,7 @@ class DuplicateIDTest { long numactions = ACTIONS; final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .put(Parameters.MAX_ACTIONS_PER_REQUEST.name(), MAX_ACTIONS_PER_REQUEST) .build(); try { 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 c4eb863..d298162 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 @@ -37,11 +37,11 @@ class IndexPruneTest { void testPrune() throws IOException { final NodeAdminClient adminClient = ClientBuilder.builder(helper.client("1")) .setAdminClientProvider(NodeAdminClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .build(); final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .build(); try { Settings settings = Settings.builder() 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 6187e90..f63c5ee 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 @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Map; import java.util.concurrent.TimeUnit; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -36,11 +37,11 @@ class IndexShiftTest { void testIndexShift() throws Exception { final NodeAdminClient adminClient = ClientBuilder.builder(helper.client("1")) .setAdminClientProvider(NodeAdminClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .build(); final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .build(); try { Settings settings = Settings.builder() @@ -65,7 +66,8 @@ class IndexShiftTest { assertTrue(aliases.containsKey("b")); assertTrue(aliases.containsKey("c")); assertTrue(aliases.containsKey("test")); - String resolved = adminClient.resolveAlias("test"); + String resolved = adminClient.resolveAlias("test").stream().findFirst().orElse(null); + assertEquals("test_shift", resolved); aliases = adminClient.getAliases(resolved); assertTrue(aliases.containsKey("a")); assertTrue(aliases.containsKey("b")); @@ -95,7 +97,7 @@ class IndexShiftTest { assertTrue(aliases.containsKey("d")); assertTrue(aliases.containsKey("e")); assertTrue(aliases.containsKey("f")); - resolved = adminClient.resolveAlias("test"); + resolved = adminClient.resolveAlias("test").stream().findFirst().orElse(null); aliases = adminClient.getAliases(resolved); assertTrue(aliases.containsKey("a")); assertTrue(aliases.containsKey("b")); 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 27556c3..b0af05d 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,7 +39,7 @@ class SearchTest { long numactions = ACTIONS; final NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .put(Parameters.MAX_ACTIONS_PER_REQUEST.name(), MAX_ACTIONS_PER_REQUEST) .build(); try (bulkClient) { @@ -60,7 +60,7 @@ class SearchTest { assertNull(bulkClient.getBulkController().getLastBulkError()); try (NodeSearchClient searchClient = ClientBuilder.builder(helper.client("1")) .setSearchClientProvider(NodeSearchClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .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 5395a3b..353d7a8 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,11 +32,11 @@ class SmokeTest { void smokeTest() throws Exception { try (NodeAdminClient adminClient = ClientBuilder.builder(helper.client("1")) .setAdminClientProvider(NodeAdminClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .build(); NodeBulkClient bulkClient = ClientBuilder.builder(helper.client("1")) .setBulkClientProvider(NodeBulkClientProvider.class) - .put(helper.getNodeSettings()) + .put(helper.getNodeSettings("1")) .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 c8ffcfc..b59275d 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 @@ -84,11 +84,12 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft .getOrComputeIfAbsent(key + count.get(), key -> create(), Helper.class); logger.info("starting cluster with helper " + helper + " at " + helper.getHome()); helper.startNode("1"); - NodesInfoRequest nodesInfoRequest = new NodesInfoRequest().transport(true); + NodesInfoRequest nodesInfoRequest = new NodesInfoRequest().addMetric(NodesInfoRequest.Metric.TRANSPORT.metricName()); NodesInfoResponse response = helper.client("1"). execute(NodesInfoAction.INSTANCE, nodesInfoRequest).actionGet(); - TransportAddress address = response.getNodes().get(0).getTransport().getAddress().publishAddress(); + TransportAddress address = response.getNodes().get(0).getNode().getAddress(); helper.host = address.address().getHostName(); helper.port = address.address().getPort(); + logger.info("host = " + helper.host + " port = " + helper.port); try { ClusterHealthResponse healthResponse = helper.client("1").execute(ClusterHealthAction.INSTANCE, new ClusterHealthRequest().waitForStatus(ClusterHealthStatus.GREEN) @@ -103,7 +104,7 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft ClusterStateRequest clusterStateRequest = new ClusterStateRequest().all(); ClusterStateResponse clusterStateResponse = helper.client("1").execute(ClusterStateAction.INSTANCE, clusterStateRequest).actionGet(); - logger.info("cluster name = {}", clusterStateResponse.getClusterName().value()); + logger.info("cluster up, name = {}", clusterStateResponse.getClusterName().value()); } @Override @@ -117,10 +118,6 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft } private void closeNodes(Helper helper) throws IOException { - logger.info("closing all clients"); - for (AbstractClient client : helper.clients.values()) { - client.close(); - } logger.info("closing all nodes"); for (Node node : helper.nodes.values()) { if (node != null) { @@ -169,8 +166,6 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft Map nodes = new HashMap<>(); - Map clients = new HashMap<>(); - void setHome(String home) { this.home = home; } @@ -187,13 +182,11 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft return cluster; } - Settings getNodeSettings() { + Settings getNodeSettings(String id) { return Settings.builder() .put("cluster.name", getClusterName()) .put("path.home", getHome()) - .put("cluster.initial_master_nodes", "1") - .put("discovery.seed_hosts", "127.0.0.1:9300") - .put("node.max_local_storage_nodes", "2") + .put("node.max_local_storage_nodes", 2) .build(); } @@ -202,7 +195,7 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft } ElasticsearchClient client(String id) { - return clients.get(id); + return nodes.get(id).client(); } String randomString(int len) { @@ -216,14 +209,12 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft private Node buildNode(String id) { Settings nodeSettings = Settings.builder() - .put(getNodeSettings()) + .put(getNodeSettings(id)) .put("node.name", id) .build(); List> plugins = Collections.singletonList(Netty4Plugin.class); Node node = new MockNode(nodeSettings, plugins); - AbstractClient client = (AbstractClient) node.client(); nodes.put(id, node); - clients.put(id, client); return node; } } diff --git a/elx-node/src/test/resources/log4j2-test.xml b/elx-node/src/test/resources/log4j2-test.xml index 6c323f8..d2a79b4 100644 --- a/elx-node/src/test/resources/log4j2-test.xml +++ b/elx-node/src/test/resources/log4j2-test.xml @@ -9,5 +9,9 @@ + + + + \ No newline at end of file diff --git a/elx-transport/src/test/java/org/xbib/elx/transport/test/IndexShiftTest.java b/elx-transport/src/test/java/org/xbib/elx/transport/test/IndexShiftTest.java index bf59064..347bd42 100644 --- a/elx-transport/src/test/java/org/xbib/elx/transport/test/IndexShiftTest.java +++ b/elx-transport/src/test/java/org/xbib/elx/transport/test/IndexShiftTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Map; import java.util.concurrent.TimeUnit; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -65,7 +66,8 @@ class IndexShiftTest { assertTrue(aliases.containsKey("b")); assertTrue(aliases.containsKey("c")); assertTrue(aliases.containsKey("test_shift")); - String resolved = adminClient.resolveAlias("test_shift"); + String resolved = adminClient.resolveAlias("test_shift").stream().findFirst().orElse(null); + assertNotNull(resolved); aliases = adminClient.getAliases(resolved); assertTrue(aliases.containsKey("a")); assertTrue(aliases.containsKey("b")); @@ -95,7 +97,7 @@ class IndexShiftTest { assertTrue(aliases.containsKey("d")); assertTrue(aliases.containsKey("e")); assertTrue(aliases.containsKey("f")); - resolved = adminClient.resolveAlias("test_shift"); + resolved = adminClient.resolveAlias("test_shift").stream().findFirst().orElse(null); aliases = adminClient.getAliases(resolved); assertTrue(aliases.containsKey("a")); assertTrue(aliases.containsKey("b")); 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 754f5c4..29161eb 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 @@ -84,9 +84,9 @@ public class TestExtension implements ParameterResolver, BeforeEachCallback, Aft .getOrComputeIfAbsent(key + count.get(), key -> create(), Helper.class); logger.info("starting cluster with helper " + helper + " at " + helper.getHome()); helper.startNode("1"); - NodesInfoRequest nodesInfoRequest = new NodesInfoRequest().transport(true); + NodesInfoRequest nodesInfoRequest = new NodesInfoRequest().addMetric(NodesInfoRequest.Metric.TRANSPORT.metricName()); NodesInfoResponse response = helper.client("1"). execute(NodesInfoAction.INSTANCE, nodesInfoRequest).actionGet(); - TransportAddress address = response.getNodes().get(0).getTransport().getAddress().publishAddress(); + TransportAddress address = response.getNodes().get(0).getNode().getAddress(); helper.host = address.address().getHostName(); helper.port = address.address().getPort(); try { diff --git a/elx-transport/src/test/resources/log4j2-test.xml b/elx-transport/src/test/resources/log4j2-test.xml index 6c323f8..d2a79b4 100644 --- a/elx-transport/src/test/resources/log4j2-test.xml +++ b/elx-transport/src/test/resources/log4j2-test.xml @@ -9,5 +9,9 @@ + + + + \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index aee433c..c579ac0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,14 @@ group = org.xbib name = elx -version = 7.6.1.3 +version = 7.10.2.0 -gradle.wrapper.version = 6.4.1 +gradle.wrapper.version = 6.6.1 xbib-metrics.version = 2.1.0 -xbib-netty-http.version = 4.1.50.0 -elasticsearch.version = 7.6.1 -# ES 7.6.1 uses Jackson 2.8.11 -jackson.version = 2.11.0 -netty.version = 4.1.50.Final -tcnative.version = 2.0.29.Final -tcnative-legacy-macosx.version = 2.0.26.Final +xbib-netty-http.version = 4.1.58.0 +elasticsearch.version = 7.10.2 +# ES 7.10.2.1 uses Jackson 2.10.4 +jackson.version = 2.12.1 +netty.version = 4.1.58.Final +tcnative.version = 2.0.36.Final bouncycastle.version = 1.64 -log4j.version = 2.13.3 +log4j.version = 2.14.0 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c053550b91381bbd28b1afc82d634bf73a8a..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f 100644 GIT binary patch delta 6656 zcmY+Ibx_pN*Z*PZ4(U#j1qtbvrOTyO8fghZ8kYJfEe%U|$dV!@ASKczEZq$fg48M@ z;LnHO_j#Uq?%bL4dY^md%$$4Y+&@nKC|1uHR&59YNhubGh72|a#ylPdh9V+akp|I; zPk^W-a00GrFMkz_NSADdv2G2-i6rb=cB_@WnG(**4ZO$=96R=t|NZ@|0_z&q3GwO^ ziUFcuj$a9QaZ3j?xt`5#q`sT-ufrtBP0nt3IA&dr*+VCsBzBVW?vZ6eZr0oD%t33z zm~-5IVsjy(F>;S~Pm@bxX85>Z*@(QL6i3JQc?1ryQFcC@X^2^mZWhFv|v? z49>l|nA&XNQ6#OvccUTyBMB*WO#NA;FW5|eE_K6dtVYP2G?uUZ09!`Iq1IF2gA(aS zLu@G^cQJmh=x?-YsYa@E6QnE5+1@ds&0f#OQRDl^GnIT_m84G5XY%W z;Ck6bk^Oeu*Ma-XmxI5GjqzWNbJMsQF4)WfMZEA{oxW0E32e)*JfG}3otPishIQBw zkBe6N#4pKPN>q1R6G1@5&(u#5yPEToMBB6_oEK|q z@(i5j!?;NNCv~=HvW%zF&1yWBq(nJa_#``G&SRmQvE|jePUPs{J!$TacM|e}Fsceb zx+76|mDp6@w>)^DIl{8?)6XYNRU|2plG8Jy&7(^9SdOWNKKJK&>0!z6XiN4J*Jkao z=E1y5x-XDC==Ub+8fLb#OW&{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5E->#y<_1V|T1f%Af!ZYqXg}`O zI$qKOWdnclF`%_Z`WGOe{`A`l-#a?s=Q1a#@BOWmExH2;Wl`OB!B-%lq3nO{4=WO& z#k_x|N&(qzm*6S{G*|GCegF2N2ulC+(58z2DG~yUs}i8zvRf&$CJCaexJ6Xu!`qz( z)*v8*kAE#D0KCo*s{8^Rbg=`*E2MzeIt0|x55%n-gO&yX#$l=3W7-_~&(G8j1E(XB hw}tl`5K!1C(72%nnjQrp<7@!WCh47rWB+@R{{wClNUHz< diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 21e622d..33682bb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index fbd7c51..4f906e0 100755 --- a/gradlew +++ b/gradlew @@ -130,7 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index a9f778a..ac1b06f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell