diff --git a/api/build.gradle b/api/build.gradle index 61be444..6344343 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -1,16 +1,9 @@ dependencies { - compile("org.elasticsearch.client:transport:${rootProject.property('elasticsearch.version')}") { - exclude group: 'org.elasticsearch', module: 'securesm' - exclude group: 'org.elasticsearch.plugin', module: 'transport-netty3-client' - exclude group: 'org.elasticsearch.plugin', module: 'reindex-client' - exclude group: 'org.elasticsearch.plugin', module: 'percolator-client' - exclude group: 'org.elasticsearch.plugin', module: 'lang-mustache-client' - } - // we try to override the Elasticsearch netty by our netty version which is more recent compile "io.netty:netty-buffer:${rootProject.property('netty.version')}" compile "io.netty:netty-codec-http:${rootProject.property('netty.version')}" compile "io.netty:netty-handler:${rootProject.property('netty.version')}" + compile "org.xbib.elasticsearch:elasticsearch:${rootProject.property('elasticsearch-server.version')}" } jar { diff --git a/build.gradle b/build.gradle index 49dfe7d..712808f 100644 --- a/build.gradle +++ b/build.gradle @@ -75,7 +75,7 @@ subprojects { baseName "${rootProject.name}-${project.name}" } - javadoc { + /*javadoc { options.docletpath = configurations.asciidoclet.files.asType(List) options.doclet = 'org.xbib.asciidoclet.Asciidoclet' options.overview = "src/docs/asciidoclet/overview.adoc" @@ -85,7 +85,7 @@ subprojects { configure(options) { noTimestamp = true } - } + }*/ /*task javadocJar(type: Jar, dependsOn: classes) { baseName "${rootProject.name}-${project.name}" diff --git a/common/build.gradle b/common/build.gradle index 7e0f3cb..5e961d5 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -44,7 +44,7 @@ artifacts { test { enabled = false - jvmArgs "-javaagent:" + configurations.alpnagent.asPath + //jvmArgs "-javaagent:" + configurations.alpnagent.asPath systemProperty 'path.home', project.buildDir.absolutePath testLogging { showStandardStreams = true @@ -63,3 +63,8 @@ esTest { } esTest.dependsOn jar, testJar +dependencyLicenses.enabled = false + +// we not like to examine Netty +thirdPartyAudit.enabled = false + diff --git a/common/licenses/classloader-6.3.2.1.jar.sha1 b/common/licenses/classloader-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..c959ad5 --- /dev/null +++ b/common/licenses/classloader-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +f14124d1557cd7c21742f09cd18913a861125e56 \ No newline at end of file diff --git a/common/licenses/elasticsearch-6.3.2.1.jar.sha1 b/common/licenses/elasticsearch-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..7f6a7c3 --- /dev/null +++ b/common/licenses/elasticsearch-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +2bc144784abc748426b125a948b0bdd4fc4dd7d6 \ No newline at end of file diff --git a/common/licenses/elx-api-6.3.2.0.jar.sha1 b/common/licenses/elx-api-6.3.2.0.jar.sha1 new file mode 100644 index 0000000..06a07c6 --- /dev/null +++ b/common/licenses/elx-api-6.3.2.0.jar.sha1 @@ -0,0 +1 @@ +af8cf6c3e7de988bbb7e6e441a2235ba1df8eaf8 \ No newline at end of file diff --git a/common/licenses/elx-api-LICENSE.txt b/common/licenses/elx-api-LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/common/licenses/elx-api-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/common/licenses/hdrhistogram-6.3.2.1.jar.sha1 b/common/licenses/hdrhistogram-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..72d7e23 --- /dev/null +++ b/common/licenses/hdrhistogram-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +436454f1e6e821f6f18def7a2e4b467eeb341430 \ No newline at end of file diff --git a/common/licenses/hppc-6.3.2.1.jar.sha1 b/common/licenses/hppc-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..55b3ead --- /dev/null +++ b/common/licenses/hppc-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +80ef947c9edfaacb261ee27e2c7fa5968b3eeaa6 \ No newline at end of file diff --git a/common/licenses/jackson-6.3.2.1.jar.sha1 b/common/licenses/jackson-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..d2c2967 --- /dev/null +++ b/common/licenses/jackson-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +abf31b393745f2a6e133819ee7485420d6bc5160 \ No newline at end of file diff --git a/common/licenses/jna-6.3.2.1.jar.sha1 b/common/licenses/jna-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..5142c47 --- /dev/null +++ b/common/licenses/jna-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +68463acec824eb54989fcecbe44074a41ee639e3 \ No newline at end of file diff --git a/common/licenses/joda-6.3.2.1.jar.sha1 b/common/licenses/joda-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..aade01f --- /dev/null +++ b/common/licenses/joda-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +4c232fdaf23b8c7b1ff1ca1ba9b91fcc0fa01938 \ No newline at end of file diff --git a/common/licenses/joptsimple-6.3.2.1.jar.sha1 b/common/licenses/joptsimple-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..6059409 --- /dev/null +++ b/common/licenses/joptsimple-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +7834ee69f91a3360f17a31cf6a27b245a3a2f668 \ No newline at end of file diff --git a/common/licenses/jts-6.3.2.1.jar.sha1 b/common/licenses/jts-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..8d0ab58 --- /dev/null +++ b/common/licenses/jts-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +b10c7f51ab98e6f6f252c931534edbb632cb108e \ No newline at end of file diff --git a/common/licenses/log4j-6.3.2.1.jar.sha1 b/common/licenses/log4j-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..c6f346a --- /dev/null +++ b/common/licenses/log4j-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +824c180dc70fda00b70a146d2f2be9a8f36cfdbb \ No newline at end of file diff --git a/common/licenses/lucene-6.3.2.1.jar.sha1 b/common/licenses/lucene-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..bee6197 --- /dev/null +++ b/common/licenses/lucene-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +68fba4b570c4717cda49a3f187e2bfb909697fc8 \ No newline at end of file diff --git a/common/licenses/metrics-1.1.0.jar.sha1 b/common/licenses/metrics-1.1.0.jar.sha1 new file mode 100644 index 0000000..959a34a --- /dev/null +++ b/common/licenses/metrics-1.1.0.jar.sha1 @@ -0,0 +1 @@ +e8949a50a223ab837edc312e34ee597febe86464 \ No newline at end of file diff --git a/common/licenses/netty-buffer-4.1.33.Final.jar.sha1 b/common/licenses/netty-buffer-4.1.33.Final.jar.sha1 new file mode 100644 index 0000000..6bab3bb --- /dev/null +++ b/common/licenses/netty-buffer-4.1.33.Final.jar.sha1 @@ -0,0 +1 @@ +0d4fdb13d5832a0f348e4d855c71201a2b15d560 \ No newline at end of file diff --git a/common/licenses/netty-codec-4.1.33.Final.jar.sha1 b/common/licenses/netty-codec-4.1.33.Final.jar.sha1 new file mode 100644 index 0000000..e103a84 --- /dev/null +++ b/common/licenses/netty-codec-4.1.33.Final.jar.sha1 @@ -0,0 +1 @@ +600762bf6861fa62b061782debb6fcdeff1f1984 \ No newline at end of file diff --git a/common/licenses/netty-codec-http-4.1.33.Final.jar.sha1 b/common/licenses/netty-codec-http-4.1.33.Final.jar.sha1 new file mode 100644 index 0000000..b5a8826 --- /dev/null +++ b/common/licenses/netty-codec-http-4.1.33.Final.jar.sha1 @@ -0,0 +1 @@ +ad557dffc0777b1b24558d6c57b77b0198dbb58d \ No newline at end of file diff --git a/common/licenses/netty-common-4.1.33.Final.jar.sha1 b/common/licenses/netty-common-4.1.33.Final.jar.sha1 new file mode 100644 index 0000000..22d10fa --- /dev/null +++ b/common/licenses/netty-common-4.1.33.Final.jar.sha1 @@ -0,0 +1 @@ +398b725cbaca8c691b74759ae6c3d69b8eeb0574 \ No newline at end of file diff --git a/common/licenses/netty-handler-4.1.33.Final.jar.sha1 b/common/licenses/netty-handler-4.1.33.Final.jar.sha1 new file mode 100644 index 0000000..8d86585 --- /dev/null +++ b/common/licenses/netty-handler-4.1.33.Final.jar.sha1 @@ -0,0 +1 @@ +3bcc2db64f7b0ebacba552aff319b41962c2df96 \ No newline at end of file diff --git a/common/licenses/netty-resolver-4.1.33.Final.jar.sha1 b/common/licenses/netty-resolver-4.1.33.Final.jar.sha1 new file mode 100644 index 0000000..3b12aa7 --- /dev/null +++ b/common/licenses/netty-resolver-4.1.33.Final.jar.sha1 @@ -0,0 +1 @@ +f3873f5ed509b5c169fb7cbaf34b694d8c748926 \ No newline at end of file diff --git a/common/licenses/netty-transport-4.1.33.Final.jar.sha1 b/common/licenses/netty-transport-4.1.33.Final.jar.sha1 new file mode 100644 index 0000000..fdad609 --- /dev/null +++ b/common/licenses/netty-transport-4.1.33.Final.jar.sha1 @@ -0,0 +1 @@ +b9f9af72dfcd8464c16169670d52c6dc5fe65897 \ No newline at end of file diff --git a/common/licenses/noggit-6.3.2.1.jar.sha1 b/common/licenses/noggit-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..ac01817 --- /dev/null +++ b/common/licenses/noggit-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +fe9c516ca4ead60f713eceb398e6f636b83d0a5b \ No newline at end of file diff --git a/common/licenses/s2geo-6.3.2.1.jar.sha1 b/common/licenses/s2geo-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..2ec741a --- /dev/null +++ b/common/licenses/s2geo-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +b1bd19c1f50b6764f104cdcbfa3f01b1b3bb2045 \ No newline at end of file diff --git a/common/licenses/securesm-6.3.2.1.jar.sha1 b/common/licenses/securesm-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..9632107 --- /dev/null +++ b/common/licenses/securesm-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +ce2c501f3c72eb1099467d708b9c134ed0b7bb2a \ No newline at end of file diff --git a/common/licenses/snakeyaml-6.3.2.1.jar.sha1 b/common/licenses/snakeyaml-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..2f3cc62 --- /dev/null +++ b/common/licenses/snakeyaml-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +62a48b60b17e6d2a823439a5e68f31ef196f11e7 \ No newline at end of file diff --git a/common/licenses/spatial4j-6.3.2.1.jar.sha1 b/common/licenses/spatial4j-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..5c26ca0 --- /dev/null +++ b/common/licenses/spatial4j-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +02855ff60b4cecf9dd15e6e91e3cc0902d2e7eac \ No newline at end of file diff --git a/common/licenses/tdigest-6.3.2.1.jar.sha1 b/common/licenses/tdigest-6.3.2.1.jar.sha1 new file mode 100644 index 0000000..9ae2373 --- /dev/null +++ b/common/licenses/tdigest-6.3.2.1.jar.sha1 @@ -0,0 +1 @@ +9d28517afc71abe5b7f224944280d5f03ed2f2cc \ No newline at end of file diff --git a/common/src/main/java/org/xbib/elasticsearch/client/AbstractClient.java b/common/src/main/java/org/xbib/elasticsearch/client/AbstractClient.java index 79a9336..6db0452 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/AbstractClient.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/AbstractClient.java @@ -80,9 +80,6 @@ import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * - */ public abstract class AbstractClient implements ClientMethods { private static final Logger logger = LogManager.getLogger(AbstractClient.class.getName()); @@ -109,9 +106,9 @@ public abstract class AbstractClient implements ClientMethods { protected int maxConcurrentRequests = DEFAULT_MAX_CONCURRENT_REQUESTS; - protected ByteSizeValue maxVolume = DEFAULT_MAX_VOLUME_PER_REQUEST; + protected String maxVolumePerRequest = DEFAULT_MAX_VOLUME_PER_REQUEST; - protected TimeValue flushInterval = DEFAULT_FLUSH_INTERVAL; + protected String flushIngestInterval = DEFAULT_FLUSH_INTERVAL; @Override public AbstractClient init(ElasticsearchClient client, Settings settings, @@ -209,9 +206,9 @@ public abstract class AbstractClient implements ClientMethods { BulkProcessor.Builder builder = BulkProcessor.builder(this.client, listener) .setBulkActions(maxActionsPerRequest) .setConcurrentRequests(maxConcurrentRequests) - .setFlushInterval(flushInterval); - if (maxVolume != null) { - builder.setBulkSize(maxVolume); + .setFlushInterval(TimeValue.parseTimeValue(flushIngestInterval, "flushIngestInterval")); + if (maxVolumePerRequest != null) { + builder.setBulkSize(ByteSizeValue.parseBytesSizeValue(maxVolumePerRequest, "maxVolumePerRequest")); } this.bulkProcessor = builder.build(); } @@ -239,14 +236,14 @@ public abstract class AbstractClient implements ClientMethods { } @Override - public ClientMethods maxVolumePerRequest(ByteSizeValue maxVolume) { - this.maxVolume = maxVolume; + public ClientMethods maxVolumePerRequest(String maxVolumePerRequest) { + this.maxVolumePerRequest = maxVolumePerRequest; return this; } @Override - public ClientMethods flushIngestInterval(TimeValue flushInterval) { - this.flushInterval = flushInterval; + public ClientMethods flushIngestInterval(String flushIngestInterval) { + this.flushIngestInterval = flushIngestInterval; return this; } @@ -538,11 +535,12 @@ public abstract class AbstractClient implements ClientMethods { } @Override - public ClientMethods waitForResponses(TimeValue maxWaitTime) throws InterruptedException, ExecutionException { + public ClientMethods waitForResponses(String maxWaitTime) throws InterruptedException, ExecutionException { if (closed) { throwClose(); } - while (!bulkProcessor.awaitClose(maxWaitTime.getMillis(), TimeUnit.MILLISECONDS)) { + long millis = TimeValue.parseTimeValue(maxWaitTime, "millis").getMillis(); + while (!bulkProcessor.awaitClose(millis, TimeUnit.MILLISECONDS)) { logger.warn("still waiting for responses"); } return this; @@ -571,7 +569,7 @@ public abstract class AbstractClient implements ClientMethods { } @Override - public void waitForCluster(String statusString, TimeValue timeout) throws IOException { + public void waitForCluster(String statusString, String timeout) throws IOException { if (client() == null) { return; } @@ -632,7 +630,7 @@ public abstract class AbstractClient implements ClientMethods { } public int updateReplicaLevel(String index, int level) throws IOException { - waitForCluster("YELLOW", TimeValue.timeValueSeconds(30)); + waitForCluster("YELLOW","30s"); updateIndexSetting(index, "number_of_replicas", level); return waitForRecovery(index); } diff --git a/common/src/main/java/org/xbib/elasticsearch/client/BulkControl.java b/common/src/main/java/org/xbib/elasticsearch/client/BulkControl.java index 5fe6311..fc9c1fd 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/BulkControl.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/BulkControl.java @@ -3,8 +3,6 @@ package org.xbib.elasticsearch.client; import java.util.Map; import java.util.Set; -/** - */ public interface BulkControl { void startBulk(String indexName, long startRefreshInterval, long stopRefreshInterval); diff --git a/common/src/main/java/org/xbib/elasticsearch/client/BulkMetric.java b/common/src/main/java/org/xbib/elasticsearch/client/BulkMetric.java index e7a60d2..8ed03bb 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/BulkMetric.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/BulkMetric.java @@ -3,9 +3,6 @@ package org.xbib.elasticsearch.client; import org.xbib.metrics.Count; import org.xbib.metrics.Metered; -/** - * - */ public interface BulkMetric { Metered getTotalIngest(); diff --git a/common/src/main/java/org/xbib/elasticsearch/client/BulkProcessor.java b/common/src/main/java/org/xbib/elasticsearch/client/BulkProcessor.java index 7de2a3b..59ea5b2 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/BulkProcessor.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/BulkProcessor.java @@ -263,7 +263,7 @@ public class BulkProcessor implements Closeable { /** * Sets the number of concurrent requests allowed to be executed. A value of 0 means that only a single * request will be allowed to be executed. A value of 1 means 1 concurrent request is allowed to be executed - * while accumulating new bulk requests. Defaults to 1. + * while accumulating new bulk requests. Defaults to {@code 1}. * * @param concurrentRequests maximum number of concurrent requests * @return this builder @@ -275,7 +275,7 @@ public class BulkProcessor implements Closeable { /** * Sets when to flush a new bulk request based on the number of actions currently added. Defaults to - * 1000. Can be set to -1 to disable it. + * {@code 1000}. Can be set to {@code -1} to disable it. * * @param bulkActions mbulk actions * @return this builder @@ -287,7 +287,7 @@ public class BulkProcessor implements Closeable { /** * Sets when to flush a new bulk request based on the size of actions currently added. Defaults to - * 5mb. Can be set to -1 to disable it. + * {@code 5mb}. Can be set to {@code -1} to disable it. * * @param bulkSize bulk size * @return this builder @@ -299,8 +299,8 @@ public class BulkProcessor implements Closeable { /** * Sets a flush interval flushing *any* bulk actions pending if the interval passes. Defaults to not set. - * Note, both {@link #setBulkActions(int)} and {@link #setBulkSize(org.elasticsearch.common.unit.ByteSizeValue)} - * can be set to -1 with the flush interval set allowing for complete async processing of bulk actions. + * Note, both {@link #setBulkActions(int)} and {@link #setBulkSize(ByteSizeValue)} + * can be set to {@code -1} with the flush interval set allowing for complete async processing of bulk actions. * * @param flushInterval flush interval * @return this builder diff --git a/common/src/main/java/org/xbib/elasticsearch/client/ClientBuilder.java b/common/src/main/java/org/xbib/elasticsearch/client/ClientBuilder.java index 441c8e2..2865266 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/ClientBuilder.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/ClientBuilder.java @@ -5,14 +5,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.TimeValue; -import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.ServiceLoader; -/** - * - */ public final class ClientBuilder implements Parameters { private final Settings.Builder settingsBuilder; @@ -87,18 +83,18 @@ public final class ClientBuilder implements Parameters { return this; } - public C getClient(Class clientClass) throws IOException { + public C getClient(Class clientClass) { return getClient(null, clientClass); } @SuppressWarnings("unchecked") - public C getClient(Client client, Class clientClass) throws IOException { + public C getClient(Client client, Class clientClass) { Settings settings = settingsBuilder.build(); return (C) clientMethodsMap.get(clientClass) .maxActionsPerRequest(settings.getAsInt(MAX_ACTIONS_PER_REQUEST, DEFAULT_MAX_ACTIONS_PER_REQUEST)) .maxConcurrentRequests(settings.getAsInt(MAX_CONCURRENT_REQUESTS, DEFAULT_MAX_CONCURRENT_REQUESTS)) - .maxVolumePerRequest(settings.getAsBytesSize(MAX_VOLUME_PER_REQUEST, DEFAULT_MAX_VOLUME_PER_REQUEST)) - .flushIngestInterval(settings.getAsTime(FLUSH_INTERVAL, DEFAULT_FLUSH_INTERVAL)) + .maxVolumePerRequest(settings.get(MAX_VOLUME_PER_REQUEST, DEFAULT_MAX_VOLUME_PER_REQUEST)) + .flushIngestInterval(settings.get(FLUSH_INTERVAL, DEFAULT_FLUSH_INTERVAL)) .init(client, settings, metric, control); } } diff --git a/common/src/main/java/org/xbib/elasticsearch/client/ClientMethods.java b/common/src/main/java/org/xbib/elasticsearch/client/ClientMethods.java index df199ce..4057994 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/ClientMethods.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/ClientMethods.java @@ -396,6 +396,7 @@ public interface ClientMethods extends Parameters { /** * Shutdown the ingesting. + * @throws IOException is shutdown fails */ void shutdown() throws IOException; } diff --git a/common/src/main/java/org/xbib/elasticsearch/client/IndexAliasAdder.java b/common/src/main/java/org/xbib/elasticsearch/client/IndexAliasAdder.java index 7c93d22..4c6fbb8 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/IndexAliasAdder.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/IndexAliasAdder.java @@ -2,9 +2,6 @@ package org.xbib.elasticsearch.client; import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequestBuilder; -/** - * - */ @FunctionalInterface public interface IndexAliasAdder { diff --git a/common/src/main/java/org/xbib/elasticsearch/client/NetworkUtils.java b/common/src/main/java/org/xbib/elasticsearch/client/NetworkUtils.java index 847e414..63a6fdf 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/NetworkUtils.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/NetworkUtils.java @@ -16,9 +16,6 @@ import java.util.Enumeration; import java.util.List; import java.util.Locale; -/** - * - */ public class NetworkUtils { private static final Logger logger = LogManager.getLogger(NetworkUtils.class.getName()); @@ -253,9 +250,6 @@ public class NetworkUtils { return left.length - right.length; } - /** - * - */ public enum ProtocolVersion { IPV4, IPV6, IPV46, NONE } diff --git a/common/src/main/java/org/xbib/elasticsearch/client/Parameters.java b/common/src/main/java/org/xbib/elasticsearch/client/Parameters.java index a9dd7c8..2146977 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/Parameters.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/Parameters.java @@ -1,13 +1,10 @@ package org.xbib.elasticsearch.client; -/** - * - */ public interface Parameters { int DEFAULT_MAX_ACTIONS_PER_REQUEST = 1000; - int DEFAULT_MAX_CONCURRENT_REQUESTS = Runtime.getRuntime().availableProcessors() * 4; + int DEFAULT_MAX_CONCURRENT_REQUESTS = Runtime.getRuntime().availableProcessors(); String DEFAULT_MAX_VOLUME_PER_REQUEST = "10mb"; diff --git a/common/src/main/java/org/xbib/elasticsearch/client/SimpleBulkControl.java b/common/src/main/java/org/xbib/elasticsearch/client/SimpleBulkControl.java index b8257f7..c12ecc1 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/SimpleBulkControl.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/SimpleBulkControl.java @@ -5,8 +5,6 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -/** - */ public class SimpleBulkControl implements BulkControl { private final Set indexNames = new HashSet<>(); diff --git a/common/src/main/java/org/xbib/elasticsearch/client/SimpleBulkMetric.java b/common/src/main/java/org/xbib/elasticsearch/client/SimpleBulkMetric.java index 9b82444..1a181cb 100644 --- a/common/src/main/java/org/xbib/elasticsearch/client/SimpleBulkMetric.java +++ b/common/src/main/java/org/xbib/elasticsearch/client/SimpleBulkMetric.java @@ -8,9 +8,6 @@ import org.xbib.metrics.Metered; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; -/** - * - */ public class SimpleBulkMetric implements BulkMetric { private final ScheduledExecutorService executorService; diff --git a/common/src/test/java/org/xbib/elasticsearch/client/common/AliasTests.java b/common/src/test/java/org/xbib/elasticsearch/client/common/AliasTests.java index 37db0de..e0ef8d5 100644 --- a/common/src/test/java/org/xbib/elasticsearch/client/common/AliasTests.java +++ b/common/src/test/java/org/xbib/elasticsearch/client/common/AliasTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequestBuilder import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.common.Strings; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; import java.util.Collections; import java.util.Iterator; diff --git a/common/src/test/java/org/xbib/elasticsearch/client/common/SearchTests.java b/common/src/test/java/org/xbib/elasticsearch/client/common/SearchTests.java index 09771c5..bd1c16d 100644 --- a/common/src/test/java/org/xbib/elasticsearch/client/common/SearchTests.java +++ b/common/src/test/java/org/xbib/elasticsearch/client/common/SearchTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.sort.SortOrder; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; public class SearchTests extends ESSingleNodeTestCase { diff --git a/common/src/test/java/org/xbib/elasticsearch/client/common/SimpleTests.java b/common/src/test/java/org/xbib/elasticsearch/client/common/SimpleTests.java index 8b89df6..6e2dd8a 100644 --- a/common/src/test/java/org/xbib/elasticsearch/client/common/SimpleTests.java +++ b/common/src/test/java/org/xbib/elasticsearch/client/common/SimpleTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; public class SimpleTests extends ESSingleNodeTestCase { diff --git a/common/src/test/java/org/xbib/elasticsearch/client/common/WildcardTests.java b/common/src/test/java/org/xbib/elasticsearch/client/common/WildcardTests.java index bb84bb9..aeade4b 100644 --- a/common/src/test/java/org/xbib/elasticsearch/client/common/WildcardTests.java +++ b/common/src/test/java/org/xbib/elasticsearch/client/common/WildcardTests.java @@ -5,7 +5,7 @@ import org.elasticsearch.client.Requests; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; import java.io.IOException; diff --git a/gradle.properties b/gradle.properties index 24bd424..d3e6671 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,15 +6,15 @@ release = 0 elasticsearch.version = 6.3.2 lucene.version = 7.3.1 - -netty.version = 4.1.29.Final tcnative.version = 2.0.15.Final alpnagent.version = 2.0.7 -xbib-netty-http-client.version = 4.1.29.0 +netty.version = 4.1.33.Final +netty-http.version = 4.1.33.0 xbib-metrics.version = 1.1.0 -# elasticsearch build plugin elasticsearch-libs.version = 6.3.2.1 +elasticsearch-server.version = 6.3.2.1 +elasticsearch-client.version = 6.3.2.1 elasticsearch-devkit.version = 6.3.2.4 spatial4j.version = 0.7 jts.version = 1.15.1 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 51288f9..87b738c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6b3851a..0bcaeeb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Fri Feb 15 10:39:20 CET 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip diff --git a/gradlew b/gradlew index 2c74879..af6708f 100755 --- a/gradlew +++ b/gradlew @@ -155,11 +155,7 @@ if $cygwin ; then fi # Escape application args -<<<<<<< HEAD -save ( ) { -======= save () { ->>>>>>> 6.3 for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } diff --git a/http/build.gradle b/http/build.gradle index f5d73a1..a9a5f98 100644 --- a/http/build.gradle +++ b/http/build.gradle @@ -19,7 +19,8 @@ configurations { dependencies { compile project(':common') - compile "org.xbib:netty-http-client:${project.property('xbib-netty-http-client.version')}" + compile "org.xbib:netty-http-client:${project.property('netty-http.version')}" + compile "org.xbib.elasticsearch:transport-netty4:${project.property('elasticsearch-server.version')}" testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}" testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}" } @@ -56,10 +57,10 @@ randomizedTest { esTest { enabled = true + dependsOn jar, testJar // test with the jars, not the classes, for security manager // classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files systemProperty 'tests.security.manager', 'true' - // maybe we like some extra security policy for our code + // some extra security policy for our code systemProperty 'tests.security.policy', '/extra-security.policy' } -esTest.dependsOn jar, testJar diff --git a/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientAliasTests.java b/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientAliasTests.java index 09bff1b..f683183 100644 --- a/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientAliasTests.java +++ b/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientAliasTests.java @@ -9,10 +9,9 @@ import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; import org.elasticsearch.transport.Netty4Plugin; import org.junit.Before; import org.xbib.elasticsearch.client.ClientBuilder; @@ -98,7 +97,7 @@ public class HttpClientAliasTests extends ESSingleNodeTestCase { } catch (NoNodeAvailableException e) { logger.warn("skipping, no node available"); } finally { - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); client.shutdown(); if (client.hasThrowable()) { logger.error("error", client.getThrowable()); diff --git a/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientDuplicateIDTests.java b/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientDuplicateIDTests.java index 456926a..e44d004 100644 --- a/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientDuplicateIDTests.java +++ b/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientDuplicateIDTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; import org.elasticsearch.transport.Netty4Plugin; import org.junit.Before; import org.xbib.elasticsearch.client.ClientBuilder; @@ -73,7 +73,7 @@ public class HttpClientDuplicateIDTests extends ESSingleNodeTestCase { client.index("test", "test", randomAlphaOfLength(1), false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); client.refreshIndex("test"); SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client.client(), SearchAction.INSTANCE) .setIndices("test") diff --git a/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientReplicaTests.java b/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientReplicaTests.java index fc036af..32069be 100644 --- a/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientReplicaTests.java +++ b/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientReplicaTests.java @@ -16,12 +16,11 @@ import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.shard.IndexingStats; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.testframework.ESIntegTestCase; import org.elasticsearch.transport.Netty4Plugin; import org.junit.Before; import org.xbib.elasticsearch.client.ClientBuilder; @@ -87,7 +86,7 @@ public class HttpClientReplicaTests extends ESIntegTestCase { try { client.newIndex("test1", settingsTest1, null) .newIndex("test2", settingsTest2, null); - client.waitForCluster("GREEN", TimeValue.timeValueSeconds(30)); + client.waitForCluster("GREEN", "30s"); for (int i = 0; i < 1234; i++) { client.index("test1", "test", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } @@ -95,7 +94,7 @@ public class HttpClientReplicaTests extends ESIntegTestCase { client.index("test2", "test", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(60)); + client.waitForResponses("60s"); } catch (NoNodeAvailableException e) { logger.warn("skipping, no node available"); } finally { diff --git a/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientTests.java b/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientTests.java index f64999d..6672e3c 100644 --- a/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientTests.java +++ b/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; import org.elasticsearch.transport.Netty4Plugin; import org.junit.Before; import org.xbib.elasticsearch.client.ClientBuilder; diff --git a/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientUpdateReplicaLevelTests.java b/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientUpdateReplicaLevelTests.java index db0f894..d023203 100644 --- a/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientUpdateReplicaLevelTests.java +++ b/http/src/test/java/org/xbib/elasticsearch/client/http/HttpClientUpdateReplicaLevelTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.testframework.ESIntegTestCase; import org.elasticsearch.transport.Netty4Plugin; import org.junit.Before; import org.xbib.elasticsearch.client.ClientBuilder; @@ -75,12 +75,12 @@ public class HttpClientUpdateReplicaLevelTests extends ESIntegTestCase { try { client.newIndex("replicatest", settings, null); - client.waitForCluster("GREEN", TimeValue.timeValueSeconds(30)); + client.waitForCluster("GREEN", "30s"); for (int i = 0; i < 12345; i++) { client.index("replicatest", "replicatest", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); shardsAfterReplica = client.updateReplicaLevel("replicatest", replicaLevel); assertEquals(shardsAfterReplica, numberOfShards * (replicaLevel + 1)); } catch (NoNodeAvailableException e) { diff --git a/http/src/test/java/org/xbib/elasticsearch/client/http/IndexCreationTest.java b/http/src/test/java/org/xbib/elasticsearch/client/http/IndexCreationTest.java index db768be..436b7c3 100644 --- a/http/src/test/java/org/xbib/elasticsearch/client/http/IndexCreationTest.java +++ b/http/src/test/java/org/xbib/elasticsearch/client/http/IndexCreationTest.java @@ -13,11 +13,13 @@ import java.util.logging.SimpleFormatter; public class IndexCreationTest { private static final Logger logger = Logger.getLogger(IndexCreationTest.class.getName()); + static { //System.setProperty("io.netty.leakDetection.level", "paranoid"); System.setProperty("io.netty.noKeySetOptimization", Boolean.toString(true)); System.setProperty("log4j2.disable.jmx", Boolean.toString(true)); + // enforce massive logging to the console System.setProperty("java.util.logging.SimpleFormatter.format", "%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s [%3$s] %5$s %6$s%n"); LogManager.getLogManager().reset(); diff --git a/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientDuplicateIDTests.java b/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientDuplicateIDTests.java index 5681d63..aceb7ac 100644 --- a/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientDuplicateIDTests.java +++ b/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientDuplicateIDTests.java @@ -6,8 +6,7 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.action.search.SearchAction; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.client.transport.NoNodeAvailableException; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; import org.xbib.elasticsearch.client.ClientBuilder; import org.xbib.elasticsearch.client.SimpleBulkControl; import org.xbib.elasticsearch.client.SimpleBulkMetric; @@ -36,7 +35,7 @@ public class NodeBulkClientDuplicateIDTests extends ESSingleNodeTestCase { client.index("test", "test", randomAlphaOfLength(1), false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); client.refreshIndex("test"); SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client.client(), SearchAction.INSTANCE) .setIndices("test") diff --git a/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientIndexAliasTests.java b/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientIndexAliasTests.java index 7f36794..603c34a 100644 --- a/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientIndexAliasTests.java +++ b/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientIndexAliasTests.java @@ -5,9 +5,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequestBuilder; import org.elasticsearch.client.transport.NoNodeAvailableException; -import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; import org.xbib.elasticsearch.client.ClientBuilder; import org.xbib.elasticsearch.client.IndexAliasAdder; import org.xbib.elasticsearch.client.SimpleBulkControl; @@ -61,7 +60,7 @@ public class NodeBulkClientIndexAliasTests extends ESSingleNodeTestCase { } catch (NoNodeAvailableException e) { logger.warn("skipping, no node available"); } finally { - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); client.shutdown(); if (client.hasThrowable()) { logger.error("error", client.getThrowable()); diff --git a/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientReplicaTests.java b/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientReplicaTests.java index c8e6186..3f167d2 100644 --- a/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientReplicaTests.java +++ b/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientReplicaTests.java @@ -13,10 +13,9 @@ import org.elasticsearch.action.search.SearchAction; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.shard.IndexingStats; -import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.testframework.ESIntegTestCase; import org.xbib.elasticsearch.client.ClientBuilder; import org.xbib.elasticsearch.client.SimpleBulkControl; import org.xbib.elasticsearch.client.SimpleBulkMetric; @@ -49,7 +48,7 @@ public class NodeBulkClientReplicaTests extends ESIntegTestCase { try { client.newIndex("test1", settingsTest1, null) .newIndex("test2", settingsTest2, null); - client.waitForCluster("GREEN", TimeValue.timeValueSeconds(30)); + client.waitForCluster("GREEN", "30s"); for (int i = 0; i < 1234; i++) { client.index("test1", "test", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } @@ -57,7 +56,7 @@ public class NodeBulkClientReplicaTests extends ESIntegTestCase { client.index("test2", "test", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(60)); + client.waitForResponses("60s"); } catch (NoNodeAvailableException e) { logger.warn("skipping, no node available"); } finally { diff --git a/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientTests.java b/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientTests.java index 6b261df..801016c 100644 --- a/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientTests.java +++ b/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientTests.java @@ -9,11 +9,12 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.action.search.SearchAction; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.client.transport.NoNodeAvailableException; +import org.elasticsearch.common.Strings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; import org.xbib.elasticsearch.client.ClientBuilder; import org.xbib.elasticsearch.client.SimpleBulkControl; import org.xbib.elasticsearch.client.SimpleBulkMetric; @@ -62,7 +63,7 @@ public class NodeBulkClientTests extends ESSingleNodeTestCase { .endObject() .endObject() .endObject(); - client.mapping("test", builder.string()); + client.mapping("test", Strings.toString(builder)); client.newIndex("test"); GetMappingsRequest getMappingsRequest = new GetMappingsRequest().indices("test"); GetMappingsResponse getMappingsResponse = @@ -85,7 +86,7 @@ public class NodeBulkClientTests extends ESSingleNodeTestCase { client.newIndex("test"); client.index("test", "test", "1", false, "{ \"name\" : \"Hello World\"}"); // single doc ingest client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); assertEquals(1, client.getMetric().getSucceeded().getCount()); if (client.hasThrowable()) { logger.error("error", client.getThrowable()); @@ -108,7 +109,7 @@ public class NodeBulkClientTests extends ESSingleNodeTestCase { client.index("test", "test", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); } catch (NoNodeAvailableException e) { logger.warn("skipping, no node available"); } finally { @@ -149,7 +150,7 @@ public class NodeBulkClientTests extends ESSingleNodeTestCase { latch.await(30, TimeUnit.SECONDS); logger.info("flush..."); client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); logger.info("got all responses, executor service shutdown..."); executorService.shutdown(); logger.info("executor service is shut down"); diff --git a/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientUpdateReplicaLevelTests.java b/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientUpdateReplicaLevelTests.java index 97ab80d..58c1f4e 100644 --- a/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientUpdateReplicaLevelTests.java +++ b/node/src/test/java/org/xbib/elasticsearch/client/node/NodeBulkClientUpdateReplicaLevelTests.java @@ -5,8 +5,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.testframework.ESIntegTestCase; import org.xbib.elasticsearch.client.ClientBuilder; import org.xbib.elasticsearch.client.SimpleBulkControl; import org.xbib.elasticsearch.client.SimpleBulkMetric; @@ -36,12 +35,12 @@ public class NodeBulkClientUpdateReplicaLevelTests extends ESIntegTestCase { try { client.newIndex("replicatest", settings, null); - client.waitForCluster("GREEN", TimeValue.timeValueSeconds(30)); + client.waitForCluster("GREEN", "30s"); for (int i = 0; i < 12345; i++) { client.index("replicatest", "replicatest", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); shardsAfterReplica = client.updateReplicaLevel("replicatest", replicaLevel); assertEquals(shardsAfterReplica, numberOfShards * (replicaLevel + 1)); } catch (NoNodeAvailableException e) { diff --git a/transport/build.gradle b/transport/build.gradle index 582d3ec..2d2eb74 100644 --- a/transport/build.gradle +++ b/transport/build.gradle @@ -19,6 +19,7 @@ configurations { dependencies { compile project(':common') + compile "org.xbib.elasticsearch:transport-netty4:${project.property('elasticsearch-server.version')}" testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}" testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}" } @@ -56,7 +57,7 @@ randomizedTest { test { enabled = false - jvmArgs "-javaagent:" + configurations.alpnagent.asPath + //jvmArgs "-javaagent:" + configurations.alpnagent.asPath systemProperty 'path.home', projectDir.absolutePath testLogging { showStandardStreams = true diff --git a/transport/src/main/java/org/xbib/elasticsearch/client/transport/MockTransportBulkClient.java b/transport/src/main/java/org/xbib/elasticsearch/client/transport/MockTransportBulkClient.java index 04321a8..38c689d 100644 --- a/transport/src/main/java/org/xbib/elasticsearch/client/transport/MockTransportBulkClient.java +++ b/transport/src/main/java/org/xbib/elasticsearch/client/transport/MockTransportBulkClient.java @@ -5,8 +5,6 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.unit.TimeValue; import org.xbib.elasticsearch.client.BulkControl; import org.xbib.elasticsearch.client.BulkMetric; @@ -40,12 +38,12 @@ public class MockTransportBulkClient extends TransportBulkClient { } @Override - public MockTransportBulkClient maxVolumePerRequest(ByteSizeValue maxVolumePerRequest) { + public MockTransportBulkClient maxVolumePerRequest(String maxVolumePerRequest) { return this; } @Override - public MockTransportBulkClient flushIngestInterval(TimeValue interval) { + public MockTransportBulkClient flushIngestInterval(String interval) { return this; } @@ -85,7 +83,7 @@ public class MockTransportBulkClient extends TransportBulkClient { } @Override - public MockTransportBulkClient waitForResponses(TimeValue timeValue) throws InterruptedException { + public MockTransportBulkClient waitForResponses(String timeValue) throws InterruptedException { return this; } @@ -130,7 +128,7 @@ public class MockTransportBulkClient extends TransportBulkClient { } @Override - public void waitForCluster(String healthColor, TimeValue timeValue) throws IOException { + public void waitForCluster(String healthColor, String timeValue) throws IOException { // mockup method } diff --git a/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientDuplicateIDTests.java b/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientDuplicateIDTests.java index 52bb8df..7fbb20e 100644 --- a/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientDuplicateIDTests.java +++ b/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientDuplicateIDTests.java @@ -13,10 +13,9 @@ import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; import org.elasticsearch.transport.Netty4Plugin; import org.junit.Before; import org.xbib.elasticsearch.client.ClientBuilder; @@ -79,7 +78,7 @@ public class TransportBulkClientDuplicateIDTests extends ESSingleNodeTestCase { client.index("test", "test", randomAlphaOfLength(1), false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); client.refreshIndex("test"); SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client.client(), SearchAction.INSTANCE) .setIndices("test") diff --git a/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientReplicaTests.java b/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientReplicaTests.java index 7168304..60a97ab 100644 --- a/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientReplicaTests.java +++ b/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientReplicaTests.java @@ -18,10 +18,9 @@ import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.index.shard.IndexingStats; -import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.testframework.ESIntegTestCase; import org.junit.Before; import org.xbib.elasticsearch.client.ClientBuilder; import org.xbib.elasticsearch.client.SimpleBulkControl; @@ -76,7 +75,7 @@ public class TransportBulkClientReplicaTests extends ESIntegTestCase { try { client.newIndex("test1", settingsTest1, null) .newIndex("test2", settingsTest2, null); - client.waitForCluster("GREEN", TimeValue.timeValueSeconds(30)); + client.waitForCluster("GREEN", "30s"); for (int i = 0; i < 1234; i++) { client.index("test1", "test", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } @@ -84,7 +83,7 @@ public class TransportBulkClientReplicaTests extends ESIntegTestCase { client.index("test2", "test", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(60)); + client.waitForResponses("60s"); } catch (NoNodeAvailableException e) { logger.warn("skipping, no node available"); } finally { diff --git a/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientTests.java b/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientTests.java index 5b9375e..b9e22bb 100644 --- a/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientTests.java +++ b/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientTests.java @@ -11,6 +11,7 @@ import org.elasticsearch.action.search.SearchAction; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.cluster.ClusterName; +import org.elasticsearch.common.Strings; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; @@ -20,7 +21,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.testframework.ESSingleNodeTestCase; import org.elasticsearch.transport.Netty4Plugin; import org.junit.Before; import org.xbib.elasticsearch.client.ClientBuilder; @@ -123,7 +124,7 @@ public class TransportBulkClientTests extends ESSingleNodeTestCase { .endObject() .endObject() .endObject(); - client.mapping("test", builder.string()); + client.mapping("test", Strings.toString(builder)); client.newIndex("test"); GetMappingsRequest getMappingsRequest = new GetMappingsRequest().indices("test"); GetMappingsResponse getMappingsResponse = @@ -153,7 +154,7 @@ public class TransportBulkClientTests extends ESSingleNodeTestCase { logger.info("flush"); client.flushIngest(); logger.info("wait for responses"); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); logger.info("waited for responses"); } catch (InterruptedException e) { // ignore @@ -186,7 +187,7 @@ public class TransportBulkClientTests extends ESSingleNodeTestCase { client.index("test", "test", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); } catch (NoNodeAvailableException e) { logger.warn("skipping, no node available"); } finally { @@ -228,7 +229,7 @@ public class TransportBulkClientTests extends ESSingleNodeTestCase { latch.await(30, TimeUnit.SECONDS); logger.info("client flush ..."); client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); logger.info("executor service to be shut down ..."); executorService.shutdown(); logger.info("executor service is shut down"); diff --git a/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientUpdateReplicaLevelTests.java b/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientUpdateReplicaLevelTests.java index d47ba30..37fc4be 100644 --- a/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientUpdateReplicaLevelTests.java +++ b/transport/src/test/java/org/xbib/elasticsearch/client/transport/TransportBulkClientUpdateReplicaLevelTests.java @@ -8,9 +8,8 @@ import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.testframework.ESIntegTestCase; import org.junit.Before; import org.xbib.elasticsearch.client.ClientBuilder; import org.xbib.elasticsearch.client.SimpleBulkControl; @@ -60,12 +59,12 @@ public class TransportBulkClientUpdateReplicaLevelTests extends ESIntegTestCase try { client.newIndex("replicatest", settings, null); - client.waitForCluster("GREEN", TimeValue.timeValueSeconds(30)); + client.waitForCluster("GREEN", "30s"); for (int i = 0; i < 12345; i++) { client.index("replicatest", "replicatest", null, false, "{ \"name\" : \"" + randomAlphaOfLength(32) + "\"}"); } client.flushIngest(); - client.waitForResponses(TimeValue.timeValueSeconds(30)); + client.waitForResponses("30s"); shardsAfterReplica = client.updateReplicaLevel("replicatest", 3); assertEquals(shardsAfterReplica, 2 * (3 + 1)); } catch (NoNodeAvailableException e) {