From 38805f3cbd2445e57e2bebf3dc8922891a45e8f6 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Sun, 30 Aug 2015 23:56:34 +0500 Subject: [PATCH 01/40] Fix 13202 --- .../index/indexing/IndexingOperationListener.java | 7 +++++++ .../elasticsearch/index/indexing/ShardIndexingService.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/core/src/main/java/org/elasticsearch/index/indexing/IndexingOperationListener.java b/core/src/main/java/org/elasticsearch/index/indexing/IndexingOperationListener.java index 8b95e0f132b..ba968172c98 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/IndexingOperationListener.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/IndexingOperationListener.java @@ -73,6 +73,13 @@ public abstract class IndexingOperationListener { } + /** + * Called after the indexing operation occurred with exception. + */ + public void postIndex(Engine.Index index, Throwable ex) { + + } + /** * Called before the delete occurs. */ diff --git a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java index 2109eafaaed..303c338184e 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java @@ -171,6 +171,13 @@ public class ShardIndexingService extends AbstractIndexShardComponent { public void postIndex(Engine.Index index, Throwable ex) { totalStats.indexCurrent.dec(); typeStats(index.type()).indexCurrent.dec(); + for (IndexingOperationListener listener : listeners) { + try { + listener.postIndex(index, ex); + } catch (Exception e) { + logger.warn("post listener [{}] failed", e, listener); + } + } } public Engine.Delete preDelete(Engine.Delete delete) { From 2fe2c7fef87aff15e14943a3b07235bd6d6da851 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Tue, 1 Sep 2015 12:45:40 +0500 Subject: [PATCH 02/40] Add listeners to postCreate etc --- .../indexing/IndexingOperationListener.java | 16 ++++++- .../index/indexing/ShardIndexingService.java | 45 +++++++++++++++---- 2 files changed, 51 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/indexing/IndexingOperationListener.java b/core/src/main/java/org/elasticsearch/index/indexing/IndexingOperationListener.java index ba968172c98..bb4c109e6af 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/IndexingOperationListener.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/IndexingOperationListener.java @@ -43,12 +43,19 @@ public abstract class IndexingOperationListener { } /** - * Called after the indexing operation occurred. + * Called after create index operation occurred. */ public void postCreate(Engine.Create create) { } + /** + * Called after create index operation occurred with exception. + */ + public void postCreate(Engine.Create create, Throwable ex) { + + } + /** * Called before the indexing occurs. */ @@ -103,4 +110,11 @@ public abstract class IndexingOperationListener { public void postDelete(Engine.Delete delete) { } + + /** + * Called after the delete operation occurred with exception. + */ + public void postDelete(Engine.Delete delete, Throwable ex) { + + } } diff --git a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java index 303c338184e..dd2e43fcc83 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java @@ -89,7 +89,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { totalStats.indexCurrent.inc(); typeStats(create.type()).indexCurrent.inc(); for (IndexingOperationListener listener : listeners) { - create = listener.preCreate(create); + try { + create = listener.preCreate(create); + } catch (Exception e) { + logger.warn("preCreate listener [{}] failed", e, listener); + } } return create; } @@ -124,19 +128,31 @@ public class ShardIndexingService extends AbstractIndexShardComponent { try { listener.postCreate(create); } catch (Exception e) { - logger.warn("post listener [{}] failed", e, listener); + logger.warn("postCreate listener [{}] failed", e, listener); } } } public void postCreate(Engine.Create create, Throwable ex) { + for (IndexingOperationListener listener : listeners) { + try { + listener.postCreate(create, ex); + } catch (Exception e) { + logger.warn("postCreate listener [{}] failed", e, listener); + } + } } public Engine.Index preIndex(Engine.Index index) { totalStats.indexCurrent.inc(); typeStats(index.type()).indexCurrent.inc(); for (IndexingOperationListener listener : listeners) { - index = listener.preIndex(index); + try { + listener.preIndex(index); + } catch (Exception e) { + logger.warn("preIndex listener [{}] failed", e, listener); + } + } return index; } @@ -146,7 +162,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent { try { listener.postIndexUnderLock(index); } catch (Exception e) { - logger.warn("post listener [{}] failed", e, listener); + logger.warn("postIndexUnderLock listener [{}] failed", e, listener); } } } @@ -163,7 +179,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent { try { listener.postIndex(index); } catch (Exception e) { - logger.warn("post listener [{}] failed", e, listener); + logger.warn("postIndex listener [{}] failed", e, listener); } } } @@ -175,7 +191,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent { try { listener.postIndex(index, ex); } catch (Exception e) { - logger.warn("post listener [{}] failed", e, listener); + logger.warn("postIndex listener [{}] failed", e, listener); } } } @@ -184,7 +200,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { totalStats.deleteCurrent.inc(); typeStats(delete.type()).deleteCurrent.inc(); for (IndexingOperationListener listener : listeners) { - delete = listener.preDelete(delete); + try { + delete = listener.preDelete(delete); + } catch (Exception e) { + logger.warn("preDelete listener [{}] failed", e, listener); + } } return delete; } @@ -194,7 +214,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent { try { listener.postDeleteUnderLock(delete); } catch (Exception e) { - logger.warn("post listener [{}] failed", e, listener); + logger.warn("postDeleteUnderLock listener [{}] failed", e, listener); } } } @@ -210,7 +230,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent { try { listener.postDelete(delete); } catch (Exception e) { - logger.warn("post listener [{}] failed", e, listener); + logger.warn("postDelete listener [{}] failed", e, listener); } } } @@ -218,6 +238,13 @@ public class ShardIndexingService extends AbstractIndexShardComponent { public void postDelete(Engine.Delete delete, Throwable ex) { totalStats.deleteCurrent.dec(); typeStats(delete.type()).deleteCurrent.dec(); + for (IndexingOperationListener listener : listeners) { + try { + listener.postDelete(delete, ex); + } catch (Exception e) { + logger.warn("postDelete listener [{}] failed", e, listener); + } + } } public void noopUpdate(String type) { From 5e385d5bf2a99036906eb4f2fe987e83b5bfbc98 Mon Sep 17 00:00:00 2001 From: Shane Connelly Date: Tue, 1 Sep 2015 13:17:07 -0700 Subject: [PATCH 03/40] Fixed non-valid JSON (though ES would accept it) --- .../aggregations/pipeline/bucket-script-aggregation.asciidoc | 2 +- .../aggregations/pipeline/bucket-selector-aggregation.asciidoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/aggregations/pipeline/bucket-script-aggregation.asciidoc b/docs/reference/aggregations/pipeline/bucket-script-aggregation.asciidoc index 72addadaefa..81372c14b1d 100644 --- a/docs/reference/aggregations/pipeline/bucket-script-aggregation.asciidoc +++ b/docs/reference/aggregations/pipeline/bucket-script-aggregation.asciidoc @@ -20,7 +20,7 @@ A `bucket_script` aggregation looks like this in isolation: "my_var1": "the_sum", <1> "my_var2": "the_value_count" }, - script: "my_var1 / my_var2" + "script": "my_var1 / my_var2" } } -------------------------------------------------- diff --git a/docs/reference/aggregations/pipeline/bucket-selector-aggregation.asciidoc b/docs/reference/aggregations/pipeline/bucket-selector-aggregation.asciidoc index 2b838ba45fb..cef1e6716d3 100644 --- a/docs/reference/aggregations/pipeline/bucket-selector-aggregation.asciidoc +++ b/docs/reference/aggregations/pipeline/bucket-selector-aggregation.asciidoc @@ -25,7 +25,7 @@ A `bucket_selector` aggregation looks like this in isolation: "my_var1": "the_sum", <1> "my_var2": "the_value_count" }, - script: "my_var1 > my_var2" + "script": "my_var1 > my_var2" } } -------------------------------------------------- From 8f0ae519397d310429249f42df2e84462206a240 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 13:05:26 +0500 Subject: [PATCH 04/40] preIndex and postIndex listener test --- .../index/shard/IndexShardTests.java | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index 656d251b1bf..c06480b31d7 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -18,7 +18,10 @@ */ package org.elasticsearch.index.shard; +import org.apache.lucene.document.Field; +import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.index.CorruptIndexException; +import org.apache.lucene.index.Term; import org.apache.lucene.store.LockObtainFailedException; import org.apache.lucene.util.Constants; import org.apache.lucene.util.IOUtils; @@ -37,6 +40,7 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.cluster.routing.TestShardRouting; import org.elasticsearch.common.bytes.BytesArray; +import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.logging.ESLogger; @@ -48,6 +52,12 @@ import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.ShardLock; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.engine.Engine; +import org.elasticsearch.index.indexing.IndexingOperationListener; +import org.elasticsearch.index.indexing.ShardIndexingService; +import org.elasticsearch.index.mapper.Mapping; +import org.elasticsearch.index.mapper.ParseContext; +import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.index.mapper.internal.UidFieldMapper; import org.elasticsearch.index.query.QueryParsingException; import org.elasticsearch.index.settings.IndexSettingsService; import org.elasticsearch.index.store.Store; @@ -63,6 +73,8 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.Set; import java.util.concurrent.ExecutionException; @@ -584,4 +596,62 @@ public class IndexShardTests extends ESSingleNodeTestCase { assertTrue(xContent.contains(expectedSubSequence)); } + private ParsedDocument testParsedDocument(String uid, String id, String type, String routing, long timestamp, long ttl, ParseContext.Document document, BytesReference source, Mapping mappingUpdate) { + Field uidField = new Field("_uid", uid, UidFieldMapper.Defaults.FIELD_TYPE); + Field versionField = new NumericDocValuesField("_version", 0); + document.add(uidField); + document.add(versionField); + return new ParsedDocument(uidField, versionField, id, type, routing, timestamp, ttl, Arrays.asList(document), source, mappingUpdate); + } + + public void testPreIndex() throws IOException { + createIndex("testpreindex"); + ensureGreen(); + IndicesService indicesService = getInstanceFromNode(IndicesService.class); + IndexService test = indicesService.indexService("testpreindex"); + IndexShard shard = test.shard(0); + ShardIndexingService shardIndexingService = shard.indexingService(); + + final HashMap listenerInfo = new HashMap<>(); + listenerInfo.put("preIndexCalled", false); + + shardIndexingService.addListener(new IndexingOperationListener() { + @Override + public Engine.Index preIndex(Engine.Index index) { + listenerInfo.put("preIndexCalled", true); + return super.preIndex(index); + } + }); + + ParsedDocument doc = testParsedDocument("1", "1", "test", null, -1, -1, new ParseContext.Document(), new BytesArray(new byte[]{1}), null); + Engine.Index index = new Engine.Index(new Term("_uid", "1"), doc); + shard.index(index); + assertTrue(listenerInfo.get("preIndexCalled")); + } + + public void testPostIndex() throws IOException { + createIndex("testpostindex"); + ensureGreen(); + IndicesService indicesService = getInstanceFromNode(IndicesService.class); + IndexService test = indicesService.indexService("testpostindex"); + IndexShard shard = test.shard(0); + ShardIndexingService shardIndexingService = shard.indexingService(); + + final HashMap listenerInfo = new HashMap<>(); + listenerInfo.put("postIndexCalled", false); + + shardIndexingService.addListener(new IndexingOperationListener() { + @Override + public void postIndex(Engine.Index index) { + listenerInfo.put("postIndexCalled", true); + super.postIndex(index); + } + }); + + ParsedDocument doc = testParsedDocument("1", "1", "test", null, -1, -1, new ParseContext.Document(), new BytesArray(new byte[]{1}), null); + Engine.Index index = new Engine.Index(new Term("_uid", "1"), doc); + shard.index(index); + assertTrue(listenerInfo.get("postIndexCalled")); + } + } From 17089992e24cd5419959d7b6c494b376df9f0838 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 13:57:57 +0500 Subject: [PATCH 05/40] testPostIndexWithException listener test --- .../index/shard/IndexShardTests.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index c06480b31d7..b646c9b9ee2 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -654,4 +654,38 @@ public class IndexShardTests extends ESSingleNodeTestCase { assertTrue(listenerInfo.get("postIndexCalled")); } + public void testPostIndexWithException() throws IOException { + createIndex("testpostindexwithexception"); + ensureGreen(); + IndicesService indicesService = getInstanceFromNode(IndicesService.class); + IndexService test = indicesService.indexService("testpostindexwithexception"); + IndexShard shard = test.shard(0); + ShardIndexingService shardIndexingService = shard.indexingService(); + + shard.close("Unexpected close", true); + shard.state = IndexShardState.STARTED; // It will generate exception + + final HashMap listenerInfo = new HashMap<>(); + listenerInfo.put("postIndexWithExceptionCalled", false); + + shardIndexingService.addListener(new IndexingOperationListener() { + @Override + public void postIndex(Engine.Index index, Throwable ex) { + listenerInfo.put("postIndexWithExceptionCalled", true); + super.postIndex(index, ex); + } + }); + + ParsedDocument doc = testParsedDocument("1", "1", "test", null, -1, -1, new ParseContext.Document(), new BytesArray(new byte[]{1}), null); + Engine.Index index = new Engine.Index(new Term("_uid", "1"), doc); + + try { + shard.index(index); + }catch (IllegalIndexShardStateException e){ + + } + + assertTrue(listenerInfo.get("postIndexWithExceptionCalled")); + } + } From dbf42ba2978cc5f57900561d91b763637bdfa996 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 14:46:39 +0500 Subject: [PATCH 06/40] AtomicBoolean --- .../index/shard/IndexShardTests.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index b646c9b9ee2..7947cd47276 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -78,6 +78,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Set; import java.util.concurrent.ExecutionException; +import java.util.concurrent.atomic.AtomicBoolean; import static org.elasticsearch.cluster.metadata.IndexMetaData.EMPTY_PARAMS; import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS; @@ -611,14 +612,12 @@ public class IndexShardTests extends ESSingleNodeTestCase { IndexService test = indicesService.indexService("testpreindex"); IndexShard shard = test.shard(0); ShardIndexingService shardIndexingService = shard.indexingService(); - - final HashMap listenerInfo = new HashMap<>(); - listenerInfo.put("preIndexCalled", false); + final AtomicBoolean preIndexCalled = new AtomicBoolean(false); shardIndexingService.addListener(new IndexingOperationListener() { @Override public Engine.Index preIndex(Engine.Index index) { - listenerInfo.put("preIndexCalled", true); + preIndexCalled.set(true); return super.preIndex(index); } }); @@ -626,7 +625,7 @@ public class IndexShardTests extends ESSingleNodeTestCase { ParsedDocument doc = testParsedDocument("1", "1", "test", null, -1, -1, new ParseContext.Document(), new BytesArray(new byte[]{1}), null); Engine.Index index = new Engine.Index(new Term("_uid", "1"), doc); shard.index(index); - assertTrue(listenerInfo.get("preIndexCalled")); + assertTrue(preIndexCalled.get()); } public void testPostIndex() throws IOException { @@ -636,14 +635,12 @@ public class IndexShardTests extends ESSingleNodeTestCase { IndexService test = indicesService.indexService("testpostindex"); IndexShard shard = test.shard(0); ShardIndexingService shardIndexingService = shard.indexingService(); - - final HashMap listenerInfo = new HashMap<>(); - listenerInfo.put("postIndexCalled", false); + final AtomicBoolean postIndexCalled = new AtomicBoolean(false); shardIndexingService.addListener(new IndexingOperationListener() { @Override public void postIndex(Engine.Index index) { - listenerInfo.put("postIndexCalled", true); + postIndexCalled.set(true); super.postIndex(index); } }); @@ -651,7 +648,7 @@ public class IndexShardTests extends ESSingleNodeTestCase { ParsedDocument doc = testParsedDocument("1", "1", "test", null, -1, -1, new ParseContext.Document(), new BytesArray(new byte[]{1}), null); Engine.Index index = new Engine.Index(new Term("_uid", "1"), doc); shard.index(index); - assertTrue(listenerInfo.get("postIndexCalled")); + assertTrue(postIndexCalled.get()); } public void testPostIndexWithException() throws IOException { @@ -665,13 +662,12 @@ public class IndexShardTests extends ESSingleNodeTestCase { shard.close("Unexpected close", true); shard.state = IndexShardState.STARTED; // It will generate exception - final HashMap listenerInfo = new HashMap<>(); - listenerInfo.put("postIndexWithExceptionCalled", false); + final AtomicBoolean postIndexWithExceptionCalled = new AtomicBoolean(false); shardIndexingService.addListener(new IndexingOperationListener() { @Override public void postIndex(Engine.Index index, Throwable ex) { - listenerInfo.put("postIndexWithExceptionCalled", true); + postIndexWithExceptionCalled.set(true); super.postIndex(index, ex); } }); @@ -681,11 +677,12 @@ public class IndexShardTests extends ESSingleNodeTestCase { try { shard.index(index); + fail(); }catch (IllegalIndexShardStateException e){ } - assertTrue(listenerInfo.get("postIndexWithExceptionCalled")); + assertTrue(postIndexWithExceptionCalled.get()); } } From f11bec071b9c299aeded1030d45fb37c9fcc49c4 Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Tue, 1 Sep 2015 22:12:25 +0200 Subject: [PATCH 07/40] [test] print test start and end of test setup, execution and cleanup --- .../org/elasticsearch/test/ESIntegTestCase.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/test/ESIntegTestCase.java b/core/src/test/java/org/elasticsearch/test/ESIntegTestCase.java index 35dd8cabecb..9fc8f9464c4 100644 --- a/core/src/test/java/org/elasticsearch/test/ESIntegTestCase.java +++ b/core/src/test/java/org/elasticsearch/test/ESIntegTestCase.java @@ -344,7 +344,6 @@ public abstract class ESIntegTestCase extends ESTestCase { cluster().beforeTest(getRandom(), getPerTestTransportClientRatio()); cluster().wipe(); randomIndexTemplate(); - printTestMessage("before"); } catch (OutOfMemoryError e) { if (e.getMessage().contains("unable to create new native thread")) { ESTestCase.printStackDump(logger); @@ -354,7 +353,7 @@ public abstract class ESIntegTestCase extends ESTestCase { } private void printTestMessage(String message) { - if (isSuiteScopedTest(getClass())) { + if (isSuiteScopedTest(getClass()) && (getTestName().equals(""))) { logger.info("[{}]: {} suite", getTestClass().getSimpleName(), message); } else { logger.info("[{}#{}]: {} test", getTestClass().getSimpleName(), getTestName(), message); @@ -593,7 +592,6 @@ public abstract class ESIntegTestCase extends ESTestCase { boolean success = false; try { final Scope currentClusterScope = getCurrentClusterScope(); - printTestMessage("cleaning up after"); clearDisruptionScheme(); try { if (cluster() != null) { @@ -618,7 +616,6 @@ public abstract class ESIntegTestCase extends ESTestCase { clearClusters(); // it is ok to leave persistent / transient cluster state behind if scope is TEST } } - printTestMessage("cleaned up after"); success = true; } finally { if (!success) { @@ -1953,20 +1950,26 @@ public abstract class ESIntegTestCase extends ESTestCase { @Before public final void before() throws Exception { + if (runTestScopeLifecycle()) { + printTestMessage("setup"); beforeInternal(); } + printTestMessage("starting"); } @After public final void after() throws Exception { + printTestMessage("finished"); // Deleting indices is going to clear search contexts implicitely so we // need to check that there are no more in-flight search contexts before // we remove indices super.ensureAllSearchContextsReleased(); if (runTestScopeLifecycle()) { + printTestMessage("cleaning up after"); afterInternal(false); + printTestMessage("cleaned up after"); } } @@ -1974,6 +1977,7 @@ public abstract class ESIntegTestCase extends ESTestCase { public static void afterClass() throws Exception { if (!runTestScopeLifecycle()) { try { + INSTANCE.printTestMessage("cleaning up after"); INSTANCE.afterInternal(true); } finally { INSTANCE = null; @@ -1999,6 +2003,7 @@ public abstract class ESIntegTestCase extends ESTestCase { INSTANCE = (ESIntegTestCase) targetClass.newInstance(); boolean success = false; try { + INSTANCE.printTestMessage("setup"); INSTANCE.beforeInternal(); INSTANCE.setupSuiteScopeCluster(); success = true; From d6bae589c8eb664a33e1096a2466193a876a420a Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 15:09:18 +0500 Subject: [PATCH 08/40] Fail if ex null --- .../java/org/elasticsearch/index/shard/IndexShardTests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index 7947cd47276..bf5eafbdb35 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -667,6 +667,9 @@ public class IndexShardTests extends ESSingleNodeTestCase { shardIndexingService.addListener(new IndexingOperationListener() { @Override public void postIndex(Engine.Index index, Throwable ex) { + if (ex == null){ + fail(); + } postIndexWithExceptionCalled.set(true); super.postIndex(index, ex); } From d33f7dba619dfd6bdb4a6b5d7151c3a656d10aaf Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 16:59:49 +0500 Subject: [PATCH 09/40] assertNotNull --- .../java/org/elasticsearch/index/shard/IndexShardTests.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index bf5eafbdb35..9fc5bbdde09 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -667,9 +667,7 @@ public class IndexShardTests extends ESSingleNodeTestCase { shardIndexingService.addListener(new IndexingOperationListener() { @Override public void postIndex(Engine.Index index, Throwable ex) { - if (ex == null){ - fail(); - } + assertNotNull(ex); postIndexWithExceptionCalled.set(true); super.postIndex(index, ex); } From fd8476dbd728070d67e665cf6ed368d4b5023b0b Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 17:48:37 +0500 Subject: [PATCH 10/40] make more strict --- .../index/indexing/ShardIndexingService.java | 48 ++++--------------- 1 file changed, 8 insertions(+), 40 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java index dd2e43fcc83..436e9186e29 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java @@ -89,22 +89,14 @@ public class ShardIndexingService extends AbstractIndexShardComponent { totalStats.indexCurrent.inc(); typeStats(create.type()).indexCurrent.inc(); for (IndexingOperationListener listener : listeners) { - try { - create = listener.preCreate(create); - } catch (Exception e) { - logger.warn("preCreate listener [{}] failed", e, listener); - } + create = listener.preCreate(create); } return create; } public void postCreateUnderLock(Engine.Create create) { for (IndexingOperationListener listener : listeners) { - try { - listener.postCreateUnderLock(create); - } catch (Exception e) { - logger.warn("post listener [{}] failed", e, listener); - } + listener.postCreateUnderLock(create); } } @@ -125,21 +117,13 @@ public class ShardIndexingService extends AbstractIndexShardComponent { typeStats.indexCurrent.dec(); slowLog.postCreate(create, took); for (IndexingOperationListener listener : listeners) { - try { - listener.postCreate(create); - } catch (Exception e) { - logger.warn("postCreate listener [{}] failed", e, listener); - } + listener.postCreate(create); } } public void postCreate(Engine.Create create, Throwable ex) { for (IndexingOperationListener listener : listeners) { - try { - listener.postCreate(create, ex); - } catch (Exception e) { - logger.warn("postCreate listener [{}] failed", e, listener); - } + listener.postCreate(create, ex); } } @@ -200,22 +184,14 @@ public class ShardIndexingService extends AbstractIndexShardComponent { totalStats.deleteCurrent.inc(); typeStats(delete.type()).deleteCurrent.inc(); for (IndexingOperationListener listener : listeners) { - try { - delete = listener.preDelete(delete); - } catch (Exception e) { - logger.warn("preDelete listener [{}] failed", e, listener); - } + delete = listener.preDelete(delete); } return delete; } public void postDeleteUnderLock(Engine.Delete delete) { for (IndexingOperationListener listener : listeners) { - try { - listener.postDeleteUnderLock(delete); - } catch (Exception e) { - logger.warn("postDeleteUnderLock listener [{}] failed", e, listener); - } + listener.postDeleteUnderLock(delete); } } @@ -227,11 +203,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent { typeStats.deleteMetric.inc(took); typeStats.deleteCurrent.dec(); for (IndexingOperationListener listener : listeners) { - try { - listener.postDelete(delete); - } catch (Exception e) { - logger.warn("postDelete listener [{}] failed", e, listener); - } + listener.postDelete(delete); } } @@ -239,11 +211,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent { totalStats.deleteCurrent.dec(); typeStats(delete.type()).deleteCurrent.dec(); for (IndexingOperationListener listener : listeners) { - try { - listener.postDelete(delete, ex); - } catch (Exception e) { - logger.warn("postDelete listener [{}] failed", e, listener); - } + listener.postDelete(delete, ex); } } From a097375a6fa7be88dfe7728e5916779985ce6222 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 17:59:41 +0500 Subject: [PATCH 11/40] strict listeners --- .../index/indexing/ShardIndexingService.java | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java index 436e9186e29..c470c7b1229 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java @@ -131,23 +131,14 @@ public class ShardIndexingService extends AbstractIndexShardComponent { totalStats.indexCurrent.inc(); typeStats(index.type()).indexCurrent.inc(); for (IndexingOperationListener listener : listeners) { - try { - listener.preIndex(index); - } catch (Exception e) { - logger.warn("preIndex listener [{}] failed", e, listener); - } - + listener.preIndex(index); } return index; } public void postIndexUnderLock(Engine.Index index) { for (IndexingOperationListener listener : listeners) { - try { - listener.postIndexUnderLock(index); - } catch (Exception e) { - logger.warn("postIndexUnderLock listener [{}] failed", e, listener); - } + listener.postIndexUnderLock(index); } } @@ -160,11 +151,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent { typeStats.indexCurrent.dec(); slowLog.postIndex(index, took); for (IndexingOperationListener listener : listeners) { - try { - listener.postIndex(index); - } catch (Exception e) { - logger.warn("postIndex listener [{}] failed", e, listener); - } + listener.postIndex(index); } } From 32b304b43c02073c402ce99e90a3968de3efd057 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 18:02:26 +0500 Subject: [PATCH 12/40] fix skipped variable setting --- .../org/elasticsearch/index/indexing/ShardIndexingService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java index c470c7b1229..c7b06f8bcb3 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java @@ -131,7 +131,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent { totalStats.indexCurrent.inc(); typeStats(index.type()).indexCurrent.inc(); for (IndexingOperationListener listener : listeners) { - listener.preIndex(index); + index = listener.preIndex(index); } return index; } From 30b6a29e0b09c72c1f0be903c8e07d9b3162dcb2 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 18:04:26 +0500 Subject: [PATCH 13/40] remove try in posIndex --- .../elasticsearch/index/indexing/ShardIndexingService.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java index c7b06f8bcb3..b35f6f9284d 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java @@ -159,11 +159,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent { totalStats.indexCurrent.dec(); typeStats(index.type()).indexCurrent.dec(); for (IndexingOperationListener listener : listeners) { - try { - listener.postIndex(index, ex); - } catch (Exception e) { - logger.warn("postIndex listener [{}] failed", e, listener); - } + listener.postIndex(index, ex); } } From 39fad8c37414d0ffb22885fc675d6181d1398dd5 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 18:18:49 +0500 Subject: [PATCH 14/40] try catch in post listeners --- .../index/indexing/ShardIndexingService.java | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java index b35f6f9284d..0dc95b146d4 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java @@ -117,7 +117,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { typeStats.indexCurrent.dec(); slowLog.postCreate(create, took); for (IndexingOperationListener listener : listeners) { - listener.postCreate(create); + try { + listener.postCreate(create); + } catch (Exception e) { + logger.warn("postCreate listener [{}] failed", e, listener); + } } } @@ -138,7 +142,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { public void postIndexUnderLock(Engine.Index index) { for (IndexingOperationListener listener : listeners) { - listener.postIndexUnderLock(index); + try { + listener.postIndexUnderLock(index); + } catch (Exception e) { + logger.warn("postIndexUnderLock listener [{}] failed", e, listener); + } } } @@ -151,7 +159,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { typeStats.indexCurrent.dec(); slowLog.postIndex(index, took); for (IndexingOperationListener listener : listeners) { - listener.postIndex(index); + try { + listener.postIndex(index); + } catch (Exception e) { + logger.warn("postIndex listener [{}] failed", e, listener); + } } } @@ -174,7 +186,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { public void postDeleteUnderLock(Engine.Delete delete) { for (IndexingOperationListener listener : listeners) { - listener.postDeleteUnderLock(delete); + try { + listener.postDeleteUnderLock(delete); + } catch (Exception e) { + logger.warn("postDeleteUnderLock listener [{}] failed", e, listener); + } } } @@ -186,6 +202,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { typeStats.deleteMetric.inc(took); typeStats.deleteCurrent.dec(); for (IndexingOperationListener listener : listeners) { + try { + listener.postDelete(delete); + } catch (Exception e) { + logger.warn("postDelete listener [{}] failed", e, listener); + } listener.postDelete(delete); } } From cddf198c8394862c540a92dd220a6eeed7d1d498 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 18:21:17 +0500 Subject: [PATCH 15/40] postCreateUnderLock try catch listeners --- .../elasticsearch/index/indexing/ShardIndexingService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java index 0dc95b146d4..6045d203ab7 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java @@ -96,7 +96,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { public void postCreateUnderLock(Engine.Create create) { for (IndexingOperationListener listener : listeners) { - listener.postCreateUnderLock(create); + try { + listener.postCreateUnderLock(create); + } catch (Exception e) { + logger.warn("postCreateUnderLock listener [{}] failed", e, listener); + } } } From 0d2675e80bd0eb30338111a0391b91b66c0c48c6 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 18:22:15 +0500 Subject: [PATCH 16/40] fix typo --- .../org/elasticsearch/index/indexing/ShardIndexingService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java index 6045d203ab7..bbdde45c770 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java @@ -211,7 +211,6 @@ public class ShardIndexingService extends AbstractIndexShardComponent { } catch (Exception e) { logger.warn("postDelete listener [{}] failed", e, listener); } - listener.postDelete(delete); } } From 1a8a2c9bc2b03022562a399ec3d911c2ab119c5f Mon Sep 17 00:00:00 2001 From: David Pilato Date: Wed, 2 Sep 2015 11:48:41 +0200 Subject: [PATCH 17/40] [qa] Add smoke test client module This commit adds a new smoke test for testing client as a end Java user. It starts a cluster in `pre-integration-test` phase, then execute the client operations defined as JUnit tests within `integration-test` phase and then stop the external cluster in `post-integration-test` phase. You can also run test classes from your IDE. * Start an external node on your machine with `bin/elasticsearch` (note that you can test Java API regressions if you run an older or newer node version) * Run the JUnit test. By default, it will run tests on `localhost:9300` but you can change this setting using system property `tests.cluster`. It also expects the default `cluster.name` (`elasticsearch`). This commit also starts adding [snippets as defined by Maven](https://maven.apache.org/guides/mini/guide-snippet-macro.html) to help keeping automatically synchronized the Java reference guide with the current code. Our documentation builder tool does not support snippets though but we will most likely support it at some point. --- .../main/resources/ant/integration-tests.xml | 5 + qa/pom.xml | 1 + qa/smoke-test-client/pom.xml | 130 +++++++++++++ .../smoketest/ESSmokeClientTestCase.java | 173 ++++++++++++++++++ .../smoketest/SmokeTestClientIT.java | 68 +++++++ 5 files changed, 377 insertions(+) create mode 100644 qa/smoke-test-client/pom.xml create mode 100644 qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java create mode 100644 qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/SmokeTestClientIT.java diff --git a/dev-tools/src/main/resources/ant/integration-tests.xml b/dev-tools/src/main/resources/ant/integration-tests.xml index 9c8df5d4c8f..23df37338de 100644 --- a/dev-tools/src/main/resources/ant/integration-tests.xml +++ b/dev-tools/src/main/resources/ant/integration-tests.xml @@ -297,6 +297,11 @@ + + + + + diff --git a/qa/pom.xml b/qa/pom.xml index f8b1f38f6bd..a3ac686cee0 100644 --- a/qa/pom.xml +++ b/qa/pom.xml @@ -147,6 +147,7 @@ smoke-test-plugins smoke-test-multinode + smoke-test-client diff --git a/qa/smoke-test-client/pom.xml b/qa/smoke-test-client/pom.xml new file mode 100644 index 00000000000..1daec63add0 --- /dev/null +++ b/qa/smoke-test-client/pom.xml @@ -0,0 +1,130 @@ + + + + elasticsearch-qa + org.elasticsearch.qa + 2.1.0-SNAPSHOT + + 4.0.0 + + + + smoke-test-client + QA: Smoke Test Client + Test the Java Client against a running cluster + pom + + + true + + + + + org.elasticsearch + elasticsearch + test + + + log4j + log4j + test + + + + + + + src/test/resources + + + + ${elasticsearch.tools.directory}/shared-test-resources + false + + + + + + org.apache.maven.plugins + maven-remote-resources-plugin + + + org.apache.maven.plugins + maven-dependency-plugin + + + integ-setup-dependencies + pre-integration-test + + copy + + + ${skip.integ.tests} + true + ${integ.deps}/plugins + + + + + org.elasticsearch.distribution.zip + elasticsearch + ${elasticsearch.version} + zip + true + ${integ.deps} + + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + integ-setup + pre-integration-test + + run + + + ${skip.integ.tests} + + + + + + + + + + integ-teardown + post-integration-test + + run + + + ${skip.integ.tests} + + + + + + + + + + + diff --git a/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java b/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java new file mode 100644 index 00000000000..0ccd28f47f1 --- /dev/null +++ b/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java @@ -0,0 +1,173 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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. + */ + +package org.elasticsearch.smoketest; + +import org.apache.lucene.util.LuceneTestCase; +import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; +import org.elasticsearch.client.Client; +import org.elasticsearch.client.transport.TransportClient; +import org.elasticsearch.common.logging.ESLogger; +import org.elasticsearch.common.logging.ESLoggerFactory; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.transport.InetSocketTransportAddress; +import org.elasticsearch.common.transport.TransportAddress; +import org.elasticsearch.node.internal.InternalSettingsPreparer; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.nio.file.Path; +import java.util.Locale; +import java.util.concurrent.atomic.AtomicInteger; + +import static com.carrotsearch.randomizedtesting.RandomizedTest.randomAsciiOfLength; +import static org.hamcrest.Matchers.notNullValue; + +/** + * {@link ESSmokeClientTestCase} is an abstract base class to run integration + * tests against an external Elasticsearch Cluster. + *

+ * You can define a list of transport addresses from where you can reach your cluster + * by setting "tests.cluster" system property. It defaults to "localhost:9300". + *

+ * All tests can be run from maven using mvn install as maven will start an external cluster first. + *

+ * If you want to debug this module from your IDE, then start an external cluster by yourself + * then run JUnit. If you changed the default port, set "tests.cluster=localhost:PORT" when running + * your test. + */ +public abstract class ESSmokeClientTestCase extends LuceneTestCase { + + /** + * Key used to eventually switch to using an external cluster and provide its transport addresses + */ + public static final String TESTS_CLUSTER = "tests.cluster"; + + /** + * Defaults to localhost:9300 + */ + public static final String TESTS_CLUSTER_DEFAULT = "localhost:9300"; + + protected static ESLogger logger = ESLoggerFactory.getLogger(ESSmokeClientTestCase.class.getName()); + + private static final AtomicInteger counter = new AtomicInteger(); + private static Client client; + private static String clusterAddresses; + protected String index; + + private static Client startClient(Path tempDir, TransportAddress... transportAddresses) { + Settings clientSettings = Settings.settingsBuilder() + .put("name", "qa_smoke_client_" + counter.getAndIncrement()) + .put(InternalSettingsPreparer.IGNORE_SYSTEM_PROPERTIES_SETTING, true) // prevents any settings to be replaced by system properties. + .put("client.transport.ignore_cluster_name", true) + .put("path.home", tempDir) + .put("node.mode", "network").build(); // we require network here! + + TransportClient.Builder transportClientBuilder = TransportClient.builder().settings(clientSettings); + TransportClient client = transportClientBuilder.build().addTransportAddresses(transportAddresses); + + logger.info("--> Elasticsearch Java TransportClient started"); + + Exception clientException = null; + try { + ClusterHealthResponse health = client.admin().cluster().prepareHealth().get(); + logger.info("--> connected to [{}] cluster which is running [{}] node(s).", + health.getClusterName(), health.getNumberOfNodes()); + } catch (Exception e) { + clientException = e; + } + + assumeNoException("Sounds like your cluster is not running at " + clusterAddresses, clientException); + + return client; + } + + private static Client startClient() throws UnknownHostException { + String[] stringAddresses = clusterAddresses.split(","); + TransportAddress[] transportAddresses = new TransportAddress[stringAddresses.length]; + int i = 0; + for (String stringAddress : stringAddresses) { + String[] split = stringAddress.split(":"); + if (split.length < 2) { + throw new IllegalArgumentException("address [" + clusterAddresses + "] not valid"); + } + try { + transportAddresses[i++] = new InetSocketTransportAddress(InetAddress.getByName(split[0]), Integer.valueOf(split[1])); + } catch (NumberFormatException e) { + throw new IllegalArgumentException("port is not valid, expected number but was [" + split[1] + "]"); + } + } + return startClient(createTempDir(), transportAddresses); + } + + public static Client getClient() { + if (client == null) { + try { + client = startClient(); + } catch (UnknownHostException e) { + logger.error("can not start the client", e); + } + assertThat(client, notNullValue()); + } + return client; + } + + @BeforeClass + public static void initializeSettings() throws UnknownHostException { + clusterAddresses = System.getProperty(TESTS_CLUSTER); + if (clusterAddresses == null || clusterAddresses.isEmpty()) { + clusterAddresses = TESTS_CLUSTER_DEFAULT; + logger.info("[{}] not set. Falling back to [{}]", TESTS_CLUSTER, TESTS_CLUSTER_DEFAULT); + } + } + + @AfterClass + public static void stopTransportClient() { + if (client != null) { + client.close(); + client = null; + } + } + + @Before + public void defineIndexName() { + doClean(); + index = "qa-smoke-test-client-" + randomAsciiOfLength(10).toLowerCase(Locale.getDefault()); + } + + @After + public void cleanIndex() { + doClean(); + } + + private void doClean() { + if (client != null) { + try { + client.admin().indices().prepareDelete(index).get(); + } catch (Exception e) { + // We ignore this cleanup exception + } + } + } + +} diff --git a/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/SmokeTestClientIT.java b/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/SmokeTestClientIT.java new file mode 100644 index 00000000000..dbf51f0f739 --- /dev/null +++ b/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/SmokeTestClientIT.java @@ -0,0 +1,68 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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. + */ + +package org.elasticsearch.smoketest; + +import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.client.Client; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.is; + +public class SmokeTestClientIT extends ESSmokeClientTestCase { + + /** + * Check that we are connected to a cluster named "elasticsearch". + */ + @Test + public void testSimpleClient() { + Client client = getClient(); + + // START SNIPPET: java-doc-admin-cluster-health + ClusterHealthResponse health = client.admin().cluster().prepareHealth().setWaitForYellowStatus().get(); + // END SNIPPET: java-doc-admin-cluster-health + assertThat(health.getClusterName(), is("elasticsearch")); + } + + /** + * Create an index and index some docs + */ + @Test + public void testPutDocument() { + Client client = getClient(); + + // START SNIPPET: java-doc-index-doc-simple + client.prepareIndex(index, "doc", "1") // Index, Type, Id + .setSource("foo", "bar") // Simple document: { "foo" : "bar" } + .get(); // Execute and wait for the result + // END SNIPPET: java-doc-index-doc-simple + + // START SNIPPET: java-doc-admin-indices-refresh + // Prepare a refresh action on a given index, execute and wait for the result + client.admin().indices().prepareRefresh(index).get(); + // END SNIPPET: java-doc-admin-indices-refresh + + // START SNIPPET: java-doc-search-simple + SearchResponse searchResponse = client.prepareSearch(index).get(); + assertThat(searchResponse.getHits().getTotalHits(), is(1L)); + // END SNIPPET: java-doc-search-simple + } +} + From d47857b66f8bcec69ef7e54454bd7aa7eed09fe8 Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Wed, 2 Sep 2015 19:10:32 +0200 Subject: [PATCH 18/40] [test] don't call optimize while shard is relocating In this test we assume that after waitForRelocation() has returned shards are no more relocated and optimize will therefore succeed always. However, because the test does not wait for green status, relocations can still start after waitForRelocation() has returned successfully. see #13266 for a detailed explanation --- .../test/java/org/elasticsearch/search/query/SearchQueryIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/java/org/elasticsearch/search/query/SearchQueryIT.java b/core/src/test/java/org/elasticsearch/search/query/SearchQueryIT.java index 07363a4f240..7fa543a30e5 100644 --- a/core/src/test/java/org/elasticsearch/search/query/SearchQueryIT.java +++ b/core/src/test/java/org/elasticsearch/search/query/SearchQueryIT.java @@ -143,7 +143,7 @@ public class SearchQueryIT extends ESIntegTestCase { client().prepareIndex("test", "type1", "1").setSource("field1", "value1").get(); client().prepareIndex("test", "type1", "2").setSource("field1", "value2").get(); client().prepareIndex("test", "type1", "3").setSource("field1", "value3").get(); - + ensureGreen(); waitForRelocation(); optimize(); refresh(); From 1ffc6cd6a74311ee5361a455a0d1e71158728afa Mon Sep 17 00:00:00 2001 From: David Pilato Date: Wed, 2 Sep 2015 19:27:52 +0200 Subject: [PATCH 19/40] [qa] Add smoke test client module Fix previous commit. A `pom` project does not run any test... And the cluster name is set externally so we can't assert that it's `elasticsearch`. --- qa/smoke-test-client/pom.xml | 1 - .../java/org/elasticsearch/smoketest/SmokeTestClientIT.java | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qa/smoke-test-client/pom.xml b/qa/smoke-test-client/pom.xml index 1daec63add0..df48afa2287 100644 --- a/qa/smoke-test-client/pom.xml +++ b/qa/smoke-test-client/pom.xml @@ -21,7 +21,6 @@ smoke-test-client QA: Smoke Test Client Test the Java Client against a running cluster - pom true diff --git a/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/SmokeTestClientIT.java b/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/SmokeTestClientIT.java index dbf51f0f739..4c324b0f1a9 100644 --- a/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/SmokeTestClientIT.java +++ b/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/SmokeTestClientIT.java @@ -25,6 +25,7 @@ import org.elasticsearch.client.Client; import org.junit.Test; import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.greaterThan; public class SmokeTestClientIT extends ESSmokeClientTestCase { @@ -37,8 +38,10 @@ public class SmokeTestClientIT extends ESSmokeClientTestCase { // START SNIPPET: java-doc-admin-cluster-health ClusterHealthResponse health = client.admin().cluster().prepareHealth().setWaitForYellowStatus().get(); + String clusterName = health.getClusterName(); + int numberOfNodes = health.getNumberOfNodes(); // END SNIPPET: java-doc-admin-cluster-health - assertThat(health.getClusterName(), is("elasticsearch")); + assertThat("cluster [" + clusterName + "] should have at least 1 node", numberOfNodes, greaterThan(0)); } /** From 51db6cc3580bfcf67fa17ab7743136b67932b27e Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 2 Sep 2015 10:15:58 -0700 Subject: [PATCH 20/40] Tests: Remove test class exclusion for Abstract prefix and rename classes accordingly While the list of having exclusions is small, it shouldn't be necessary at all. Base test cases should be suffixed with TestCase so they are not picked up by the test class name pattern. This same rule works for abstract classes as well. This change renames abstract tests to use the TestCase suffix, adds a check in naming convention tests, and removes the exclusion from our test runner configuration. It also excludes inner classes (the only exclude we should have IMO), so that we have no need to @Ignore the inner test classes for naming convention tests. --- .../ExceptionSerializationTests.java | 4 +- .../elasticsearch/NamingConventionTests.java | 88 ++++++++++++------- ...ava => AbstractClientHeadersTestCase.java} | 2 +- .../client/node/NodeClientHeadersTests.java | 4 +- .../TransportClientHeadersTests.java | 5 +- ... => AbstractCompressedStreamTestCase.java} | 4 +- ...> AbstractCompressedXContentTestCase.java} | 4 +- .../deflate/DeflateCompressedStreamTests.java | 4 +- .../deflate/DeflateXContentTests.java | 4 +- .../lzf/LZFCompressedStreamTests.java | 4 +- .../common/compress/lzf/LZFXContentTests.java | 4 +- ...sts.java => AbstractRecyclerTestCase.java} | 2 +- .../recycler/ConcurrentRecyclerTests.java | 2 +- .../common/recycler/LockedRecyclerTests.java | 2 +- .../common/recycler/NoneRecyclerTests.java | 2 +- .../common/recycler/QueueRecyclerTests.java | 2 +- ...stractFilteringJsonGeneratorTestCase.java} | 2 +- .../JsonFilteringGeneratorTests.java | 2 +- .../YamlFilteringGeneratorTests.java | 2 +- ...ava => AbstractFieldDataImplTestCase.java} | 3 +- ...ts.java => AbstractFieldDataTestCase.java} | 2 +- ... => AbstractNumericFieldDataTestCase.java} | 2 +- ...a => AbstractStringFieldDataTestCase.java} | 2 +- .../fielddata/BinaryDVFieldDataTests.java | 2 +- .../index/fielddata/DoubleFieldDataTests.java | 2 +- .../index/fielddata/DuelFieldDataTests.java | 2 +- .../index/fielddata/FilterFieldDataTest.java | 2 +- .../index/fielddata/FloatFieldDataTests.java | 2 +- .../index/fielddata/LongFieldDataTests.java | 2 +- .../PagedBytesStringFieldDataTests.java | 2 +- .../fielddata/ParentChildFieldDataTests.java | 3 +- .../SortedSetDVStringFieldDataTests.java | 2 +- ... AbstractNumberNestedSortingTestCase.java} | 4 +- .../nested/DoubleNestedSortingTests.java | 2 +- .../search/nested/LongNestedSortingTests.java | 2 +- .../search/nested/NestedSortingTests.java | 4 +- ...a => AbstractSimpleTransportTestCase.java} | 2 +- .../local/SimpleLocalTransportTests.java | 4 +- .../netty/SimpleNettyTransportTests.java | 4 +- pom.xml | 2 +- 40 files changed, 109 insertions(+), 86 deletions(-) rename core/src/test/java/org/elasticsearch/client/{AbstractClientHeadersTests.java => AbstractClientHeadersTestCase.java} (99%) rename core/src/test/java/org/elasticsearch/common/compress/{AbstractCompressedStreamTests.java => AbstractCompressedStreamTestCase.java} (99%) rename core/src/test/java/org/elasticsearch/common/compress/{AbstractCompressedXContentTests.java => AbstractCompressedXContentTestCase.java} (96%) rename core/src/test/java/org/elasticsearch/common/recycler/{AbstractRecyclerTests.java => AbstractRecyclerTestCase.java} (98%) rename core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/{AbstractFilteringJsonGeneratorTests.java => AbstractFilteringJsonGeneratorTestCase.java} (99%) rename core/src/test/java/org/elasticsearch/index/fielddata/{AbstractFieldDataImplTests.java => AbstractFieldDataImplTestCase.java} (98%) rename core/src/test/java/org/elasticsearch/index/fielddata/{AbstractFieldDataTests.java => AbstractFieldDataTestCase.java} (98%) rename core/src/test/java/org/elasticsearch/index/fielddata/{AbstractNumericFieldDataTests.java => AbstractNumericFieldDataTestCase.java} (99%) rename core/src/test/java/org/elasticsearch/index/fielddata/{AbstractStringFieldDataTests.java => AbstractStringFieldDataTestCase.java} (99%) rename core/src/test/java/org/elasticsearch/index/search/nested/{AbstractNumberNestedSortingTests.java => AbstractNumberNestedSortingTestCase.java} (99%) rename core/src/test/java/org/elasticsearch/transport/{AbstractSimpleTransportTests.java => AbstractSimpleTransportTestCase.java} (99%) diff --git a/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java b/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java index c8a042fe1fc..9587846ec1d 100644 --- a/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java +++ b/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java @@ -28,6 +28,7 @@ import org.elasticsearch.action.RoutingMissingException; import org.elasticsearch.action.TimestampParsingException; import org.elasticsearch.action.search.SearchPhaseExecutionException; import org.elasticsearch.action.search.ShardSearchFailure; +import org.elasticsearch.client.AbstractClientHeadersTestCase; import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.metadata.SnapshotId; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -78,7 +79,6 @@ import java.nio.file.FileVisitor; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; -import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -97,7 +97,7 @@ public class ExceptionSerializationTests extends ESTestCase { org.elasticsearch.test.rest.client.RestException.class, org.elasticsearch.common.util.CancellableThreadsTest.CustomException.class, org.elasticsearch.rest.BytesRestResponseTests.WithHeadersException.class, - org.elasticsearch.client.AbstractClientHeadersTests.InternalException.class); + AbstractClientHeadersTestCase.InternalException.class); FileVisitor visitor = new FileVisitor() { private Path pkgPrefix = PathUtils.get(path).getParent(); diff --git a/core/src/test/java/org/elasticsearch/NamingConventionTests.java b/core/src/test/java/org/elasticsearch/NamingConventionTests.java index 071cd256e44..245d3645f96 100644 --- a/core/src/test/java/org/elasticsearch/NamingConventionTests.java +++ b/core/src/test/java/org/elasticsearch/NamingConventionTests.java @@ -48,11 +48,13 @@ public class NamingConventionTests extends ESTestCase { // see https://github.com/elasticsearch/elasticsearch/issues/9945 public void testNamingConventions() - throws ClassNotFoundException, IOException, URISyntaxException { + throws ClassNotFoundException, IOException, URISyntaxException { final Set notImplementing = new HashSet<>(); final Set pureUnitTest = new HashSet<>(); final Set missingSuffix = new HashSet<>(); final Set integTestsInDisguise = new HashSet<>(); + final Set notRunnable = new HashSet<>(); + final Set innerClasses = new HashSet<>(); String[] packages = {"org.elasticsearch", "org.apache.lucene"}; for (final String packageName : packages) { final String path = "/" + packageName.replace('.', '/'); @@ -76,27 +78,33 @@ public class NamingConventionTests extends ESTestCase { String filename = file.getFileName().toString(); if (filename.endsWith(".class")) { Class clazz = loadClass(filename); - if (Modifier.isAbstract(clazz.getModifiers()) == false && Modifier.isInterface(clazz.getModifiers()) == false) { - if (clazz.getName().endsWith("Tests") || - clazz.getName().endsWith("Test")) { // don't worry about the ones that match the pattern + //if (Modifier.isAbstract(clazz.getModifiers()) == false && Modifier.isInterface(clazz.getModifiers()) == false) { + if (clazz.getName().endsWith("Tests") || + clazz.getName().endsWith("Test")) { // don't worry about the ones that match the pattern - if (ESIntegTestCase.class.isAssignableFrom(clazz)) { - integTestsInDisguise.add(clazz); - } - if (isTestCase(clazz) == false) { - notImplementing.add(clazz); - } - } else if (clazz.getName().endsWith("IT")) { - if (isTestCase(clazz) == false) { - notImplementing.add(clazz); - } - // otherwise fine - } else if (isTestCase(clazz)) { + if (ESIntegTestCase.class.isAssignableFrom(clazz)) { + integTestsInDisguise.add(clazz); + } + if (Modifier.isAbstract(clazz.getModifiers()) || Modifier.isInterface(clazz.getModifiers())) { + notRunnable.add(clazz); + } else if (isTestCase(clazz) == false) { + notImplementing.add(clazz); + } else if (Modifier.isStatic(clazz.getModifiers())) { + innerClasses.add(clazz); + } + } else if (clazz.getName().endsWith("IT")) { + if (isTestCase(clazz) == false) { + notImplementing.add(clazz); + } + // otherwise fine + } else if (Modifier.isAbstract(clazz.getModifiers()) == false && Modifier.isInterface(clazz.getModifiers()) == false) { + if (isTestCase(clazz)) { missingSuffix.add(clazz); } else if (junit.framework.Test.class.isAssignableFrom(clazz) || hasTestAnnotation(clazz)) { pureUnitTest.add(clazz); } } + //} } } catch (ClassNotFoundException e) { @@ -143,39 +151,57 @@ public class NamingConventionTests extends ESTestCase { } assertTrue(missingSuffix.remove(WrongName.class)); assertTrue(missingSuffix.remove(WrongNameTheSecond.class)); + assertTrue(notRunnable.remove(DummyAbstractTests.class)); + assertTrue(notRunnable.remove(DummyInterfaceTests.class)); + assertTrue(innerClasses.remove(InnerTests.class)); assertTrue(notImplementing.remove(NotImplementingTests.class)); assertTrue(notImplementing.remove(NotImplementingTest.class)); assertTrue(pureUnitTest.remove(PlainUnit.class)); assertTrue(pureUnitTest.remove(PlainUnitTheSecond.class)); String classesToSubclass = Joiner.on(',').join( - ESTestCase.class.getSimpleName(), - ESTestCase.class.getSimpleName(), - ESTokenStreamTestCase.class.getSimpleName(), - LuceneTestCase.class.getSimpleName()); + ESTestCase.class.getSimpleName(), + ESTestCase.class.getSimpleName(), + ESTokenStreamTestCase.class.getSimpleName(), + LuceneTestCase.class.getSimpleName()); assertTrue("Not all subclasses of " + ESTestCase.class.getSimpleName() + - " match the naming convention. Concrete classes must end with [Test|Tests]: " + missingSuffix.toString(), - missingSuffix.isEmpty()); - assertTrue("Pure Unit-Test found must subclass one of [" + classesToSubclass +"] " + pureUnitTest.toString(), - pureUnitTest.isEmpty()); - assertTrue("Classes ending with Test|Tests] must subclass [" + classesToSubclass +"] " + notImplementing.toString(), - notImplementing.isEmpty()); - assertTrue("Subclasses of ESIntegTestCase should end with IT as they are integration tests: " + integTestsInDisguise, integTestsInDisguise.isEmpty()); + " match the naming convention. Concrete classes must end with [Test|Tests]:\n" + listClasses(missingSuffix), + missingSuffix.isEmpty()); + assertTrue("Classes ending with [Test|Tests] are abstract or interfaces:\n" + listClasses(notRunnable), + notRunnable.isEmpty()); + assertTrue("Found inner classes that are tests, which are excluded from the test runner:\n" + listClasses(innerClasses), + innerClasses.isEmpty()); + assertTrue("Pure Unit-Test found must subclass one of [" + classesToSubclass +"]:\n" + listClasses(pureUnitTest), + pureUnitTest.isEmpty()); + assertTrue("Classes ending with Test|Tests] must subclass [" + classesToSubclass +"]:\n" + listClasses(notImplementing), + notImplementing.isEmpty()); + assertTrue("Subclasses of ESIntegTestCase should end with IT as they are integration tests:\n" + listClasses(integTestsInDisguise), integTestsInDisguise.isEmpty()); + } + + static String listClasses(Set classes) { + StringBuilder builder = new StringBuilder(); + for (Class clazz : classes) { + builder.append(clazz.toString() + '\n'); + } + return builder.toString(); } /* * Some test the test classes */ - @SuppressForbidden(reason = "Ignoring test the tester") - @Ignore public static final class NotImplementingTests {} - @SuppressForbidden(reason = "Ignoring test the tester") - @Ignore + public static final class NotImplementingTest {} public static final class WrongName extends ESTestCase {} + public static abstract class DummyAbstractTests extends ESTestCase {} + + public interface DummyInterfaceTests {} + + public static final class InnerTests extends ESTestCase {} + public static final class WrongNameTheSecond extends ESTestCase {} public static final class PlainUnit extends TestCase {} diff --git a/core/src/test/java/org/elasticsearch/client/AbstractClientHeadersTests.java b/core/src/test/java/org/elasticsearch/client/AbstractClientHeadersTestCase.java similarity index 99% rename from core/src/test/java/org/elasticsearch/client/AbstractClientHeadersTests.java rename to core/src/test/java/org/elasticsearch/client/AbstractClientHeadersTestCase.java index ab4c35f16bc..964a47c84f2 100644 --- a/core/src/test/java/org/elasticsearch/client/AbstractClientHeadersTests.java +++ b/core/src/test/java/org/elasticsearch/client/AbstractClientHeadersTestCase.java @@ -64,7 +64,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public abstract class AbstractClientHeadersTests extends ESTestCase { +public abstract class AbstractClientHeadersTestCase extends ESTestCase { protected static final Settings HEADER_SETTINGS = Settings.builder() .put(Headers.PREFIX + ".key1", "val1") diff --git a/core/src/test/java/org/elasticsearch/client/node/NodeClientHeadersTests.java b/core/src/test/java/org/elasticsearch/client/node/NodeClientHeadersTests.java index 8293fbb3a60..e93fbc8e14a 100644 --- a/core/src/test/java/org/elasticsearch/client/node/NodeClientHeadersTests.java +++ b/core/src/test/java/org/elasticsearch/client/node/NodeClientHeadersTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.action.GenericAction; import org.elasticsearch.action.support.ActionFilter; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.TransportAction; -import org.elasticsearch.client.AbstractClientHeadersTests; +import org.elasticsearch.client.AbstractClientHeadersTestCase; import org.elasticsearch.client.Client; import org.elasticsearch.client.support.Headers; import org.elasticsearch.common.settings.Settings; @@ -37,7 +37,7 @@ import java.util.HashMap; /** * */ -public class NodeClientHeadersTests extends AbstractClientHeadersTests { +public class NodeClientHeadersTests extends AbstractClientHeadersTestCase { private static final ActionFilters EMPTY_FILTERS = new ActionFilters(Collections.emptySet()); diff --git a/core/src/test/java/org/elasticsearch/client/transport/TransportClientHeadersTests.java b/core/src/test/java/org/elasticsearch/client/transport/TransportClientHeadersTests.java index 631b2d18839..22d5ba20e11 100644 --- a/core/src/test/java/org/elasticsearch/client/transport/TransportClientHeadersTests.java +++ b/core/src/test/java/org/elasticsearch/client/transport/TransportClientHeadersTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.action.admin.cluster.node.liveness.LivenessResponse; import org.elasticsearch.action.admin.cluster.node.liveness.TransportLivenessAction; import org.elasticsearch.action.admin.cluster.state.ClusterStateAction; import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; -import org.elasticsearch.client.AbstractClientHeadersTests; +import org.elasticsearch.client.AbstractClientHeadersTestCase; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; @@ -48,7 +48,6 @@ import org.elasticsearch.transport.TransportResponseHandler; import org.elasticsearch.transport.TransportService; import org.junit.Test; -import java.util.Collection; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -58,7 +57,7 @@ import static org.hamcrest.Matchers.is; /** * */ -public class TransportClientHeadersTests extends AbstractClientHeadersTests { +public class TransportClientHeadersTests extends AbstractClientHeadersTestCase { private static final LocalTransportAddress address = new LocalTransportAddress("test"); diff --git a/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedStreamTests.java b/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedStreamTestCase.java similarity index 99% rename from core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedStreamTests.java rename to core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedStreamTestCase.java index b5800f34411..88f152725d9 100644 --- a/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedStreamTests.java +++ b/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedStreamTestCase.java @@ -37,11 +37,11 @@ import java.util.concurrent.CountDownLatch; /** * Test streaming compression (e.g. used for recovery) */ -public abstract class AbstractCompressedStreamTests extends ESTestCase { +public abstract class AbstractCompressedStreamTestCase extends ESTestCase { private final Compressor compressor; - protected AbstractCompressedStreamTests(Compressor compressor) { + protected AbstractCompressedStreamTestCase(Compressor compressor) { this.compressor = compressor; } diff --git a/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedXContentTests.java b/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedXContentTestCase.java similarity index 96% rename from core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedXContentTests.java rename to core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedXContentTestCase.java index 5b8bcf1e443..e5d627f35bb 100644 --- a/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedXContentTests.java +++ b/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedXContentTestCase.java @@ -35,11 +35,11 @@ import static org.hamcrest.Matchers.not; /** * */ -public abstract class AbstractCompressedXContentTests extends ESTestCase { +public abstract class AbstractCompressedXContentTestCase extends ESTestCase { private final Compressor compressor; - protected AbstractCompressedXContentTests(Compressor compressor) { + protected AbstractCompressedXContentTestCase(Compressor compressor) { this.compressor = compressor; } diff --git a/core/src/test/java/org/elasticsearch/common/compress/deflate/DeflateCompressedStreamTests.java b/core/src/test/java/org/elasticsearch/common/compress/deflate/DeflateCompressedStreamTests.java index 6607274dfcf..a6d33585dbc 100644 --- a/core/src/test/java/org/elasticsearch/common/compress/deflate/DeflateCompressedStreamTests.java +++ b/core/src/test/java/org/elasticsearch/common/compress/deflate/DeflateCompressedStreamTests.java @@ -19,9 +19,9 @@ package org.elasticsearch.common.compress.deflate; -import org.elasticsearch.common.compress.AbstractCompressedStreamTests; +import org.elasticsearch.common.compress.AbstractCompressedStreamTestCase; -public class DeflateCompressedStreamTests extends AbstractCompressedStreamTests { +public class DeflateCompressedStreamTests extends AbstractCompressedStreamTestCase { public DeflateCompressedStreamTests() { super(new DeflateCompressor()); diff --git a/core/src/test/java/org/elasticsearch/common/compress/deflate/DeflateXContentTests.java b/core/src/test/java/org/elasticsearch/common/compress/deflate/DeflateXContentTests.java index 8b103c97990..359a582e169 100644 --- a/core/src/test/java/org/elasticsearch/common/compress/deflate/DeflateXContentTests.java +++ b/core/src/test/java/org/elasticsearch/common/compress/deflate/DeflateXContentTests.java @@ -19,9 +19,9 @@ package org.elasticsearch.common.compress.deflate; -import org.elasticsearch.common.compress.AbstractCompressedXContentTests; +import org.elasticsearch.common.compress.AbstractCompressedXContentTestCase; -public class DeflateXContentTests extends AbstractCompressedXContentTests { +public class DeflateXContentTests extends AbstractCompressedXContentTestCase { public DeflateXContentTests() { super(new DeflateCompressor()); diff --git a/core/src/test/java/org/elasticsearch/common/compress/lzf/LZFCompressedStreamTests.java b/core/src/test/java/org/elasticsearch/common/compress/lzf/LZFCompressedStreamTests.java index 1d69fce1b9b..89ee148f4a8 100644 --- a/core/src/test/java/org/elasticsearch/common/compress/lzf/LZFCompressedStreamTests.java +++ b/core/src/test/java/org/elasticsearch/common/compress/lzf/LZFCompressedStreamTests.java @@ -19,9 +19,9 @@ package org.elasticsearch.common.compress.lzf; -import org.elasticsearch.common.compress.AbstractCompressedStreamTests; +import org.elasticsearch.common.compress.AbstractCompressedStreamTestCase; -public class LZFCompressedStreamTests extends AbstractCompressedStreamTests { +public class LZFCompressedStreamTests extends AbstractCompressedStreamTestCase { public LZFCompressedStreamTests() { super(new LZFTestCompressor()); diff --git a/core/src/test/java/org/elasticsearch/common/compress/lzf/LZFXContentTests.java b/core/src/test/java/org/elasticsearch/common/compress/lzf/LZFXContentTests.java index 698a033755e..05135f0ed68 100644 --- a/core/src/test/java/org/elasticsearch/common/compress/lzf/LZFXContentTests.java +++ b/core/src/test/java/org/elasticsearch/common/compress/lzf/LZFXContentTests.java @@ -19,9 +19,9 @@ package org.elasticsearch.common.compress.lzf; -import org.elasticsearch.common.compress.AbstractCompressedXContentTests; +import org.elasticsearch.common.compress.AbstractCompressedXContentTestCase; -public class LZFXContentTests extends AbstractCompressedXContentTests { +public class LZFXContentTests extends AbstractCompressedXContentTestCase { public LZFXContentTests() { super(new LZFTestCompressor()); diff --git a/core/src/test/java/org/elasticsearch/common/recycler/AbstractRecyclerTests.java b/core/src/test/java/org/elasticsearch/common/recycler/AbstractRecyclerTestCase.java similarity index 98% rename from core/src/test/java/org/elasticsearch/common/recycler/AbstractRecyclerTests.java rename to core/src/test/java/org/elasticsearch/common/recycler/AbstractRecyclerTestCase.java index 39376441d2b..b48654ae7cd 100644 --- a/core/src/test/java/org/elasticsearch/common/recycler/AbstractRecyclerTests.java +++ b/core/src/test/java/org/elasticsearch/common/recycler/AbstractRecyclerTestCase.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -public abstract class AbstractRecyclerTests extends ESTestCase { +public abstract class AbstractRecyclerTestCase extends ESTestCase { // marker states for data protected static final byte FRESH = 1; diff --git a/core/src/test/java/org/elasticsearch/common/recycler/ConcurrentRecyclerTests.java b/core/src/test/java/org/elasticsearch/common/recycler/ConcurrentRecyclerTests.java index c8c4c2e8e7d..f4931b18ff3 100644 --- a/core/src/test/java/org/elasticsearch/common/recycler/ConcurrentRecyclerTests.java +++ b/core/src/test/java/org/elasticsearch/common/recycler/ConcurrentRecyclerTests.java @@ -19,7 +19,7 @@ package org.elasticsearch.common.recycler; -public class ConcurrentRecyclerTests extends AbstractRecyclerTests { +public class ConcurrentRecyclerTests extends AbstractRecyclerTestCase { @Override protected Recycler newRecycler(int limit) { diff --git a/core/src/test/java/org/elasticsearch/common/recycler/LockedRecyclerTests.java b/core/src/test/java/org/elasticsearch/common/recycler/LockedRecyclerTests.java index 7d56dffce15..ad7b2943afc 100644 --- a/core/src/test/java/org/elasticsearch/common/recycler/LockedRecyclerTests.java +++ b/core/src/test/java/org/elasticsearch/common/recycler/LockedRecyclerTests.java @@ -19,7 +19,7 @@ package org.elasticsearch.common.recycler; -public class LockedRecyclerTests extends AbstractRecyclerTests { +public class LockedRecyclerTests extends AbstractRecyclerTestCase { @Override protected Recycler newRecycler(int limit) { diff --git a/core/src/test/java/org/elasticsearch/common/recycler/NoneRecyclerTests.java b/core/src/test/java/org/elasticsearch/common/recycler/NoneRecyclerTests.java index d4acb54661f..f0537020d3a 100644 --- a/core/src/test/java/org/elasticsearch/common/recycler/NoneRecyclerTests.java +++ b/core/src/test/java/org/elasticsearch/common/recycler/NoneRecyclerTests.java @@ -19,7 +19,7 @@ package org.elasticsearch.common.recycler; -public class NoneRecyclerTests extends AbstractRecyclerTests { +public class NoneRecyclerTests extends AbstractRecyclerTestCase { @Override protected Recycler newRecycler(int limit) { diff --git a/core/src/test/java/org/elasticsearch/common/recycler/QueueRecyclerTests.java b/core/src/test/java/org/elasticsearch/common/recycler/QueueRecyclerTests.java index 20e229a65b0..649815db204 100644 --- a/core/src/test/java/org/elasticsearch/common/recycler/QueueRecyclerTests.java +++ b/core/src/test/java/org/elasticsearch/common/recycler/QueueRecyclerTests.java @@ -19,7 +19,7 @@ package org.elasticsearch.common.recycler; -public class QueueRecyclerTests extends AbstractRecyclerTests { +public class QueueRecyclerTests extends AbstractRecyclerTestCase { @Override protected Recycler newRecycler(int limit) { diff --git a/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractFilteringJsonGeneratorTests.java b/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractFilteringJsonGeneratorTestCase.java similarity index 99% rename from core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractFilteringJsonGeneratorTests.java rename to core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractFilteringJsonGeneratorTestCase.java index 5ef19bdaf39..9669b0992de 100644 --- a/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractFilteringJsonGeneratorTests.java +++ b/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractFilteringJsonGeneratorTestCase.java @@ -31,7 +31,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; -public abstract class AbstractFilteringJsonGeneratorTests extends ESTestCase { +public abstract class AbstractFilteringJsonGeneratorTestCase extends ESTestCase { protected abstract XContentType getXContentType(); diff --git a/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonFilteringGeneratorTests.java b/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonFilteringGeneratorTests.java index 9468746fac6..a5188842fdc 100644 --- a/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonFilteringGeneratorTests.java +++ b/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonFilteringGeneratorTests.java @@ -22,7 +22,7 @@ package org.elasticsearch.common.xcontent.support.filtering; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentType; -public class JsonFilteringGeneratorTests extends AbstractFilteringJsonGeneratorTests { +public class JsonFilteringGeneratorTests extends AbstractFilteringJsonGeneratorTestCase { @Override protected XContentType getXContentType() { diff --git a/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java b/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java index d7e3a934ec4..c85fbc92253 100644 --- a/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java +++ b/core/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java @@ -22,7 +22,7 @@ package org.elasticsearch.common.xcontent.support.filtering; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentType; -public class YamlFilteringGeneratorTests extends AbstractFilteringJsonGeneratorTests { +public class YamlFilteringGeneratorTests extends AbstractFilteringJsonGeneratorTestCase { @Override protected XContentType getXContentType() { diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataImplTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataImplTestCase.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataImplTests.java rename to core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataImplTestCase.java index 03328f24c3b..a0f51a71113 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataImplTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataImplTestCase.java @@ -24,13 +24,12 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.search.*; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.Strings; -import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource; import org.elasticsearch.search.MultiValueMode; import org.junit.Test; import static org.hamcrest.Matchers.*; -public abstract class AbstractFieldDataImplTests extends AbstractFieldDataTests { +public abstract class AbstractFieldDataImplTestCase extends AbstractFieldDataTestCase { protected String one() { return "1"; diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTestCase.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTests.java rename to core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTestCase.java index 6908a6738d5..74891629d20 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTestCase.java @@ -45,7 +45,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.sameInstance; -public abstract class AbstractFieldDataTests extends ESSingleNodeTestCase { +public abstract class AbstractFieldDataTestCase extends ESSingleNodeTestCase { protected IndexService indexService; protected IndexFieldDataService ifdService; diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractNumericFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractNumericFieldDataTestCase.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/fielddata/AbstractNumericFieldDataTests.java rename to core/src/test/java/org/elasticsearch/index/fielddata/AbstractNumericFieldDataTestCase.java index 271a0424d90..5c28a8f6c55 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractNumericFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractNumericFieldDataTestCase.java @@ -35,7 +35,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public abstract class AbstractNumericFieldDataTests extends AbstractFieldDataImplTests { +public abstract class AbstractNumericFieldDataTestCase extends AbstractFieldDataImplTestCase { @Override protected abstract FieldDataType getFieldDataType(); diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTestCase.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTests.java rename to core/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTestCase.java index 8fcc949936b..f17f20dcc77 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTestCase.java @@ -70,7 +70,7 @@ import static org.hamcrest.Matchers.sameInstance; /** */ -public abstract class AbstractStringFieldDataTests extends AbstractFieldDataImplTests { +public abstract class AbstractStringFieldDataTestCase extends AbstractFieldDataImplTestCase { private void addField(Document d, String name, String value) { d.add(new StringField(name, value, Field.Store.YES)); diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/BinaryDVFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/BinaryDVFieldDataTests.java index ab63a5d6eb0..bc63ed9f18b 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/BinaryDVFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/BinaryDVFieldDataTests.java @@ -35,7 +35,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class BinaryDVFieldDataTests extends AbstractFieldDataTests { +public class BinaryDVFieldDataTests extends AbstractFieldDataTestCase { @Override protected boolean hasDocValues() { diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/DoubleFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/DoubleFieldDataTests.java index 242e01475df..6c93a2e5fdc 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/DoubleFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/DoubleFieldDataTests.java @@ -27,7 +27,7 @@ import org.apache.lucene.index.Term; /** */ -public class DoubleFieldDataTests extends AbstractNumericFieldDataTests { +public class DoubleFieldDataTests extends AbstractNumericFieldDataTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/DuelFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/DuelFieldDataTests.java index 9a4250f188e..f02c286c601 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/DuelFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/DuelFieldDataTests.java @@ -56,7 +56,7 @@ import java.util.Set; import static org.hamcrest.Matchers.*; -public class DuelFieldDataTests extends AbstractFieldDataTests { +public class DuelFieldDataTests extends AbstractFieldDataTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTest.java b/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTest.java index 52807f385a9..493b5a56327 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTest.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTest.java @@ -30,7 +30,7 @@ import java.util.Random; import static org.hamcrest.Matchers.equalTo; -public class FilterFieldDataTest extends AbstractFieldDataTests { +public class FilterFieldDataTest extends AbstractFieldDataTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/FloatFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/FloatFieldDataTests.java index b81a8cdf17d..2633673c9de 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/FloatFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/FloatFieldDataTests.java @@ -26,7 +26,7 @@ import org.apache.lucene.index.Term; /** */ -public class FloatFieldDataTests extends AbstractNumericFieldDataTests { +public class FloatFieldDataTests extends AbstractNumericFieldDataTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/LongFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/LongFieldDataTests.java index 09a24a4283c..f47b94d7081 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/LongFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/LongFieldDataTests.java @@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.lessThan; /** * Tests for all integer types (byte, short, int, long). */ -public class LongFieldDataTests extends AbstractNumericFieldDataTests { +public class LongFieldDataTests extends AbstractNumericFieldDataTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/PagedBytesStringFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/PagedBytesStringFieldDataTests.java index 1b8909ea63e..7a8e879d7ad 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/PagedBytesStringFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/PagedBytesStringFieldDataTests.java @@ -24,7 +24,7 @@ import org.elasticsearch.index.fielddata.ordinals.OrdinalsBuilder; /** */ -public class PagedBytesStringFieldDataTests extends AbstractStringFieldDataTests { +public class PagedBytesStringFieldDataTests extends AbstractStringFieldDataTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/ParentChildFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/ParentChildFieldDataTests.java index 90934bc177b..b265988c330 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/ParentChildFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/ParentChildFieldDataTests.java @@ -30,7 +30,6 @@ import org.apache.lucene.search.*; import org.apache.lucene.util.BytesRef; import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource; import org.elasticsearch.index.fielddata.plain.ParentChildIndexFieldData; import org.elasticsearch.index.mapper.Uid; import org.elasticsearch.index.mapper.internal.ParentFieldMapper; @@ -49,7 +48,7 @@ import static org.hamcrest.Matchers.nullValue; /** */ -public class ParentChildFieldDataTests extends AbstractFieldDataTests { +public class ParentChildFieldDataTests extends AbstractFieldDataTestCase { private final String parentType = "parent"; private final String childType = "child"; diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/SortedSetDVStringFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/SortedSetDVStringFieldDataTests.java index 013a7ec9897..0b2f174bf05 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/SortedSetDVStringFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/SortedSetDVStringFieldDataTests.java @@ -22,7 +22,7 @@ package org.elasticsearch.index.fielddata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.fielddata.ordinals.OrdinalsBuilder; -public class SortedSetDVStringFieldDataTests extends AbstractStringFieldDataTests { +public class SortedSetDVStringFieldDataTests extends AbstractStringFieldDataTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/index/search/nested/AbstractNumberNestedSortingTests.java b/core/src/test/java/org/elasticsearch/index/search/nested/AbstractNumberNestedSortingTestCase.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/search/nested/AbstractNumberNestedSortingTests.java rename to core/src/test/java/org/elasticsearch/index/search/nested/AbstractNumberNestedSortingTestCase.java index 940e10e77df..1581693b00a 100644 --- a/core/src/test/java/org/elasticsearch/index/search/nested/AbstractNumberNestedSortingTests.java +++ b/core/src/test/java/org/elasticsearch/index/search/nested/AbstractNumberNestedSortingTestCase.java @@ -40,7 +40,7 @@ import org.apache.lucene.search.join.BitDocIdSetCachingWrapperFilter; import org.apache.lucene.search.join.ScoreMode; import org.apache.lucene.search.join.ToParentBlockJoinQuery; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.index.fielddata.AbstractFieldDataTests; +import org.elasticsearch.index.fielddata.AbstractFieldDataTestCase; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; @@ -55,7 +55,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public abstract class AbstractNumberNestedSortingTests extends AbstractFieldDataTests { +public abstract class AbstractNumberNestedSortingTestCase extends AbstractFieldDataTestCase { @Test public void testNestedSorting() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/index/search/nested/DoubleNestedSortingTests.java b/core/src/test/java/org/elasticsearch/index/search/nested/DoubleNestedSortingTests.java index 12776cec73a..fde2aa51777 100644 --- a/core/src/test/java/org/elasticsearch/index/search/nested/DoubleNestedSortingTests.java +++ b/core/src/test/java/org/elasticsearch/index/search/nested/DoubleNestedSortingTests.java @@ -49,7 +49,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class DoubleNestedSortingTests extends AbstractNumberNestedSortingTests { +public class DoubleNestedSortingTests extends AbstractNumberNestedSortingTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/index/search/nested/LongNestedSortingTests.java b/core/src/test/java/org/elasticsearch/index/search/nested/LongNestedSortingTests.java index 927aa672019..9113222e94a 100644 --- a/core/src/test/java/org/elasticsearch/index/search/nested/LongNestedSortingTests.java +++ b/core/src/test/java/org/elasticsearch/index/search/nested/LongNestedSortingTests.java @@ -30,7 +30,7 @@ import org.elasticsearch.search.MultiValueMode; /** */ -public class LongNestedSortingTests extends AbstractNumberNestedSortingTests { +public class LongNestedSortingTests extends AbstractNumberNestedSortingTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/index/search/nested/NestedSortingTests.java b/core/src/test/java/org/elasticsearch/index/search/nested/NestedSortingTests.java index 287170dad39..7d30eb5a519 100644 --- a/core/src/test/java/org/elasticsearch/index/search/nested/NestedSortingTests.java +++ b/core/src/test/java/org/elasticsearch/index/search/nested/NestedSortingTests.java @@ -46,7 +46,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.TestUtil; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.fielddata.AbstractFieldDataTests; +import org.elasticsearch.index.fielddata.AbstractFieldDataTestCase; import org.elasticsearch.index.fielddata.FieldDataType; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource; @@ -65,7 +65,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class NestedSortingTests extends AbstractFieldDataTests { +public class NestedSortingTests extends AbstractFieldDataTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/transport/AbstractSimpleTransportTests.java b/core/src/test/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java similarity index 99% rename from core/src/test/java/org/elasticsearch/transport/AbstractSimpleTransportTests.java rename to core/src/test/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java index 9041bca2797..4499d92066e 100644 --- a/core/src/test/java/org/elasticsearch/transport/AbstractSimpleTransportTests.java +++ b/core/src/test/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java @@ -48,7 +48,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public abstract class AbstractSimpleTransportTests extends ESTestCase { +public abstract class AbstractSimpleTransportTestCase extends ESTestCase { protected ThreadPool threadPool; diff --git a/core/src/test/java/org/elasticsearch/transport/local/SimpleLocalTransportTests.java b/core/src/test/java/org/elasticsearch/transport/local/SimpleLocalTransportTests.java index e87b0786a5b..1d1ad8d5ba9 100644 --- a/core/src/test/java/org/elasticsearch/transport/local/SimpleLocalTransportTests.java +++ b/core/src/test/java/org/elasticsearch/transport/local/SimpleLocalTransportTests.java @@ -23,9 +23,9 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.test.transport.MockTransportService; -import org.elasticsearch.transport.AbstractSimpleTransportTests; +import org.elasticsearch.transport.AbstractSimpleTransportTestCase; -public class SimpleLocalTransportTests extends AbstractSimpleTransportTests { +public class SimpleLocalTransportTests extends AbstractSimpleTransportTestCase { @Override protected MockTransportService build(Settings settings, Version version, NamedWriteableRegistry namedWriteableRegistry) { diff --git a/core/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java b/core/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java index 5b8557178f2..923ed63aead 100644 --- a/core/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java +++ b/core/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java @@ -27,14 +27,14 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.test.transport.MockTransportService; -import org.elasticsearch.transport.AbstractSimpleTransportTests; +import org.elasticsearch.transport.AbstractSimpleTransportTestCase; import org.elasticsearch.transport.ConnectTransportException; import org.junit.Test; import java.net.InetAddress; import java.net.UnknownHostException; -public class SimpleNettyTransportTests extends AbstractSimpleTransportTests { +public class SimpleNettyTransportTests extends AbstractSimpleTransportTestCase { @Override protected MockTransportService build(Settings settings, Version version, NamedWriteableRegistry namedWriteableRegistry) { diff --git a/pom.xml b/pom.xml index 2af046be847..c875e5962c7 100644 --- a/pom.xml +++ b/pom.xml @@ -721,7 +721,7 @@ **/*Test.class - **/Abstract*.class + **/*$*.class **/*StressTest.class From 205675ad1913f1fc3802e9da04f5d1ca79aca845 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 2 Sep 2015 11:13:05 -0700 Subject: [PATCH 21/40] Addressed PR comments --- .../elasticsearch/NamingConventionTests.java | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/NamingConventionTests.java b/core/src/test/java/org/elasticsearch/NamingConventionTests.java index 245d3645f96..bbd451195d0 100644 --- a/core/src/test/java/org/elasticsearch/NamingConventionTests.java +++ b/core/src/test/java/org/elasticsearch/NamingConventionTests.java @@ -48,7 +48,7 @@ public class NamingConventionTests extends ESTestCase { // see https://github.com/elasticsearch/elasticsearch/issues/9945 public void testNamingConventions() - throws ClassNotFoundException, IOException, URISyntaxException { + throws ClassNotFoundException, IOException, URISyntaxException { final Set notImplementing = new HashSet<>(); final Set pureUnitTest = new HashSet<>(); final Set missingSuffix = new HashSet<>(); @@ -78,7 +78,6 @@ public class NamingConventionTests extends ESTestCase { String filename = file.getFileName().toString(); if (filename.endsWith(".class")) { Class clazz = loadClass(filename); - //if (Modifier.isAbstract(clazz.getModifiers()) == false && Modifier.isInterface(clazz.getModifiers()) == false) { if (clazz.getName().endsWith("Tests") || clazz.getName().endsWith("Test")) { // don't worry about the ones that match the pattern @@ -104,8 +103,6 @@ public class NamingConventionTests extends ESTestCase { pureUnitTest.add(clazz); } } - //} - } } catch (ClassNotFoundException e) { throw new RuntimeException(e); @@ -165,25 +162,18 @@ public class NamingConventionTests extends ESTestCase { ESTokenStreamTestCase.class.getSimpleName(), LuceneTestCase.class.getSimpleName()); assertTrue("Not all subclasses of " + ESTestCase.class.getSimpleName() + - " match the naming convention. Concrete classes must end with [Test|Tests]:\n" + listClasses(missingSuffix), + " match the naming convention. Concrete classes must end with [Test|Tests]:\n" + Joiner.on('\n').join(missingSuffix), missingSuffix.isEmpty()); - assertTrue("Classes ending with [Test|Tests] are abstract or interfaces:\n" + listClasses(notRunnable), + assertTrue("Classes ending with [Test|Tests] are abstract or interfaces:\n" + Joiner.on('\n').join(notRunnable), notRunnable.isEmpty()); - assertTrue("Found inner classes that are tests, which are excluded from the test runner:\n" + listClasses(innerClasses), + assertTrue("Found inner classes that are tests, which are excluded from the test runner:\n" + Joiner.on('\n').join(innerClasses), innerClasses.isEmpty()); - assertTrue("Pure Unit-Test found must subclass one of [" + classesToSubclass +"]:\n" + listClasses(pureUnitTest), + assertTrue("Pure Unit-Test found must subclass one of [" + classesToSubclass +"]:\n" + Joiner.on('\n').join(pureUnitTest), pureUnitTest.isEmpty()); - assertTrue("Classes ending with Test|Tests] must subclass [" + classesToSubclass +"]:\n" + listClasses(notImplementing), + assertTrue("Classes ending with Test|Tests] must subclass [" + classesToSubclass +"]:\n" + Joiner.on('\n').join(notImplementing), notImplementing.isEmpty()); - assertTrue("Subclasses of ESIntegTestCase should end with IT as they are integration tests:\n" + listClasses(integTestsInDisguise), integTestsInDisguise.isEmpty()); - } - - static String listClasses(Set classes) { - StringBuilder builder = new StringBuilder(); - for (Class clazz : classes) { - builder.append(clazz.toString() + '\n'); - } - return builder.toString(); + assertTrue("Subclasses of ESIntegTestCase should end with IT as they are integration tests:\n" + Joiner.on('\n').join(integTestsInDisguise), + integTestsInDisguise.isEmpty()); } /* From 4d05832a0bf877f4dc02bcc1d1460c4dd7a64303 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Wed, 2 Sep 2015 20:39:27 +0200 Subject: [PATCH 22/40] [qa] Add smoke test client module As we log a lot, we hit a default limit: ``` The test or suite printed 9450 bytes to stdout and stderr, even though the limit was set to 8192 bytes. Increase the limit with @Limit, ignore it completely with @SuppressSysoutChecks or run with -Dtests.verbose=true ``` (cherry picked from commit 0cb325d) --- .../java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java | 1 + 1 file changed, 1 insertion(+) diff --git a/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java b/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java index 0ccd28f47f1..e18ca34afa2 100644 --- a/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java +++ b/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java @@ -56,6 +56,7 @@ import static org.hamcrest.Matchers.notNullValue; * then run JUnit. If you changed the default port, set "tests.cluster=localhost:PORT" when running * your test. */ +@LuceneTestCase.SuppressSysoutChecks(bugUrl = "we log a lot on purpose") public abstract class ESSmokeClientTestCase extends LuceneTestCase { /** From 92a6968f2ad944f3540e2193eb99c9d8222081d6 Mon Sep 17 00:00:00 2001 From: Ivannikov Kirill Date: Wed, 2 Sep 2015 23:56:37 +0500 Subject: [PATCH 23/40] Catch exception in callback of exception --- .../index/indexing/ShardIndexingService.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java index bbdde45c770..7766a314413 100644 --- a/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java +++ b/core/src/main/java/org/elasticsearch/index/indexing/ShardIndexingService.java @@ -131,7 +131,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { public void postCreate(Engine.Create create, Throwable ex) { for (IndexingOperationListener listener : listeners) { - listener.postCreate(create, ex); + try { + listener.postCreate(create, ex); + } catch (Throwable t) { + logger.warn("postCreate listener [{}] failed", t, listener); + } } } @@ -175,7 +179,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { totalStats.indexCurrent.dec(); typeStats(index.type()).indexCurrent.dec(); for (IndexingOperationListener listener : listeners) { - listener.postIndex(index, ex); + try { + listener.postIndex(index, ex); + } catch (Throwable t) { + logger.warn("postIndex listener [{}] failed", t, listener); + } } } @@ -218,7 +226,11 @@ public class ShardIndexingService extends AbstractIndexShardComponent { totalStats.deleteCurrent.dec(); typeStats(delete.type()).deleteCurrent.dec(); for (IndexingOperationListener listener : listeners) { - listener.postDelete(delete, ex); + try { + listener. postDelete(delete, ex); + } catch (Throwable t) { + logger.warn("postDelete listener [{}] failed", t, listener); + } } } From fabadc6a67fc134ea88d5ff9fd7749c06b52eb91 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 2 Sep 2015 12:33:34 -0700 Subject: [PATCH 24/40] Fix naming for plugins abstract test cases See #13282 --- .../aws/{AbstractAwsTest.java => AbstractAwsTestCase.java} | 2 +- .../org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java | 4 ++-- .../discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java | 4 ++-- ...toreTest.java => AbstractS3SnapshotRestoreTestCase.java} | 4 ++-- .../s3/S3ProxiedSnapshotRestoreOverHttpsTest.java | 2 +- .../repositories/s3/S3SnapshotRestoreOverHttpTest.java | 2 +- .../repositories/s3/S3SnapshotRestoreOverHttpsTest.java | 2 +- .../org/elasticsearch/azure/itest/AzureSimpleITest.java | 6 +++--- ...ceTest.java => AbstractAzureComputeServiceTestCase.java} | 4 ++-- ...java => AbstractAzureRepositoryServiceTestCaseCase.java} | 4 ++-- .../{AbstractAzureTest.java => AbstractAzureTestCase.java} | 2 +- .../discovery/azure/AzureMinimumMasterNodesTest.java | 4 ++-- .../org/elasticsearch/discovery/azure/AzureSimpleTest.java | 4 ++-- .../discovery/azure/AzureTwoStartedNodesTest.java | 4 ++-- ...bstractAzureFsTest.java => AbstractAzureFsTestCase.java} | 2 +- .../java/org/elasticsearch/index/store/SmbMMapFsTest.java | 3 +-- .../java/org/elasticsearch/index/store/SmbSimpleFsTest.java | 3 +-- .../repositories/azure/AzureSnapshotRestoreITest.java | 6 +++--- .../repositories/azure/AzureSnapshotRestoreTest.java | 5 ++--- 19 files changed, 32 insertions(+), 35 deletions(-) rename plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/{AbstractAwsTest.java => AbstractAwsTestCase.java} (98%) rename plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/{AbstractS3SnapshotRestoreTest.java => AbstractS3SnapshotRestoreTestCase.java} (99%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/{AbstractAzureComputeServiceTest.java => AbstractAzureComputeServiceTestCase.java} (93%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/{AbstractAzureRepositoryServiceTest.java => AbstractAzureRepositoryServiceTestCaseCase.java} (96%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/{AbstractAzureTest.java => AbstractAzureTestCase.java} (97%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/{AbstractAzureFsTest.java => AbstractAzureFsTestCase.java} (96%) diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java similarity index 98% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java rename to plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java index b66cd943b11..ba3f84e266e 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java @@ -41,7 +41,7 @@ import java.util.Map; * in order to run these tests. */ @ThirdParty -public abstract class AbstractAwsTest extends ESIntegTestCase { +public abstract class AbstractAwsTestCase extends ESIntegTestCase { /** * Those properties are set by the AWS SDK v1.9.4 and if not ignored, diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java index 9af9e4df62c..f79b68f289d 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java @@ -20,7 +20,7 @@ package org.elasticsearch.discovery.ec2; -import org.elasticsearch.cloud.aws.AbstractAwsTest; +import org.elasticsearch.cloud.aws.AbstractAwsTestCase; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugin.cloud.aws.CloudAwsPlugin; import org.elasticsearch.plugins.Plugin; @@ -38,7 +38,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; * This test requires AWS to run. */ @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class Ec2DiscoveryITest extends AbstractAwsTest { +public class Ec2DiscoveryITest extends AbstractAwsTestCase { @Override protected Collection> nodePlugins() { diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java index 7dbe7647da3..1709d48e399 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java @@ -21,7 +21,7 @@ package org.elasticsearch.discovery.ec2; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; -import org.elasticsearch.cloud.aws.AbstractAwsTest; +import org.elasticsearch.cloud.aws.AbstractAwsTestCase; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugin.cloud.aws.CloudAwsPlugin; import org.elasticsearch.plugins.Plugin; @@ -40,7 +40,7 @@ import static org.hamcrest.CoreMatchers.is; * This test requires AWS to run. */ @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class Ec2DiscoveryUpdateSettingsITest extends AbstractAwsTest { +public class Ec2DiscoveryUpdateSettingsITest extends AbstractAwsTestCase { @Override protected Collection> nodePlugins() { diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTestCase.java similarity index 99% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java rename to plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTestCase.java index 393224105c0..61a42fbaaa5 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTestCase.java @@ -29,7 +29,7 @@ import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRes import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.client.Client; import org.elasticsearch.client.ClusterAdminClient; -import org.elasticsearch.cloud.aws.AbstractAwsTest; +import org.elasticsearch.cloud.aws.AbstractAwsTestCase; import org.elasticsearch.cloud.aws.AwsS3Service; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.settings.Settings; @@ -55,7 +55,7 @@ import static org.hamcrest.Matchers.*; /** */ @ClusterScope(scope = Scope.SUITE, numDataNodes = 2, numClientNodes = 0, transportClientRatio = 0.0) -abstract public class AbstractS3SnapshotRestoreTest extends AbstractAwsTest { +abstract public class AbstractS3SnapshotRestoreTestCase extends AbstractAwsTestCase { @Override public Settings indexSettings() { diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java index dbcb7d8b7e3..a8df3165b4c 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java @@ -27,7 +27,7 @@ import org.junit.Before; * cloud.aws.s3.proxy_host: mys3proxy.company.com * cloud.aws.s3.proxy_port: 8080 */ -public class S3ProxiedSnapshotRestoreOverHttpsTest extends AbstractS3SnapshotRestoreTest { +public class S3ProxiedSnapshotRestoreOverHttpsTest extends AbstractS3SnapshotRestoreTestCase { private boolean proxySet = false; diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java index 045d18a6709..14eee25146d 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.settings.Settings; /** */ -public class S3SnapshotRestoreOverHttpTest extends AbstractS3SnapshotRestoreTest { +public class S3SnapshotRestoreOverHttpTest extends AbstractS3SnapshotRestoreTestCase { @Override public Settings nodeSettings(int nodeOrdinal) { Settings.Builder settings = Settings.builder() diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java index ca098cbaec3..c039e77be1c 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.settings.Settings; /** */ -public class S3SnapshotRestoreOverHttpsTest extends AbstractS3SnapshotRestoreTest { +public class S3SnapshotRestoreOverHttpsTest extends AbstractS3SnapshotRestoreTestCase { @Override public Settings nodeSettings(int nodeOrdinal) { Settings.Builder settings = Settings.builder() diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/AzureSimpleITest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/AzureSimpleITest.java index da916d5b71d..80853862788 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/AzureSimpleITest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/AzureSimpleITest.java @@ -20,7 +20,7 @@ package org.elasticsearch.azure.itest; import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; -import org.elasticsearch.cloud.azure.AbstractAzureTest; +import org.elasticsearch.cloud.azure.AbstractAzureTestCase; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.test.ESIntegTestCase; import org.hamcrest.Matchers; @@ -29,14 +29,14 @@ import org.junit.Test; /** * This test needs Azure to run and -Dtests.thirdparty=true to be set * and -Des.config=/path/to/elasticsearch.yml - * @see org.elasticsearch.cloud.azure.AbstractAzureTest + * @see AbstractAzureTestCase */ @ESIntegTestCase.ClusterScope( scope = ESIntegTestCase.Scope.TEST, numDataNodes = 1, numClientNodes = 0, transportClientRatio = 0.0) -public class AzureSimpleITest extends AbstractAzureTest { +public class AzureSimpleITest extends AbstractAzureTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureComputeServiceTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureComputeServiceTestCase.java similarity index 93% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureComputeServiceTest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureComputeServiceTestCase.java index 8df4df21470..dd69e083ac4 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureComputeServiceTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureComputeServiceTestCase.java @@ -29,11 +29,11 @@ import org.elasticsearch.test.ESIntegTestCase; import java.util.Collection; -public abstract class AbstractAzureComputeServiceTest extends ESIntegTestCase { +public abstract class AbstractAzureComputeServiceTestCase extends ESIntegTestCase { private Class mockPlugin; - public AbstractAzureComputeServiceTest(Class mockPlugin) { + public AbstractAzureComputeServiceTestCase(Class mockPlugin) { // We want to inject the Azure API Mock this.mockPlugin = mockPlugin; } diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTestCaseCase.java similarity index 96% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTestCaseCase.java index d4ae582c849..c798c49a8ca 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTestCaseCase.java @@ -35,7 +35,7 @@ import org.junit.Before; import java.net.URISyntaxException; import java.util.Collection; -public abstract class AbstractAzureRepositoryServiceTest extends AbstractAzureTest { +public abstract class AbstractAzureRepositoryServiceTestCaseCase extends AbstractAzureTestCase { public static class TestPlugin extends Plugin { @Override @@ -54,7 +54,7 @@ public abstract class AbstractAzureRepositoryServiceTest extends AbstractAzureTe protected String basePath; private Class mock; - public AbstractAzureRepositoryServiceTest(String basePath) { + public AbstractAzureRepositoryServiceTestCaseCase(String basePath) { this.basePath = basePath; } diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureTestCase.java similarity index 97% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureTest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureTestCase.java index d99823b855c..39e6d1b428a 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureTestCase.java @@ -37,7 +37,7 @@ import java.util.Collection; * in order to run these tests. */ @ThirdParty -public abstract class AbstractAzureTest extends ESIntegTestCase { +public abstract class AbstractAzureTestCase extends ESIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTest.java index d2d559bc3ad..fa19137614a 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTest.java @@ -19,7 +19,7 @@ package org.elasticsearch.discovery.azure; -import org.elasticsearch.cloud.azure.AbstractAzureComputeServiceTest; +import org.elasticsearch.cloud.azure.AbstractAzureComputeServiceTestCase; import org.elasticsearch.cloud.azure.AzureComputeServiceTwoNodesMock; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.discovery.MasterNotDiscoveredException; @@ -41,7 +41,7 @@ import static org.hamcrest.Matchers.nullValue; transportClientRatio = 0.0, numClientNodes = 0) @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch-cloud-azure/issues/89") -public class AzureMinimumMasterNodesTest extends AbstractAzureComputeServiceTest { +public class AzureMinimumMasterNodesTest extends AbstractAzureComputeServiceTestCase { public AzureMinimumMasterNodesTest() { super(AzureComputeServiceTwoNodesMock.TestPlugin.class); diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTest.java index e46fadd7f03..4dcfacf21a1 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTest.java @@ -19,7 +19,7 @@ package org.elasticsearch.discovery.azure; -import org.elasticsearch.cloud.azure.AbstractAzureComputeServiceTest; +import org.elasticsearch.cloud.azure.AbstractAzureComputeServiceTestCase; import org.elasticsearch.cloud.azure.management.AzureComputeService.Discovery; import org.elasticsearch.cloud.azure.management.AzureComputeService.Management; import org.elasticsearch.cloud.azure.AzureComputeServiceSimpleMock; @@ -33,7 +33,7 @@ import static org.hamcrest.Matchers.notNullValue; numDataNodes = 0, transportClientRatio = 0.0, numClientNodes = 0) -public class AzureSimpleTest extends AbstractAzureComputeServiceTest { +public class AzureSimpleTest extends AbstractAzureComputeServiceTestCase { public AzureSimpleTest() { super(AzureComputeServiceSimpleMock.TestPlugin.class); diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTest.java index 3b6287c65ce..a52deeb0fa8 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTest.java @@ -19,7 +19,7 @@ package org.elasticsearch.discovery.azure; -import org.elasticsearch.cloud.azure.AbstractAzureComputeServiceTest; +import org.elasticsearch.cloud.azure.AbstractAzureComputeServiceTestCase; import org.elasticsearch.cloud.azure.management.AzureComputeService.Discovery; import org.elasticsearch.cloud.azure.management.AzureComputeService.Management; import org.elasticsearch.cloud.azure.AzureComputeServiceTwoNodesMock; @@ -33,7 +33,7 @@ import static org.hamcrest.Matchers.notNullValue; numDataNodes = 0, transportClientRatio = 0.0, numClientNodes = 0) -public class AzureTwoStartedNodesTest extends AbstractAzureComputeServiceTest { +public class AzureTwoStartedNodesTest extends AbstractAzureComputeServiceTestCase { public AzureTwoStartedNodesTest() { super(AzureComputeServiceTwoNodesMock.TestPlugin.class); diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/AbstractAzureFsTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/AbstractAzureFsTestCase.java similarity index 96% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/AbstractAzureFsTest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/AbstractAzureFsTestCase.java index 04407ce2d25..12eacc4a5a7 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/AbstractAzureFsTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/AbstractAzureFsTestCase.java @@ -30,7 +30,7 @@ import java.util.Collection; import static org.hamcrest.Matchers.is; -abstract public class AbstractAzureFsTest extends ESIntegTestCase { +abstract public class AbstractAzureFsTestCase extends ESIntegTestCase { @Override protected Collection> nodePlugins() { diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbMMapFsTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbMMapFsTest.java index 820f50071c7..90bc85aac69 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbMMapFsTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbMMapFsTest.java @@ -20,10 +20,9 @@ package org.elasticsearch.index.store; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.plugin.cloud.azure.CloudAzurePlugin; -public class SmbMMapFsTest extends AbstractAzureFsTest { +public class SmbMMapFsTest extends AbstractAzureFsTestCase { @Override public Settings indexSettings() { diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTest.java index d4bd02f6b52..18be4967361 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTest.java @@ -20,10 +20,9 @@ package org.elasticsearch.index.store; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.plugin.cloud.azure.CloudAzurePlugin; -public class SmbSimpleFsTest extends AbstractAzureFsTest { +public class SmbSimpleFsTest extends AbstractAzureFsTestCase { @Override public Settings indexSettings() { return Settings.builder() diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreITest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreITest.java index 1326a0e66d8..a0039e2c255 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreITest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreITest.java @@ -27,7 +27,7 @@ import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRes import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.client.Client; import org.elasticsearch.client.ClusterAdminClient; -import org.elasticsearch.cloud.azure.AbstractAzureTest; +import org.elasticsearch.cloud.azure.AbstractAzureTestCase; import org.elasticsearch.cloud.azure.storage.AzureStorageService; import org.elasticsearch.cloud.azure.storage.AzureStorageServiceImpl; import org.elasticsearch.cluster.ClusterState; @@ -55,13 +55,13 @@ import static org.hamcrest.Matchers.greaterThan; /** * This test needs Azure to run and -Dtests.thirdparty=true to be set * and -Dtests.config=/path/to/elasticsearch.yml - * @see org.elasticsearch.cloud.azure.AbstractAzureTest + * @see AbstractAzureTestCase */ @ESIntegTestCase.ClusterScope( scope = ESIntegTestCase.Scope.SUITE, numDataNodes = 1, transportClientRatio = 0.0) -public class AzureSnapshotRestoreITest extends AbstractAzureTest { +public class AzureSnapshotRestoreITest extends AbstractAzureTestCase { private String getRepositoryPath() { String testName = "it-".concat(Strings.toUnderscoreCase(getTestName()).replaceAll("_", "-")); diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTest.java index fec61b8e677..b0475335870 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTest.java @@ -24,8 +24,7 @@ import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResp import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse; import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.client.Client; -import org.elasticsearch.cloud.azure.AbstractAzureRepositoryServiceTest; -import org.elasticsearch.cloud.azure.storage.AzureStorageServiceMock; +import org.elasticsearch.cloud.azure.AbstractAzureRepositoryServiceTestCaseCase; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; @@ -41,7 +40,7 @@ import static org.hamcrest.Matchers.greaterThan; numDataNodes = 1, numClientNodes = 0, transportClientRatio = 0.0) -public class AzureSnapshotRestoreTest extends AbstractAzureRepositoryServiceTest { +public class AzureSnapshotRestoreTest extends AbstractAzureRepositoryServiceTestCaseCase { public AzureSnapshotRestoreTest() { super("/snapshot-test/repo-" + randomInt()); From 425e4c34927f88e154d809c76173b7cdc1eac519 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 2 Sep 2015 12:13:37 -0700 Subject: [PATCH 25/40] Tests: Remove stress tests These are not actually tests, but command line applications that must be run manually. This change removes the entire stresstest package. We can add back individual tests that we find necessary, and make them real tests (whether integ or not). --- .../elasticsearch/NamingConventionTests.java | 9 +- ...essTest.java => NodesStressBenchmark.java} | 24 +- .../stresstest/client/ClientFailover.java | 90 ----- .../fullrestart/FullRestartStressTest.java | 222 ----------- .../gcbehavior/FilterCacheGcStress.java | 70 ---- .../stresstest/get/GetStressTest.java | 96 ----- .../stresstest/get/MGetStress1.java | 106 ----- .../indexing/BulkIndexingStressTest.java | 71 ---- ...oncurrentIndexingVersioningStressTest.java | 118 ------ .../stresstest/leaks/GenericStatsLeak.java | 47 --- .../stresstest/leaks/JvmStatsLeak.java | 35 -- .../ManyIndicesRemoteStressTest.java | 77 ---- .../manyindices/ManyIndicesStressTest.java | 98 ----- ...anyNodesManyIndicesRecoveryStressTest.java | 126 ------ .../refresh/RefreshStressTest1.java | 96 ----- .../QuickRollingRestartStressTest.java | 124 ------ .../RollingRestartStressTest.java | 354 ----------------- ...oncurrentSearchSerializationBenchmark.java | 110 ------ .../search1/ParentChildStressTest.java | 237 ----------- .../search1/Search1StressBenchmark.java | 374 ------------------ pom.xml | 1 - 21 files changed, 14 insertions(+), 2471 deletions(-) rename core/src/test/java/org/elasticsearch/benchmark/stress/{NodesStressTest.java => NodesStressBenchmark.java} (91%) delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/client/ClientFailover.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/fullrestart/FullRestartStressTest.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/gcbehavior/FilterCacheGcStress.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/get/GetStressTest.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/get/MGetStress1.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/indexing/BulkIndexingStressTest.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/indexing/ConcurrentIndexingVersioningStressTest.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/leaks/GenericStatsLeak.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/leaks/JvmStatsLeak.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyIndicesRemoteStressTest.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyIndicesStressTest.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyNodesManyIndicesRecoveryStressTest.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/refresh/RefreshStressTest1.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/rollingrestart/QuickRollingRestartStressTest.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/rollingrestart/RollingRestartStressTest.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/search1/ConcurrentSearchSerializationBenchmark.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/search1/ParentChildStressTest.java delete mode 100644 core/src/test/java/org/elasticsearch/stresstest/search1/Search1StressBenchmark.java diff --git a/core/src/test/java/org/elasticsearch/NamingConventionTests.java b/core/src/test/java/org/elasticsearch/NamingConventionTests.java index bbd451195d0..2d0c8d885b7 100644 --- a/core/src/test/java/org/elasticsearch/NamingConventionTests.java +++ b/core/src/test/java/org/elasticsearch/NamingConventionTests.java @@ -59,16 +59,11 @@ public class NamingConventionTests extends ESTestCase { for (final String packageName : packages) { final String path = "/" + packageName.replace('.', '/'); final Path startPath = getDataPath(path); - final Set ignore = Sets.newHashSet(PathUtils.get("/org/elasticsearch/stresstest"), PathUtils.get("/org/elasticsearch/benchmark/stress")); Files.walkFileTree(startPath, new FileVisitor() { private Path pkgPrefix = PathUtils.get(path).getParent(); @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { - Path next = pkgPrefix.resolve(dir.getFileName()); - if (ignore.contains(next)) { - return FileVisitResult.SKIP_SUBTREE; - } - pkgPrefix = next; + pkgPrefix = pkgPrefix.resolve(dir.getFileName()); return FileVisitResult.CONTINUE; } @@ -170,7 +165,7 @@ public class NamingConventionTests extends ESTestCase { innerClasses.isEmpty()); assertTrue("Pure Unit-Test found must subclass one of [" + classesToSubclass +"]:\n" + Joiner.on('\n').join(pureUnitTest), pureUnitTest.isEmpty()); - assertTrue("Classes ending with Test|Tests] must subclass [" + classesToSubclass +"]:\n" + Joiner.on('\n').join(notImplementing), + assertTrue("Classes ending with [Test|Tests] must subclass [" + classesToSubclass +"]:\n" + Joiner.on('\n').join(notImplementing), notImplementing.isEmpty()); assertTrue("Subclasses of ESIntegTestCase should end with IT as they are integration tests:\n" + Joiner.on('\n').join(integTestsInDisguise), integTestsInDisguise.isEmpty()); diff --git a/core/src/test/java/org/elasticsearch/benchmark/stress/NodesStressTest.java b/core/src/test/java/org/elasticsearch/benchmark/stress/NodesStressBenchmark.java similarity index 91% rename from core/src/test/java/org/elasticsearch/benchmark/stress/NodesStressTest.java rename to core/src/test/java/org/elasticsearch/benchmark/stress/NodesStressBenchmark.java index 1f532345992..92dd8ad964e 100644 --- a/core/src/test/java/org/elasticsearch/benchmark/stress/NodesStressTest.java +++ b/core/src/test/java/org/elasticsearch/benchmark/stress/NodesStressBenchmark.java @@ -46,7 +46,7 @@ import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; /** * */ -public class NodesStressTest { +public class NodesStressBenchmark { private Node[] nodes; @@ -71,50 +71,50 @@ public class NodesStressTest { private CyclicBarrier barrier1; private CyclicBarrier barrier2; - public NodesStressTest() { + public NodesStressBenchmark() { } - public NodesStressTest numberOfNodes(int numberOfNodes) { + public NodesStressBenchmark numberOfNodes(int numberOfNodes) { this.numberOfNodes = numberOfNodes; return this; } - public NodesStressTest fieldNumLimit(int fieldNumLimit) { + public NodesStressBenchmark fieldNumLimit(int fieldNumLimit) { this.fieldNumLimit = fieldNumLimit; return this; } - public NodesStressTest searchIterations(int searchIterations) { + public NodesStressBenchmark searchIterations(int searchIterations) { this.searcherIterations = searchIterations; return this; } - public NodesStressTest searcherThreads(int numberOfSearcherThreads) { + public NodesStressBenchmark searcherThreads(int numberOfSearcherThreads) { searcherThreads = new Searcher[numberOfSearcherThreads]; return this; } - public NodesStressTest indexIterations(long indexIterations) { + public NodesStressBenchmark indexIterations(long indexIterations) { this.indexIterations = indexIterations; return this; } - public NodesStressTest indexThreads(int numberOfWriterThreads) { + public NodesStressBenchmark indexThreads(int numberOfWriterThreads) { indexThreads = new Indexer[numberOfWriterThreads]; return this; } - public NodesStressTest sleepAfterDone(TimeValue time) { + public NodesStressBenchmark sleepAfterDone(TimeValue time) { this.sleepAfterDone = time; return this; } - public NodesStressTest sleepBeforeClose(TimeValue time) { + public NodesStressBenchmark sleepBeforeClose(TimeValue time) { this.sleepBeforeClose = time; return this; } - public NodesStressTest build(Settings settings) throws Exception { + public NodesStressBenchmark build(Settings settings) throws Exception { settings = settingsBuilder() // .put("index.refresh_interval", 1, TimeUnit.SECONDS) .put(SETTING_NUMBER_OF_SHARDS, 5) @@ -267,7 +267,7 @@ public class NodesStressTest { } public static void main(String[] args) throws Exception { - NodesStressTest test = new NodesStressTest() + NodesStressBenchmark test = new NodesStressBenchmark() .numberOfNodes(2) .indexThreads(5) .indexIterations(10 * 1000) diff --git a/core/src/test/java/org/elasticsearch/stresstest/client/ClientFailover.java b/core/src/test/java/org/elasticsearch/stresstest/client/ClientFailover.java deleted file mode 100644 index 946685190a6..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/client/ClientFailover.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.client; - -import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.common.transport.InetSocketTransportAddress; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.net.InetAddress; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; - -/** - */ -public class ClientFailover { - - public static void main(String[] args) throws Exception { - Node[] nodes = new Node[3]; - for (int i = 0; i < nodes.length; i++) { - nodes[i] = NodeBuilder.nodeBuilder().node(); - } - - // TODO: what is this? a public static void main test?!?! - - final TransportClient client = TransportClient.builder().build() - .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300)) - .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9301)) - .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9302)); - - final AtomicBoolean done = new AtomicBoolean(); - final AtomicLong indexed = new AtomicLong(); - final CountDownLatch latch = new CountDownLatch(1); - Thread indexer = new Thread(new Runnable() { - @Override - public void run() { - while (!done.get()) { - try { - client.prepareIndex("test", "type").setSource("field", "value").execute().actionGet(); - indexed.incrementAndGet(); - } catch (Exception e) { - e.printStackTrace(); - } - } - latch.countDown(); - } - }); - indexer.start(); - - for (int i = 0; i < 100; i++) { - int index = i % nodes.length; - nodes[index].close(); - - ClusterHealthResponse health = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet(); - if (health.isTimedOut()) { - System.err.println("timed out on health"); - } - - nodes[index] = NodeBuilder.nodeBuilder().node(); - - health = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet(); - if (health.isTimedOut()) { - System.err.println("timed out on health"); - } - } - - latch.await(); - - // TODO add verification to the number of indexed docs - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/fullrestart/FullRestartStressTest.java b/core/src/test/java/org/elasticsearch/stresstest/fullrestart/FullRestartStressTest.java deleted file mode 100644 index 59fca1b672b..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/fullrestart/FullRestartStressTest.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.fullrestart; - -import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; -import org.elasticsearch.action.bulk.BulkRequestBuilder; -import org.elasticsearch.action.count.CountResponse; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.Requests; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.logging.ESLogger; -import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.util.Random; -import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.atomic.AtomicLong; - -import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; - -/** - * - */ -public class FullRestartStressTest { - - private final ESLogger logger = Loggers.getLogger(getClass()); - - private int numberOfNodes = 4; - - private int numberOfIndices = 5; - private int textTokens = 150; - private int numberOfFields = 10; - private int bulkSize = 1000; - private int numberOfDocsPerRound = 50000; - - private Settings settings = Settings.Builder.EMPTY_SETTINGS; - - private TimeValue period = TimeValue.timeValueMinutes(20); - - private AtomicLong indexCounter = new AtomicLong(); - - public FullRestartStressTest numberOfNodes(int numberOfNodes) { - this.numberOfNodes = numberOfNodes; - return this; - } - - public FullRestartStressTest numberOfIndices(int numberOfIndices) { - this.numberOfIndices = numberOfIndices; - return this; - } - - public FullRestartStressTest textTokens(int textTokens) { - this.textTokens = textTokens; - return this; - } - - public FullRestartStressTest numberOfFields(int numberOfFields) { - this.numberOfFields = numberOfFields; - return this; - } - - public FullRestartStressTest bulkSize(int bulkSize) { - this.bulkSize = bulkSize; - return this; - } - - public FullRestartStressTest numberOfDocsPerRound(int numberOfDocsPerRound) { - this.numberOfDocsPerRound = numberOfDocsPerRound; - return this; - } - - public FullRestartStressTest settings(Settings settings) { - this.settings = settings; - return this; - } - - public FullRestartStressTest period(TimeValue period) { - this.period = period; - return this; - } - - public void run() throws Exception { - long numberOfRounds = 0; - Random random = new Random(0); - long testStart = System.currentTimeMillis(); - while (true) { - Node[] nodes = new Node[numberOfNodes]; - for (int i = 0; i < nodes.length; i++) { - nodes[i] = NodeBuilder.nodeBuilder().settings(settings).node(); - } - Node client = NodeBuilder.nodeBuilder().settings(settings).client(true).node(); - - // verify that the indices are there - for (int i = 0; i < numberOfIndices; i++) { - try { - client.client().admin().indices().prepareCreate("test" + i).execute().actionGet(); - } catch (Exception e) { - // might already exists, fine - } - } - - logger.info("*** Waiting for GREEN status"); - try { - ClusterHealthResponse clusterHealth = client.client().admin().cluster().prepareHealth().setWaitForGreenStatus().setTimeout("10m").execute().actionGet(); - if (clusterHealth.isTimedOut()) { - logger.warn("timed out waiting for green status...."); - } - } catch (Exception e) { - logger.warn("failed to execute cluster health...."); - } - - CountResponse count = client.client().prepareCount().setQuery(matchAllQuery()).execute().actionGet(); - logger.info("*** index_count [{}], expected_count [{}]", count.getCount(), indexCounter.get()); - // verify count - for (int i = 0; i < (nodes.length * 5); i++) { - count = client.client().prepareCount().setQuery(matchAllQuery()).execute().actionGet(); - logger.debug("index_count [{}], expected_count [{}]", count.getCount(), indexCounter.get()); - if (count.getCount() != indexCounter.get()) { - logger.warn("!!! count does not match, index_count [{}], expected_count [{}]", count.getCount(), indexCounter.get()); - throw new Exception("failed test, count does not match..."); - } - } - - // verify search - for (int i = 0; i < (nodes.length * 5); i++) { - // do a search with norms field, so we don't rely on match all filtering cache - SearchResponse search = client.client().prepareSearch().setQuery(matchAllQuery()).execute().actionGet(); - logger.debug("index_count [{}], expected_count [{}]", search.getHits().totalHits(), indexCounter.get()); - if (count.getCount() != indexCounter.get()) { - logger.warn("!!! search does not match, index_count [{}], expected_count [{}]", search.getHits().totalHits(), indexCounter.get()); - throw new Exception("failed test, count does not match..."); - } - } - - logger.info("*** ROUND {}", ++numberOfRounds); - // bulk index data - int numberOfBulks = numberOfDocsPerRound / bulkSize; - for (int b = 0; b < numberOfBulks; b++) { - BulkRequestBuilder bulk = client.client().prepareBulk(); - for (int k = 0; k < bulkSize; k++) { - StringBuilder sb = new StringBuilder(); - XContentBuilder json = XContentFactory.jsonBuilder().startObject() - .field("field", "value" + ThreadLocalRandom.current().nextInt()); - - int fields = ThreadLocalRandom.current().nextInt() % numberOfFields; - for (int i = 0; i < fields; i++) { - json.field("num_" + i, ThreadLocalRandom.current().nextDouble()); - int tokens = ThreadLocalRandom.current().nextInt() % textTokens; - sb.setLength(0); - for (int j = 0; j < tokens; j++) { - sb.append(Strings.randomBase64UUID(random)).append(' '); - } - json.field("text_" + i, sb.toString()); - } - - json.endObject(); - - bulk.add(Requests.indexRequest("test" + (Math.abs(ThreadLocalRandom.current().nextInt()) % numberOfIndices)).type("type1").source(json)); - indexCounter.incrementAndGet(); - } - bulk.execute().actionGet(); - } - - client.close(); - for (Node node : nodes) { - node.close(); - } - - if ((System.currentTimeMillis() - testStart) > period.millis()) { - logger.info("test finished, full_restart_rounds [{}]", numberOfRounds); - break; - } - - } - } - - public static void main(String[] args) throws Exception { - System.setProperty("es.logger.prefix", ""); - - int numberOfNodes = 2; - Settings settings = Settings.settingsBuilder() - .put("index.shard.check_on_startup", true) - .put("gateway.recover_after_nodes", numberOfNodes) - .put("index.number_of_shards", 1) - .put("path.data", "data/data1,data/data2") - .build(); - - FullRestartStressTest test = new FullRestartStressTest() - .settings(settings) - .period(TimeValue.timeValueMinutes(20)) - .numberOfNodes(numberOfNodes) - .numberOfIndices(1) - .textTokens(150) - .numberOfFields(10) - .bulkSize(1000) - .numberOfDocsPerRound(10000); - - test.run(); - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/gcbehavior/FilterCacheGcStress.java b/core/src/test/java/org/elasticsearch/stresstest/gcbehavior/FilterCacheGcStress.java deleted file mode 100644 index 315dab87039..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/gcbehavior/FilterCacheGcStress.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.gcbehavior; - -import org.elasticsearch.client.Client; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.util.concurrent.atomic.AtomicBoolean; - -import static org.elasticsearch.index.query.QueryBuilders.rangeQuery; -import static org.elasticsearch.index.query.QueryBuilders.filteredQuery; -import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; - -public class FilterCacheGcStress { - - public static void main(String[] args) { - - Settings settings = Settings.EMPTY; - - Node node = NodeBuilder.nodeBuilder().settings(settings).node(); - final Client client = node.client(); - - client.admin().indices().prepareCreate("test").execute().actionGet(); - client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(); - - final AtomicBoolean stop = new AtomicBoolean(); - - Thread indexingThread = new Thread() { - @Override - public void run() { - while (!stop.get()) { - client.prepareIndex("test", "type1").setSource("field", System.currentTimeMillis()).execute().actionGet(); - } - } - }; - indexingThread.start(); - - Thread searchThread = new Thread() { - @Override - public void run() { - while (!stop.get()) { - client.prepareSearch() - .setQuery(filteredQuery(matchAllQuery(), rangeQuery("field").from(System.currentTimeMillis() - 1000000))) - .execute().actionGet(); - } - } - }; - - searchThread.start(); - } -} \ No newline at end of file diff --git a/core/src/test/java/org/elasticsearch/stresstest/get/GetStressTest.java b/core/src/test/java/org/elasticsearch/stresstest/get/GetStressTest.java deleted file mode 100644 index 33d4b6f866d..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/get/GetStressTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.get; - -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; - -public class GetStressTest { - - public static void main(String[] args) throws Exception { - Settings settings = Settings.settingsBuilder() - .put("index.number_of_shards", 2) - .put("index.number_of_replicas", 1) - .build(); - - final int NUMBER_OF_NODES = 2; - final int NUMBER_OF_THREADS = 50; - final TimeValue TEST_TIME = TimeValue.parseTimeValue("10m", null, "TEST_TIME"); - - Node[] nodes = new Node[NUMBER_OF_NODES]; - for (int i = 0; i < nodes.length; i++) { - nodes[i] = NodeBuilder.nodeBuilder().settings(settings).node(); - } - - final Node client = NodeBuilder.nodeBuilder() - .settings(settings) - .client(true) - .node(); - - client.client().admin().indices().prepareCreate("test").execute().actionGet(); - - final AtomicBoolean done = new AtomicBoolean(); - final AtomicLong idGenerator = new AtomicLong(); - final AtomicLong counter = new AtomicLong(); - - Thread[] threads = new Thread[NUMBER_OF_THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new Thread(new Runnable() { - @Override - public void run() { - ThreadLocalRandom random = ThreadLocalRandom.current(); - while (!done.get()) { - String id = String.valueOf(idGenerator.incrementAndGet()); - client.client().prepareIndex("test", "type1", id) - .setSource("field", random.nextInt(100)) - .execute().actionGet(); - - GetResponse getResponse = client.client().prepareGet("test", "type1", id) - //.setFields(Strings.EMPTY_ARRAY) - .execute().actionGet(); - if (!getResponse.isExists()) { - System.err.println("Failed to find " + id); - } - - long count = counter.incrementAndGet(); - if ((count % 10000) == 0) { - System.out.println("Executed " + count); - } - } - } - }); - } - for (Thread thread : threads) { - thread.start(); - } - - Thread.sleep(TEST_TIME.millis()); - - System.out.println("test done."); - done.set(true); - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/get/MGetStress1.java b/core/src/test/java/org/elasticsearch/stresstest/get/MGetStress1.java deleted file mode 100644 index 3118c221216..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/get/MGetStress1.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.get; - -import com.google.common.collect.Sets; -import org.elasticsearch.action.get.MultiGetItemResponse; -import org.elasticsearch.action.get.MultiGetResponse; -import org.elasticsearch.client.Client; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.util.Set; -import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.atomic.AtomicBoolean; - -/** - */ -public class MGetStress1 { - - public static void main(String[] args) throws Exception { - final int NUMBER_OF_NODES = 2; - final int NUMBER_OF_DOCS = 50000; - final int MGET_BATCH = 1000; - - Node[] nodes = new Node[NUMBER_OF_NODES]; - for (int i = 0; i < nodes.length; i++) { - nodes[i] = NodeBuilder.nodeBuilder().node(); - } - - System.out.println("---> START Indexing initial data [" + NUMBER_OF_DOCS + "]"); - final Client client = nodes[0].client(); - for (int i = 0; i < NUMBER_OF_DOCS; i++) { - client.prepareIndex("test", "type", Integer.toString(i)).setSource("field", "value").execute().actionGet(); - } - System.out.println("---> DONE Indexing initial data [" + NUMBER_OF_DOCS + "]"); - - final AtomicBoolean done = new AtomicBoolean(); - // start indexer - Thread indexer = new Thread(new Runnable() { - @Override - public void run() { - while (!done.get()) { - client.prepareIndex("test", "type", Integer.toString(ThreadLocalRandom.current().nextInt(NUMBER_OF_DOCS))) - .setSource("field", "value").execute().actionGet(); - } - } - }); - indexer.start(); - System.out.println("---> Starting indexer"); - - // start the mget one - Thread mget = new Thread(new Runnable() { - @Override - public void run() { - while (!done.get()) { - Set ids = Sets.newHashSet(); - for (int i = 0; i < MGET_BATCH; i++) { - ids.add(Integer.toString(ThreadLocalRandom.current().nextInt(NUMBER_OF_DOCS))); - } - //System.out.println("---> mget for [" + ids.size() + "]"); - MultiGetResponse response = client.prepareMultiGet().add("test", "type", ids).execute().actionGet(); - int expected = ids.size(); - int count = 0; - for (MultiGetItemResponse item : response) { - count++; - if (item.isFailed()) { - System.err.println("item failed... " + item.getFailure()); - } else { - boolean removed = ids.remove(item.getId()); - if (!removed) { - System.err.println("got id twice " + item.getId()); - } - } - } - if (expected != count) { - System.err.println("Expected [" + expected + "], got back [" + count + "]"); - } - } - } - }); - mget.start(); - System.out.println("---> Starting mget"); - - Thread.sleep(TimeValue.timeValueMinutes(10).millis()); - - done.set(true); - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/indexing/BulkIndexingStressTest.java b/core/src/test/java/org/elasticsearch/stresstest/indexing/BulkIndexingStressTest.java deleted file mode 100644 index 640a523ebd0..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/indexing/BulkIndexingStressTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.indexing; - -import org.elasticsearch.action.bulk.BulkItemResponse; -import org.elasticsearch.action.bulk.BulkRequestBuilder; -import org.elasticsearch.action.bulk.BulkResponse; -import org.elasticsearch.client.Client; -import org.elasticsearch.client.Requests; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.util.concurrent.ThreadLocalRandom; - -/** - */ -public class BulkIndexingStressTest { - - public static void main(String[] args) { - final int NUMBER_OF_NODES = 4; - final int NUMBER_OF_INDICES = 600; - final int BATCH = 300; - - final Settings nodeSettings = Settings.settingsBuilder().put("index.number_of_shards", 2).build(); - -// ESLogger logger = Loggers.getLogger("org.elasticsearch"); -// logger.setLevel("DEBUG"); - Node[] nodes = new Node[NUMBER_OF_NODES]; - for (int i = 0; i < nodes.length; i++) { - nodes[i] = NodeBuilder.nodeBuilder().settings(nodeSettings).node(); - } - - Client client = nodes.length == 1 ? nodes[0].client() : nodes[1].client(); - - while (true) { - BulkRequestBuilder bulkRequest = client.prepareBulk(); - for (int i = 0; i < BATCH; i++) { - bulkRequest.add(Requests.indexRequest("test" + ThreadLocalRandom.current().nextInt(NUMBER_OF_INDICES)).type("type").source("field", "value")); - } - BulkResponse bulkResponse = bulkRequest.execute().actionGet(); - if (bulkResponse.hasFailures()) { - for (BulkItemResponse item : bulkResponse) { - if (item.isFailed()) { - System.out.println("failed response:" + item.getFailureMessage()); - } - } - - throw new RuntimeException("Failed responses"); - } - ; - } - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/indexing/ConcurrentIndexingVersioningStressTest.java b/core/src/test/java/org/elasticsearch/stresstest/indexing/ConcurrentIndexingVersioningStressTest.java deleted file mode 100644 index 3fca8141b81..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/indexing/ConcurrentIndexingVersioningStressTest.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.indexing; - -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.SizeValue; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.node.Node; - -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ThreadLocalRandom; - -import static org.elasticsearch.node.NodeBuilder.nodeBuilder; - -/** - * Checks that index operation does not create duplicate documents. - */ -public class ConcurrentIndexingVersioningStressTest { - - public static void main(String[] args) throws Exception { - - Settings settings = Settings.EMPTY; - - Node node1 = nodeBuilder().settings(settings).node(); - Node node2 = nodeBuilder().settings(settings).node(); - final Node client = nodeBuilder().settings(settings).client(true).node(); - - final int NUMBER_OF_DOCS = 10000; - final int NUMBER_OF_THREADS = 10; - final long NUMBER_OF_ITERATIONS = SizeValue.parseSizeValue("10k").singles(); - final long DELETE_EVERY = 10; - - final CountDownLatch latch = new CountDownLatch(NUMBER_OF_THREADS); - Thread[] threads = new Thread[NUMBER_OF_THREADS]; - for (int i = 0; i < threads.length; i++) { - threads[i] = new Thread() { - @Override - public void run() { - try { - for (long i = 0; i < NUMBER_OF_ITERATIONS; i++) { - if ((i % DELETE_EVERY) == 0) { - client.client().prepareDelete("test", "type1", Integer.toString(ThreadLocalRandom.current().nextInt(NUMBER_OF_DOCS))).execute().actionGet(); - } else { - client.client().prepareIndex("test", "type1", Integer.toString(ThreadLocalRandom.current().nextInt(NUMBER_OF_DOCS))).setSource("field1", "value1").execute().actionGet(); - } - } - } finally { - latch.countDown(); - } - } - }; - } - - for (Thread thread : threads) { - thread.start(); - } - - latch.await(); - System.out.println("done indexing, verifying docs"); - client.client().admin().indices().prepareRefresh().execute().actionGet(); - for (int i = 0; i < NUMBER_OF_DOCS; i++) { - String id = Integer.toString(i); - for (int j = 0; j < 5; j++) { - SearchResponse response = client.client().prepareSearch().setQuery(QueryBuilders.termQuery("_id", id)).execute().actionGet(); - if (response.getHits().totalHits() > 1) { - System.err.println("[" + i + "] FAIL, HITS [" + response.getHits().totalHits() + "]"); - } - } - GetResponse getResponse = client.client().prepareGet("test", "type1", id).execute().actionGet(); - if (getResponse.isExists()) { - long version = getResponse.getVersion(); - for (int j = 0; j < 5; j++) { - getResponse = client.client().prepareGet("test", "type1", id).execute().actionGet(); - if (!getResponse.isExists()) { - System.err.println("[" + i + "] FAIL, EXISTED, and NOT_EXISTED"); - break; - } - if (version != getResponse.getVersion()) { - System.err.println("[" + i + "] FAIL, DIFFERENT VERSIONS: [" + version + "], [" + getResponse.getVersion() + "]"); - break; - } - } - } else { - for (int j = 0; j < 5; j++) { - getResponse = client.client().prepareGet("test", "type1", id).execute().actionGet(); - if (getResponse.isExists()) { - System.err.println("[" + i + "] FAIL, EXISTED, and NOT_EXISTED"); - break; - } - } - } - } - System.out.println("done."); - - client.close(); - node1.close(); - node2.close(); - } -} \ No newline at end of file diff --git a/core/src/test/java/org/elasticsearch/stresstest/leaks/GenericStatsLeak.java b/core/src/test/java/org/elasticsearch/stresstest/leaks/GenericStatsLeak.java deleted file mode 100644 index fc0d5bc5253..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/leaks/GenericStatsLeak.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.leaks; - -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.monitor.jvm.JvmService; -import org.elasticsearch.monitor.os.OsService; -import org.elasticsearch.monitor.process.ProcessService; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -public class GenericStatsLeak { - - public static void main(String[] args) { - Node node = NodeBuilder.nodeBuilder().settings(Settings.settingsBuilder() - .put("monitor.os.refresh_interval", 0) - .put("monitor.process.refresh_interval", 0) - ).node(); - - JvmService jvmService = node.injector().getInstance(JvmService.class); - OsService osService = node.injector().getInstance(OsService.class); - ProcessService processService = node.injector().getInstance(ProcessService.class); - - while (true) { - jvmService.stats(); - osService.stats(); - processService.stats(); - } - } -} \ No newline at end of file diff --git a/core/src/test/java/org/elasticsearch/stresstest/leaks/JvmStatsLeak.java b/core/src/test/java/org/elasticsearch/stresstest/leaks/JvmStatsLeak.java deleted file mode 100644 index e558b47bea5..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/leaks/JvmStatsLeak.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.leaks; - -import org.elasticsearch.monitor.jvm.JvmStats; - -/** - * This test mainly comes to check the native memory leak with getLastGCInfo (which is now - * disabled by default). - */ -public class JvmStatsLeak { - - public static void main(String[] args) { - while (true) { - JvmStats.jvmStats(); - } - } -} \ No newline at end of file diff --git a/core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyIndicesRemoteStressTest.java b/core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyIndicesRemoteStressTest.java deleted file mode 100644 index 1917fd6a0b0..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyIndicesRemoteStressTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.manyindices; - -import org.elasticsearch.client.Client; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.common.logging.ESLogger; -import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.InetSocketTransportAddress; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.net.InetAddress; -import java.util.Date; - -/** - * - */ -public class ManyIndicesRemoteStressTest { - - private static final ESLogger logger = Loggers.getLogger(ManyIndicesRemoteStressTest.class); - - public static void main(String[] args) throws Exception { - System.setProperty("es.logger.prefix", ""); - - int numberOfShards = 1; - int numberOfReplicas = 1; - int numberOfIndices = 1000; - int numberOfDocs = 1; - - Client client; - Node node = null; - // TODO: what is this? a public static void main test?!?!?! - if (true) { - client = TransportClient.builder().settings(Settings.EMPTY).build().addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300)); - } else { - node = NodeBuilder.nodeBuilder().client(true).node(); - client = node.client(); - } - - for (int i = 0; i < numberOfIndices; i++) { - logger.info("START index [{}] ...", i); - client.admin().indices().prepareCreate("index_" + i) - .setSettings(Settings.settingsBuilder().put("index.number_of_shards", numberOfShards).put("index.number_of_replicas", numberOfReplicas)) - .execute().actionGet(); - - for (int j = 0; j < numberOfDocs; j++) { - client.prepareIndex("index_" + i, "type").setSource("field1", "test", "field2", 2, "field3", new Date()).execute().actionGet(); - } - logger.info("DONE index [{}]", i); - } - - logger.info("closing node..."); - if (node != null) { - node.close(); - } - logger.info("node closed"); - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyIndicesStressTest.java b/core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyIndicesStressTest.java deleted file mode 100644 index 01476f177c5..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyIndicesStressTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.manyindices; - -import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.common.logging.ESLogger; -import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.util.Date; - -import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; - -/** - * - */ -public class ManyIndicesStressTest { - - private static final ESLogger logger = Loggers.getLogger(ManyIndicesStressTest.class); - - public static void main(String[] args) throws Exception { - System.setProperty("es.logger.prefix", ""); - - int numberOfIndices = 100; - int numberOfDocs = 100; - - Settings settings = Settings.settingsBuilder() - .put("index.shard.check_on_startup", false) - .put("index.number_of_shards", 1) - .build(); - Node node = NodeBuilder.nodeBuilder().settings(settings).node(); - - for (int i = 0; i < numberOfIndices; i++) { - logger.info("START index [{}] ...", i); - node.client().admin().indices().prepareCreate("index_" + i).execute().actionGet(); - - for (int j = 0; j < numberOfDocs; j++) { - node.client().prepareIndex("index_" + i, "type").setSource("field1", "test", "field2", 2, "field3", new Date()).execute().actionGet(); - } - logger.info("DONE index [{}] ...", i); - } - - logger.info("closing node..."); - node.close(); - logger.info("node closed"); - - logger.info("starting node..."); - node = NodeBuilder.nodeBuilder().settings(settings).node(); - - ClusterHealthResponse health = node.client().admin().cluster().prepareHealth().setTimeout("5m").setWaitForYellowStatus().execute().actionGet(); - logger.info("health: " + health.getStatus()); - logger.info("active shards: " + health.getActiveShards()); - logger.info("active primary shards: " + health.getActivePrimaryShards()); - if (health.isTimedOut()) { - logger.error("Timed out on health..."); - } - - ClusterState clusterState = node.client().admin().cluster().prepareState().execute().actionGet().getState(); - for (int i = 0; i < numberOfIndices; i++) { - if (clusterState.blocks().indices().containsKey("index_" + i)) { - logger.error("index [{}] has blocks: {}", i, clusterState.blocks().indices().get("index_" + i)); - } - } - - for (int i = 0; i < numberOfIndices; i++) { - long count = node.client().prepareCount("index_" + i).setQuery(matchAllQuery()).execute().actionGet().getCount(); - if (count == numberOfDocs) { - logger.info("VERIFIED [{}], count [{}]", i, count); - } else { - logger.error("FAILED [{}], expected [{}], got [{}]", i, numberOfDocs, count); - } - } - - logger.info("closing node..."); - node.close(); - logger.info("node closed"); - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyNodesManyIndicesRecoveryStressTest.java b/core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyNodesManyIndicesRecoveryStressTest.java deleted file mode 100644 index ccd25a1607f..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/manyindices/ManyNodesManyIndicesRecoveryStressTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.manyindices; - -import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; -import org.elasticsearch.action.count.CountResponse; -import org.elasticsearch.client.Client; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.util.ArrayList; -import java.util.List; - -public class ManyNodesManyIndicesRecoveryStressTest { - - public static void main(String[] args) throws Exception { - final int NUM_NODES = 40; - final int NUM_INDICES = 100; - final int NUM_DOCS = 2; - final int FLUSH_AFTER = 1; - - final Settings nodeSettings = Settings.settingsBuilder() - .put("transport.netty.connections_per_node.low", 0) - .put("transport.netty.connections_per_node.med", 0) - .put("transport.netty.connections_per_node.high", 1) - .build(); - - final Settings indexSettings = Settings.settingsBuilder() - .put("index.number_of_shards", 1) - .build(); - - List nodes = new ArrayList<>(); - for (int i = 0; i < NUM_NODES; i++) { - nodes.add(NodeBuilder.nodeBuilder().settings(Settings.settingsBuilder().put(nodeSettings).put("name", "node" + i)).node()); - } - Client client = nodes.get(0).client(); - - for (int index = 0; index < NUM_INDICES; index++) { - String indexName = "index_" + index; - System.out.println("--> Processing index [" + indexName + "]..."); - client.admin().indices().prepareCreate(indexName).setSettings(indexSettings).execute().actionGet(); - - boolean flushed = false; - for (int doc = 0; doc < NUM_DOCS; doc++) { - if (!flushed && doc > FLUSH_AFTER) { - flushed = true; - client.admin().indices().prepareFlush(indexName).execute().actionGet(); - } - client.prepareIndex(indexName, "type1", Integer.toString(doc)).setSource("field", "value" + doc).execute().actionGet(); - } - System.out.println("--> DONE index [" + indexName + "]"); - } - - System.out.println("--> Initiating shutdown"); - for (Node node : nodes) { - node.close(); - } - - System.out.println("--> Waiting for all nodes to be closed..."); - while (true) { - boolean allAreClosed = true; - for (Node node : nodes) { - if (!node.isClosed()) { - allAreClosed = false; - break; - } - } - if (allAreClosed) { - break; - } - Thread.sleep(100); - } - System.out.println("Waiting a bit for node lock to really be released?"); - Thread.sleep(5000); - System.out.println("--> All nodes are closed, starting back..."); - - nodes = new ArrayList<>(); - for (int i = 0; i < NUM_NODES; i++) { - nodes.add(NodeBuilder.nodeBuilder().settings(Settings.settingsBuilder().put(nodeSettings).put("name", "node" + i)).node()); - } - client = nodes.get(0).client(); - - System.out.println("--> Waiting for green status"); - while (true) { - ClusterHealthResponse clusterHealth = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet(); - if (clusterHealth.isTimedOut()) { - System.err.println("--> cluster health timed out..., active shards [" + clusterHealth.getActiveShards() + "]"); - } else { - break; - } - } - - System.out.println("Verifying counts..."); - for (int index = 0; index < NUM_INDICES; index++) { - String indexName = "index_" + index; - CountResponse count = client.prepareCount(indexName).setQuery(QueryBuilders.matchAllQuery()).execute().actionGet(); - if (count.getCount() != NUM_DOCS) { - System.err.println("Wrong count value, expected [" + NUM_DOCS + "], got [" + count.getCount() + "] for index [" + indexName + "]"); - } - } - - System.out.println("Test end"); - for (Node node : nodes) { - node.close(); - } - } -} \ No newline at end of file diff --git a/core/src/test/java/org/elasticsearch/stresstest/refresh/RefreshStressTest1.java b/core/src/test/java/org/elasticsearch/stresstest/refresh/RefreshStressTest1.java deleted file mode 100644 index eec385241e3..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/refresh/RefreshStressTest1.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.refresh; - -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.Client; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.io.IOException; -import java.util.UUID; - -/** - */ -public class RefreshStressTest1 { - - public static void main(String[] args) throws InterruptedException, IOException { - int numberOfShards = 5; - Node node = NodeBuilder.nodeBuilder().local(true).loadConfigSettings(false).clusterName("testCluster").settings( - Settings.settingsBuilder() - .put("node.name", "node1") - .put("index.number_of_shards", numberOfShards) - //.put("path.data", new File("target/data").getAbsolutePath()) - .build()).node(); - Node node2 = NodeBuilder.nodeBuilder().local(true).loadConfigSettings(false).clusterName("testCluster").settings( - Settings.settingsBuilder() - .put("node.name", "node2") - .put("index.number_of_shards", numberOfShards) - //.put("path.data", new File("target/data").getAbsolutePath()) - .build()).node(); - Client client = node.client(); - - for (int loop = 1; loop < 1000; loop++) { - String indexName = "testindex" + loop; - String typeName = "testType" + loop; - String id = UUID.randomUUID().toString(); - String mapping = "{ \"" + typeName + "\" : {\"dynamic_templates\" : [{\"no_analyze_strings\" : {\"match_mapping_type\" : \"string\",\"match\" : \"*\",\"mapping\" : {\"type\" : \"string\",\"index\" : \"not_analyzed\"}}}]}}"; - client.admin().indices().prepareCreate(indexName).execute().actionGet(); - client.admin().indices().preparePutMapping(indexName).setType(typeName).setSource(mapping).execute().actionGet(); -// sleep after put mapping -// Thread.sleep(100); - - System.out.println("indexing " + loop); - String name = "name" + id; - client.prepareIndex(indexName, typeName, id).setSource("{ \"id\": \"" + id + "\", \"name\": \"" + name + "\" }").execute().actionGet(); - - client.admin().indices().prepareRefresh(indexName).execute().actionGet(); -// sleep after refresh -// Thread.sleep(100); - - System.out.println("searching " + loop); - SearchResponse result = client.prepareSearch(indexName).setPostFilter(QueryBuilders.termQuery("name", name)).execute().actionGet(); - if (result.getHits().hits().length != 1) { - for (int i = 1; i <= 100; i++) { - System.out.println("retry " + loop + ", " + i + ", previous total hits: " + result.getHits().getTotalHits()); - client.admin().indices().prepareRefresh(indexName).execute().actionGet(); - Thread.sleep(100); - result = client.prepareSearch(indexName).setPostFilter(QueryBuilders.termQuery("name", name)).execute().actionGet(); - if (result.getHits().hits().length == 1) { - client.admin().indices().prepareRefresh(indexName).execute().actionGet(); - result = client.prepareSearch(indexName).setPostFilter(QueryBuilders.termQuery("name", name)).execute().actionGet(); - throw new RuntimeException("Record found after " + (i * 100) + " ms, second go: " + result.getHits().hits().length); - } else if (i == 100) { - if (client.prepareGet(indexName, typeName, id).execute().actionGet().isExists()) - throw new RuntimeException("Record wasn't found after 10s but can be get by id"); - else throw new RuntimeException("Record wasn't found after 10s and can't be get by id"); - } - } - } - - //client.admin().indices().prepareDelete(indexName).execute().actionGet(); - } - client.close(); - node2.close(); - node.close(); - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/rollingrestart/QuickRollingRestartStressTest.java b/core/src/test/java/org/elasticsearch/stresstest/rollingrestart/QuickRollingRestartStressTest.java deleted file mode 100644 index a2fd5d84c93..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/rollingrestart/QuickRollingRestartStressTest.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.rollingrestart; - -import com.carrotsearch.randomizedtesting.generators.RandomStrings; -import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.SizeValue; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; - -import java.util.Date; -import java.util.Random; -import java.util.concurrent.ThreadLocalRandom; - -/** - */ -public class QuickRollingRestartStressTest { - - public static void main(String[] args) throws Exception { - System.setProperty("es.logger.prefix", ""); - - Random random = new Random(); - - Settings settings = Settings.settingsBuilder().build(); - - Node[] nodes = new Node[5]; - for (int i = 0; i < nodes.length; i++) { - nodes[i] = NodeBuilder.nodeBuilder().settings(settings).node(); - } - - Node client = NodeBuilder.nodeBuilder().client(true).node(); - - long COUNT; - if (client.client().admin().indices().prepareExists("test").execute().actionGet().isExists()) { - ClusterHealthResponse clusterHealthResponse = client.client().admin().cluster().prepareHealth().setWaitForGreenStatus().setTimeout("10m").execute().actionGet(); - if (clusterHealthResponse.isTimedOut()) { - throw new ElasticsearchException("failed to wait for green state on startup..."); - } - COUNT = client.client().prepareCount().execute().actionGet().getCount(); - System.out.println("--> existing index, count [" + COUNT + "]"); - } else { - COUNT = SizeValue.parseSizeValue("100k").singles(); - System.out.println("--> indexing data..."); - for (long i = 0; i < COUNT; i++) { - client.client().prepareIndex("test", "type", Long.toString(i)) - .setSource("date", new Date(), "data", RandomStrings.randomAsciiOfLength(random, 10000)) - .execute().actionGet(); - } - System.out.println("--> done indexing data [" + COUNT + "]"); - client.client().admin().indices().prepareRefresh().execute().actionGet(); - for (int i = 0; i < 10; i++) { - long count = client.client().prepareCount().execute().actionGet().getCount(); - if (COUNT != count) { - System.err.println("--> the indexed docs do not match the count..., got [" + count + "], expected [" + COUNT + "]"); - } - } - } - - final int ROLLING_RESTARTS = 100; - System.out.println("--> starting rolling restarts [" + ROLLING_RESTARTS + "]"); - for (int rollingRestart = 0; rollingRestart < ROLLING_RESTARTS; rollingRestart++) { - System.out.println("--> doing rolling restart [" + rollingRestart + "]..."); - int nodeId = ThreadLocalRandom.current().nextInt(); - for (int i = 0; i < nodes.length; i++) { - int nodeIdx = Math.abs(nodeId++) % nodes.length; - nodes[nodeIdx].close(); - nodes[nodeIdx] = NodeBuilder.nodeBuilder().settings(settings).node(); - } - System.out.println("--> done rolling restart [" + rollingRestart + "]"); - - System.out.println("--> waiting for green state now..."); - ClusterHealthResponse clusterHealthResponse = client.client().admin().cluster().prepareHealth().setWaitForGreenStatus().setWaitForRelocatingShards(0).setTimeout("10m").execute().actionGet(); - if (clusterHealthResponse.isTimedOut()) { - System.err.println("--> timed out waiting for green state..."); - ClusterState state = client.client().admin().cluster().prepareState().execute().actionGet().getState(); - System.out.println(state.nodes().prettyPrint()); - System.out.println(state.routingTable().prettyPrint()); - System.out.println(state.getRoutingNodes().prettyPrint()); - throw new ElasticsearchException("timed out waiting for green state"); - } else { - System.out.println("--> got green status"); - } - - System.out.println("--> checking data [" + rollingRestart + "]...."); - boolean failed = false; - for (int i = 0; i < 10; i++) { - long count = client.client().prepareCount().execute().actionGet().getCount(); - if (COUNT != count) { - failed = true; - System.err.println("--> ERROR the indexed docs do not match the count..., got [" + count + "], expected [" + COUNT + "]"); - } - } - if (!failed) { - System.out.println("--> count verified"); - } - } - - System.out.println("--> shutting down..."); - client.close(); - for (Node node : nodes) { - node.close(); - } - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/rollingrestart/RollingRestartStressTest.java b/core/src/test/java/org/elasticsearch/stresstest/rollingrestart/RollingRestartStressTest.java deleted file mode 100644 index 76e27a5554e..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/rollingrestart/RollingRestartStressTest.java +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.rollingrestart; - -import org.apache.lucene.util.IOUtils; -import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; -import org.elasticsearch.action.count.CountResponse; -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.logging.ESLogger; -import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.env.NodeEnvironment; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; -import org.elasticsearch.search.SearchHit; - -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Random; -import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.atomic.AtomicLong; - -import static org.elasticsearch.common.settings.Settings.settingsBuilder; -import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; - -/** - * - */ -public class RollingRestartStressTest { - - private final ESLogger logger = Loggers.getLogger(getClass()); - - private int numberOfShards = 5; - private int numberOfReplicas = 1; - private int numberOfNodes = 4; - - private int textTokens = 150; - private int numberOfFields = 10; - private long initialNumberOfDocs = 100000; - - private int indexers = 0; - - private TimeValue indexerThrottle = TimeValue.timeValueMillis(100); - - private Settings settings = Settings.Builder.EMPTY_SETTINGS; - - private TimeValue period = TimeValue.timeValueMinutes(20); - - private boolean clearNodeData = true; - - private Node client; - - private AtomicLong indexCounter = new AtomicLong(); - private AtomicLong idCounter = new AtomicLong(); - - - public RollingRestartStressTest numberOfNodes(int numberOfNodes) { - this.numberOfNodes = numberOfNodes; - return this; - } - - public RollingRestartStressTest numberOfShards(int numberOfShards) { - this.numberOfShards = numberOfShards; - return this; - } - - public RollingRestartStressTest numberOfReplicas(int numberOfReplicas) { - this.numberOfReplicas = numberOfReplicas; - return this; - } - - public RollingRestartStressTest initialNumberOfDocs(long initialNumberOfDocs) { - this.initialNumberOfDocs = initialNumberOfDocs; - return this; - } - - public RollingRestartStressTest textTokens(int textTokens) { - this.textTokens = textTokens; - return this; - } - - public RollingRestartStressTest numberOfFields(int numberOfFields) { - this.numberOfFields = numberOfFields; - return this; - } - - public RollingRestartStressTest indexers(int indexers) { - this.indexers = indexers; - return this; - } - - public RollingRestartStressTest indexerThrottle(TimeValue indexerThrottle) { - this.indexerThrottle = indexerThrottle; - return this; - } - - public RollingRestartStressTest period(TimeValue period) { - this.period = period; - return this; - } - - public RollingRestartStressTest cleanNodeData(boolean clearNodeData) { - this.clearNodeData = clearNodeData; - return this; - } - - public RollingRestartStressTest settings(Settings settings) { - this.settings = settings; - return this; - } - - public void run() throws Exception { - Random random = new Random(0); - - Node[] nodes = new Node[numberOfNodes]; - for (int i = 0; i < nodes.length; i++) { - nodes[i] = NodeBuilder.nodeBuilder().settings(settings).node(); - } - client = NodeBuilder.nodeBuilder().settings(settings).client(true).node(); - - client.client().admin().indices().prepareCreate("test").setSettings(settingsBuilder() - .put("index.number_of_shards", numberOfShards) - .put("index.number_of_replicas", numberOfReplicas) - ).execute().actionGet(); - - logger.info("********** [START] INDEXING INITIAL DOCS"); - for (long i = 0; i < initialNumberOfDocs; i++) { - indexDoc(random); - } - logger.info("********** [DONE ] INDEXING INITIAL DOCS"); - - Indexer[] indexerThreads = new Indexer[indexers]; - for (int i = 0; i < indexerThreads.length; i++) { - indexerThreads[i] = new Indexer(); - } - for (int i = 0; i < indexerThreads.length; i++) { - indexerThreads[i].start(); - } - - long testStart = System.currentTimeMillis(); - - // start doing the rolling restart - int nodeIndex = 0; - while (true) { - Path[] nodeData = nodes[nodeIndex].injector().getInstance(NodeEnvironment.class).nodeDataPaths(); - nodes[nodeIndex].close(); - if (clearNodeData) { - try { - IOUtils.rm(nodeData); - } catch (Exception ex) { - logger.debug("Failed to delete node data directories", ex); - - } - } - - try { - ClusterHealthResponse clusterHealth = client.client().admin().cluster().prepareHealth() - .setWaitForGreenStatus() - .setWaitForNodes(Integer.toString(numberOfNodes + 0 /* client node*/)) - .setWaitForRelocatingShards(0) - .setTimeout("10m").execute().actionGet(); - if (clusterHealth.isTimedOut()) { - logger.warn("timed out waiting for green status...."); - } - } catch (Exception e) { - logger.warn("failed to execute cluster health...."); - } - - nodes[nodeIndex] = NodeBuilder.nodeBuilder().settings(settings).node(); - - Thread.sleep(1000); - - try { - ClusterHealthResponse clusterHealth = client.client().admin().cluster().prepareHealth() - .setWaitForGreenStatus() - .setWaitForNodes(Integer.toString(numberOfNodes + 1 /* client node*/)) - .setWaitForRelocatingShards(0) - .setTimeout("10m").execute().actionGet(); - if (clusterHealth.isTimedOut()) { - logger.warn("timed out waiting for green status...."); - } - } catch (Exception e) { - logger.warn("failed to execute cluster health...."); - } - - if (++nodeIndex == nodes.length) { - nodeIndex = 0; - } - - if ((System.currentTimeMillis() - testStart) > period.millis()) { - logger.info("test finished"); - break; - } - } - - for (int i = 0; i < indexerThreads.length; i++) { - indexerThreads[i].close = true; - } - - Thread.sleep(indexerThrottle.millis() + 10000); - - for (int i = 0; i < indexerThreads.length; i++) { - if (!indexerThreads[i].closed) { - logger.warn("thread not closed!"); - } - } - - client.client().admin().indices().prepareRefresh().execute().actionGet(); - - // check the count - for (int i = 0; i < (nodes.length * 5); i++) { - CountResponse count = client.client().prepareCount().setQuery(matchAllQuery()).execute().actionGet(); - logger.info("indexed [{}], count [{}], [{}]", count.getCount(), indexCounter.get(), count.getCount() == indexCounter.get() ? "OK" : "FAIL"); - if (count.getCount() != indexCounter.get()) { - logger.warn("count does not match!"); - } - } - - // scan all the docs, verify all have the same version based on the number of replicas - SearchResponse searchResponse = client.client().prepareSearch() - .setSearchType(SearchType.SCAN) - .setQuery(matchAllQuery()) - .setSize(50) - .setScroll(TimeValue.timeValueMinutes(2)) - .execute().actionGet(); - logger.info("Verifying versions for {} hits...", searchResponse.getHits().totalHits()); - - while (true) { - searchResponse = client.client().prepareSearchScroll(searchResponse.getScrollId()).setScroll(TimeValue.timeValueMinutes(2)).execute().actionGet(); - if (searchResponse.getFailedShards() > 0) { - logger.warn("Search Failures " + Arrays.toString(searchResponse.getShardFailures())); - } - for (SearchHit hit : searchResponse.getHits()) { - long version = -1; - for (int i = 0; i < (numberOfReplicas + 1); i++) { - GetResponse getResponse = client.client().prepareGet(hit.index(), hit.type(), hit.id()).execute().actionGet(); - if (version == -1) { - version = getResponse.getVersion(); - } else { - if (version != getResponse.getVersion()) { - logger.warn("Doc {} has different version numbers {} and {}", hit.id(), version, getResponse.getVersion()); - } - } - } - } - if (searchResponse.getHits().hits().length == 0) { - break; - } - } - logger.info("Done verifying versions"); - - client.close(); - for (Node node : nodes) { - node.close(); - } - } - - private class Indexer extends Thread { - - volatile boolean close = false; - - volatile boolean closed = false; - - @Override - public void run() { - Random random = new Random(0); - while (true) { - if (close) { - closed = true; - return; - } - try { - indexDoc(random); - Thread.sleep(indexerThrottle.millis()); - } catch (Exception e) { - logger.warn("failed to index / sleep", e); - } - } - } - } - - private void indexDoc(Random random) throws Exception { - StringBuilder sb = new StringBuilder(); - XContentBuilder json = XContentFactory.jsonBuilder().startObject() - .field("field", "value" + ThreadLocalRandom.current().nextInt()); - - int fields = Math.abs(ThreadLocalRandom.current().nextInt()) % numberOfFields; - for (int i = 0; i < fields; i++) { - json.field("num_" + i, ThreadLocalRandom.current().nextDouble()); - int tokens = ThreadLocalRandom.current().nextInt() % textTokens; - sb.setLength(0); - for (int j = 0; j < tokens; j++) { - sb.append(Strings.randomBase64UUID(random)).append(' '); - } - json.field("text_" + i, sb.toString()); - } - - json.endObject(); - - String id = Long.toString(idCounter.incrementAndGet()); - client.client().prepareIndex("test", "type1", id) - .setCreate(true) - .setSource(json) - .execute().actionGet(); - indexCounter.incrementAndGet(); - } - - public static void main(String[] args) throws Exception { - System.setProperty("es.logger.prefix", ""); - - Settings settings = settingsBuilder() - .put("index.shard.check_on_startup", true) - .put("path.data", "data/data1,data/data2") - .build(); - - RollingRestartStressTest test = new RollingRestartStressTest() - .settings(settings) - .numberOfNodes(4) - .numberOfShards(5) - .numberOfReplicas(1) - .initialNumberOfDocs(1000) - .textTokens(150) - .numberOfFields(10) - .cleanNodeData(false) - .indexers(5) - .indexerThrottle(TimeValue.timeValueMillis(50)) - .period(TimeValue.timeValueMinutes(3)); - - test.run(); - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/search1/ConcurrentSearchSerializationBenchmark.java b/core/src/test/java/org/elasticsearch/stresstest/search1/ConcurrentSearchSerializationBenchmark.java deleted file mode 100644 index a0f883bd768..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/search1/ConcurrentSearchSerializationBenchmark.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.search1; - -import com.carrotsearch.randomizedtesting.generators.RandomStrings; -import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.index.IndexResponse; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.Client; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; -import org.elasticsearch.search.SearchHit; -import org.junit.Ignore; - -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ThreadLocalRandom; - -/** - * Tests that data don't get corrupted while reading it over the streams. - *

- * See: https://github.com/elasticsearch/elasticsearch/issues/1686. - */ -public class ConcurrentSearchSerializationBenchmark { - - public static void main(String[] args) throws Exception { - - Node node1 = NodeBuilder.nodeBuilder().node(); - Node node2 = NodeBuilder.nodeBuilder().node(); - Node node3 = NodeBuilder.nodeBuilder().node(); - - final Client client = node1.client(); - - System.out.println("Indexing..."); - final String data = RandomStrings.randomAsciiOfLength(ThreadLocalRandom.current(), 100); - final CountDownLatch latch1 = new CountDownLatch(100); - for (int i = 0; i < 100; i++) { - client.prepareIndex("test", "type", Integer.toString(i)) - .setSource("field", data) - .execute(new ActionListener() { - @Override - public void onResponse(IndexResponse indexResponse) { - latch1.countDown(); - } - - @Override - public void onFailure(Throwable e) { - latch1.countDown(); - } - }); - } - latch1.await(); - System.out.println("Indexed"); - - System.out.println("searching..."); - Thread[] threads = new Thread[10]; - final CountDownLatch latch = new CountDownLatch(threads.length); - for (int i = 0; i < threads.length; i++) { - threads[i] = new Thread(new Runnable() { - @Override - public void run() { - for (int i = 0; i < 1000; i++) { - SearchResponse searchResponse = client.prepareSearch("test") - .setQuery(QueryBuilders.matchAllQuery()) - .setSize(i % 100) - .execute().actionGet(); - for (SearchHit hit : searchResponse.getHits()) { - try { - if (!hit.sourceAsMap().get("field").equals(data)) { - System.err.println("Field not equal!"); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - latch.countDown(); - } - }); - } - for (Thread thread : threads) { - thread.start(); - } - - latch.await(); - - System.out.println("done searching"); - client.close(); - node1.close(); - node2.close(); - node3.close(); - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/search1/ParentChildStressTest.java b/core/src/test/java/org/elasticsearch/stresstest/search1/ParentChildStressTest.java deleted file mode 100644 index 23943f97078..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/search1/ParentChildStressTest.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.search1; - -import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.ShardSearchFailure; -import org.elasticsearch.client.Client; -import org.elasticsearch.client.Requests; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.transport.RemoteTransportException; - -import java.io.IOException; -import java.util.*; - - -public class ParentChildStressTest { - - private Node elasticNode; - private Client client; - - private static final String PARENT_TYPE_NAME = "content"; - private static final String CHILD_TYPE_NAME = "contentFiles"; - private static final String INDEX_NAME = "acme"; - - /** - * Constructor. Initialize elastic and create the index/mapping - */ - public ParentChildStressTest() { - NodeBuilder nodeBuilder = NodeBuilder.nodeBuilder(); - Settings settings = nodeBuilder.settings() - .build(); - this.elasticNode = nodeBuilder.settings(settings).client(true).node(); - this.client = this.elasticNode.client(); - - String mapping = - "{\"contentFiles\": {" + - "\"_parent\": {" + - "\"type\" : \"content\"" + - "}}}"; - - try { - client.admin().indices().create(new CreateIndexRequest(INDEX_NAME).mapping(CHILD_TYPE_NAME, mapping)).actionGet(); - } catch (RemoteTransportException e) { - // usually means the index is already created. - } - } - - public void shutdown() throws IOException { - client.close(); - elasticNode.close(); - } - - /** - * Deletes the item from both the parent and child type locations. - */ - public void deleteById(String id) { - client.prepareDelete(INDEX_NAME, PARENT_TYPE_NAME, id).execute().actionGet(); - client.prepareDelete(INDEX_NAME, CHILD_TYPE_NAME, id).execute().actionGet(); - } - - /** - * Index a parent doc - */ - public void indexParent(String id, Map objectMap) throws IOException { - XContentBuilder builder = XContentFactory.jsonBuilder(); - - // index content - client.prepareIndex(INDEX_NAME, PARENT_TYPE_NAME, id).setSource(builder.map(objectMap)).execute().actionGet(); - } - - /** - * Index the file as a child doc - */ - public void indexChild(String id, Map objectMap) throws IOException { - XContentBuilder builder = XContentFactory.jsonBuilder(); - - IndexRequestBuilder indexRequestbuilder = client.prepareIndex(INDEX_NAME, CHILD_TYPE_NAME, id); - indexRequestbuilder = indexRequestbuilder.setParent(id); - indexRequestbuilder = indexRequestbuilder.setSource(builder.map(objectMap)); - indexRequestbuilder.execute().actionGet(); - } - - /** - * Execute a search based on a JSON String in QueryDSL format. - *

- * Throws a RuntimeException if there are any shard failures to - * elevate the visibility of the problem. - */ - public List executeSearch(String source) { - SearchRequest request = Requests.searchRequest(INDEX_NAME).source(source); - - List failures; - SearchResponse response; - - response = client.search(request).actionGet(); - failures = Arrays.asList(response.getShardFailures()); - - // throw an exception so that we see the shard failures - if (failures.size() != 0) { - String failuresStr = failures.toString(); - if (!failuresStr.contains("reason [No active shards]")) { - throw new RuntimeException(failures.toString()); - } - } - - ArrayList results = new ArrayList<>(); - if (response != null) { - for (SearchHit hit : response.getHits()) { - String sourceStr = hit.sourceAsString(); - results.add(sourceStr); - } - } - return results; - } - - /** - * Create a document as a parent and index it. - * Load a file and index it as a child. - */ - public String indexDoc() throws IOException { - String id = UUID.randomUUID().toString(); - - Map objectMap = new HashMap<>(); - objectMap.put("title", "this is a document"); - - Map objectMap2 = new HashMap<>(); - objectMap2.put("description", "child test"); - - this.indexParent(id, objectMap); - this.indexChild(id, objectMap2); - return id; - } - - /** - * Perform the has_child query for the doc. - *

- * Since it might take time to get indexed, it - * loops until it finds the doc. - */ - public void searchDocByChild() throws InterruptedException { - String dslString = - "{\"query\":{" + - "\"has_child\":{" + - "\"query\":{" + - "\"field\":{" + - "\"description\":\"child test\"}}," + - "\"type\":\"contentFiles\"}}}"; - - int numTries = 0; - List items = new ArrayList<>(); - - while (items.size() != 1 && numTries < 20) { - items = executeSearch(dslString); - - numTries++; - if (items.size() != 1) { - Thread.sleep(250); - } - } - if (items.size() != 1) { - System.out.println("Exceeded number of retries"); - System.exit(1); - } - } - - /** - * Program to loop on: - * create parent/child doc - * search for the doc - * delete the doc - * repeat the above until shard failure. - *

- * Eventually fails with: - *

- * [shard [[74wz0lrXRSmSOsJOqgPvlw][acme][1]], reason [RemoteTransportException - * [[Kismet][inet[/10.10.30.52:9300]][search/phase/query]]; nested: - * QueryPhaseExecutionException[[acme][1]: - * query[ConstantScore(child_filter[contentFiles - * /content](filtered(file:mission - * file:statement)->FilterCacheFilterWrapper( - * _type:contentFiles)))],from[0],size[10]: Query Failed [Failed to execute - * child query [filtered(file:mission - * file:statement)->FilterCacheFilterWrapper(_type:contentFiles)]]]; nested: - * ]] - * - * @param args - */ - public static void main(String[] args) throws IOException { - ParentChildStressTest elasticTest = new ParentChildStressTest(); - try { - // loop a bunch of times - usually fails before the count is done. - int NUM_LOOPS = 1000; - System.out.println(); - System.out.println("Looping [" + NUM_LOOPS + "] times:"); - System.out.println(); - for (int i = 0; i < NUM_LOOPS; i++) { - String id = elasticTest.indexDoc(); - - elasticTest.searchDocByChild(); - - elasticTest.deleteById(id); - - System.out.println(" Success: " + i); - } - elasticTest.shutdown(); - } catch (Exception e) { - e.printStackTrace(); - } finally { - elasticTest.shutdown(); - } - } -} diff --git a/core/src/test/java/org/elasticsearch/stresstest/search1/Search1StressBenchmark.java b/core/src/test/java/org/elasticsearch/stresstest/search1/Search1StressBenchmark.java deleted file mode 100644 index 001c234ec69..00000000000 --- a/core/src/test/java/org/elasticsearch/stresstest/search1/Search1StressBenchmark.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.stresstest.search1; - -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.common.logging.ESLogger; -import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.SizeValue; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.junit.Ignore; - -import java.util.Arrays; -import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.atomic.AtomicLong; - -import static org.elasticsearch.index.query.QueryBuilders.termQuery; - -public class Search1StressBenchmark { - - private final ESLogger logger = Loggers.getLogger(getClass()); - - - private int numberOfNodes = 4; - - private int indexers = 0; - private SizeValue preIndexDocs = new SizeValue(0); - private TimeValue indexerThrottle = TimeValue.timeValueMillis(100); - private int searchers = 0; - private TimeValue searcherThrottle = TimeValue.timeValueMillis(20); - private int numberOfIndices = 10; - private int numberOfTypes = 4; - private int numberOfValues = 20; - private int numberOfHits = 300; - private TimeValue flusherThrottle = TimeValue.timeValueMillis(1000); - - private Settings settings = Settings.Builder.EMPTY_SETTINGS; - - private TimeValue period = TimeValue.timeValueMinutes(20); - - private AtomicLong indexCounter = new AtomicLong(); - private AtomicLong searchCounter = new AtomicLong(); - - - private Node client; - - public Search1StressBenchmark setNumberOfNodes(int numberOfNodes) { - this.numberOfNodes = numberOfNodes; - return this; - } - - public Search1StressBenchmark setPreIndexDocs(SizeValue preIndexDocs) { - this.preIndexDocs = preIndexDocs; - return this; - } - - public Search1StressBenchmark setIndexers(int indexers) { - this.indexers = indexers; - return this; - } - - public Search1StressBenchmark setIndexerThrottle(TimeValue indexerThrottle) { - this.indexerThrottle = indexerThrottle; - return this; - } - - public Search1StressBenchmark setSearchers(int searchers) { - this.searchers = searchers; - return this; - } - - public Search1StressBenchmark setSearcherThrottle(TimeValue searcherThrottle) { - this.searcherThrottle = searcherThrottle; - return this; - } - - public Search1StressBenchmark setNumberOfIndices(int numberOfIndices) { - this.numberOfIndices = numberOfIndices; - return this; - } - - public Search1StressBenchmark setNumberOfTypes(int numberOfTypes) { - this.numberOfTypes = numberOfTypes; - return this; - } - - public Search1StressBenchmark setNumberOfValues(int numberOfValues) { - this.numberOfValues = numberOfValues; - return this; - } - - public Search1StressBenchmark setNumberOfHits(int numberOfHits) { - this.numberOfHits = numberOfHits; - return this; - } - - public Search1StressBenchmark setFlusherThrottle(TimeValue flusherThrottle) { - this.flusherThrottle = flusherThrottle; - return this; - } - - public Search1StressBenchmark setSettings(Settings settings) { - this.settings = settings; - return this; - } - - public Search1StressBenchmark setPeriod(TimeValue period) { - this.period = period; - return this; - } - - private String nextIndex() { - return "test" + Math.abs(ThreadLocalRandom.current().nextInt()) % numberOfIndices; - } - - private String nextType() { - return "type" + Math.abs(ThreadLocalRandom.current().nextInt()) % numberOfTypes; - } - - private int nextNumValue() { - return Math.abs(ThreadLocalRandom.current().nextInt()) % numberOfValues; - } - - private String nextFieldValue() { - return "value" + Math.abs(ThreadLocalRandom.current().nextInt()) % numberOfValues; - } - - private class Searcher extends Thread { - - volatile boolean close = false; - - volatile boolean closed = false; - - @Override - public void run() { - while (true) { - if (close) { - closed = true; - return; - } - try { - String indexName = nextIndex(); - SearchRequestBuilder builder = client.client().prepareSearch(indexName); - if (ThreadLocalRandom.current().nextBoolean()) { - builder.addSort("num", SortOrder.DESC); - } else if (ThreadLocalRandom.current().nextBoolean()) { - // add a _score based sorting, won't do any sorting, just to test... - builder.addSort("_score", SortOrder.DESC); - } - if (ThreadLocalRandom.current().nextBoolean()) { - builder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - } - int size = Math.abs(ThreadLocalRandom.current().nextInt()) % numberOfHits; - builder.setSize(size); - if (ThreadLocalRandom.current().nextBoolean()) { - // update from - builder.setFrom(size / 2); - } - String value = nextFieldValue(); - builder.setQuery(termQuery("field", value)); - searchCounter.incrementAndGet(); - SearchResponse searchResponse = builder.execute().actionGet(); - if (searchResponse.getFailedShards() > 0) { - logger.warn("failed search " + Arrays.toString(searchResponse.getShardFailures())); - } - // verify that all come from the requested index - for (SearchHit hit : searchResponse.getHits()) { - if (!hit.shard().index().equals(indexName)) { - logger.warn("got wrong index, asked for [{}], got [{}]", indexName, hit.shard().index()); - } - } - // verify that all has the relevant value - for (SearchHit hit : searchResponse.getHits()) { - if (!value.equals(hit.sourceAsMap().get("field"))) { - logger.warn("got wrong field, asked for [{}], got [{}]", value, hit.sourceAsMap().get("field")); - } - } - Thread.sleep(searcherThrottle.millis()); - } catch (Exception e) { - logger.warn("failed to search", e); - } - } - } - } - - private class Indexer extends Thread { - - volatile boolean close = false; - - volatile boolean closed = false; - - @Override - public void run() { - while (true) { - if (close) { - closed = true; - return; - } - try { - indexDoc(); - Thread.sleep(indexerThrottle.millis()); - } catch (Exception e) { - logger.warn("failed to index / sleep", e); - } - } - } - } - - private class Flusher extends Thread { - volatile boolean close = false; - - volatile boolean closed = false; - - @Override - public void run() { - while (true) { - if (close) { - closed = true; - return; - } - try { - client.client().admin().indices().prepareFlush().execute().actionGet(); - Thread.sleep(indexerThrottle.millis()); - } catch (Exception e) { - logger.warn("failed to flush / sleep", e); - } - } - } - } - - private void indexDoc() throws Exception { - XContentBuilder json = XContentFactory.jsonBuilder().startObject() - .field("num", nextNumValue()) - .field("field", nextFieldValue()); - - json.endObject(); - - client.client().prepareIndex(nextIndex(), nextType()) - .setSource(json) - .execute().actionGet(); - indexCounter.incrementAndGet(); - } - - public void run() throws Exception { - Node[] nodes = new Node[numberOfNodes]; - for (int i = 0; i < nodes.length; i++) { - nodes[i] = NodeBuilder.nodeBuilder().settings(settings).node(); - } - client = NodeBuilder.nodeBuilder().settings(settings).client(true).node(); - - for (int i = 0; i < numberOfIndices; i++) { - client.client().admin().indices().prepareCreate("test" + i).execute().actionGet(); - } - - logger.info("Pre indexing docs [{}]...", preIndexDocs); - for (long i = 0; i < preIndexDocs.singles(); i++) { - indexDoc(); - } - logger.info("Done pre indexing docs [{}]", preIndexDocs); - - Indexer[] indexerThreads = new Indexer[indexers]; - for (int i = 0; i < indexerThreads.length; i++) { - indexerThreads[i] = new Indexer(); - } - for (Indexer indexerThread : indexerThreads) { - indexerThread.start(); - } - - Thread.sleep(10000); - - Searcher[] searcherThreads = new Searcher[searchers]; - for (int i = 0; i < searcherThreads.length; i++) { - searcherThreads[i] = new Searcher(); - } - for (Searcher searcherThread : searcherThreads) { - searcherThread.start(); - } - - Flusher flusher = null; - if (flusherThrottle.millis() > 0) { - flusher = new Flusher(); - flusher.start(); - } - - long testStart = System.currentTimeMillis(); - - while (true) { - Thread.sleep(5000); - if ((System.currentTimeMillis() - testStart) > period.millis()) { - break; - } - } - - System.out.println("DONE, closing ....."); - - if (flusher != null) { - flusher.close = true; - } - - for (Searcher searcherThread : searcherThreads) { - searcherThread.close = true; - } - - for (Indexer indexerThread : indexerThreads) { - indexerThread.close = true; - } - - Thread.sleep(indexerThrottle.millis() + 10000); - - if (flusher != null && !flusher.closed) { - logger.warn("flusher not closed!"); - } - for (Searcher searcherThread : searcherThreads) { - if (!searcherThread.closed) { - logger.warn("search thread not closed!"); - } - } - for (Indexer indexerThread : indexerThreads) { - if (!indexerThread.closed) { - logger.warn("index thread not closed!"); - } - } - - client.close(); - for (Node node : nodes) { - node.close(); - } - - System.out.println("********** DONE, indexed [" + indexCounter.get() + "], searched [" + searchCounter.get() + "]"); - } - - public static void main(String[] args) throws Exception { - Search1StressBenchmark test = new Search1StressBenchmark() - .setPeriod(TimeValue.timeValueMinutes(10)) - .setNumberOfNodes(2) - .setPreIndexDocs(SizeValue.parseSizeValue("100")) - .setIndexers(2) - .setIndexerThrottle(TimeValue.timeValueMillis(100)) - .setSearchers(10) - .setSearcherThrottle(TimeValue.timeValueMillis(10)) - .setFlusherThrottle(TimeValue.timeValueMillis(1000)) - .setNumberOfIndices(10) - .setNumberOfTypes(5) - .setNumberOfValues(50) - .setNumberOfHits(300); - - test.run(); - } -} diff --git a/pom.xml b/pom.xml index 76e82959178..4baecd6cbe4 100644 --- a/pom.xml +++ b/pom.xml @@ -720,7 +720,6 @@ **/*$*.class - **/*StressTest.class From 0caa4733533fb3e31e25c8b2a0d62ee0d4a22dd8 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 2 Sep 2015 13:44:42 -0700 Subject: [PATCH 26/40] Remove benchmark/stress too --- .../stress/NodesStressBenchmark.java | 282 ------------------ .../stress/SingleThreadBulkStress.java | 123 -------- .../stress/SingleThreadIndexingStress.java | 108 ------- 3 files changed, 513 deletions(-) delete mode 100644 core/src/test/java/org/elasticsearch/benchmark/stress/NodesStressBenchmark.java delete mode 100644 core/src/test/java/org/elasticsearch/benchmark/stress/SingleThreadBulkStress.java delete mode 100644 core/src/test/java/org/elasticsearch/benchmark/stress/SingleThreadIndexingStress.java diff --git a/core/src/test/java/org/elasticsearch/benchmark/stress/NodesStressBenchmark.java b/core/src/test/java/org/elasticsearch/benchmark/stress/NodesStressBenchmark.java deleted file mode 100644 index 92dd8ad964e..00000000000 --- a/core/src/test/java/org/elasticsearch/benchmark/stress/NodesStressBenchmark.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.benchmark.stress; - -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.Client; -import org.elasticsearch.client.Requests; -import org.elasticsearch.common.StopWatch; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.node.Node; - -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.CyclicBarrier; -import java.util.concurrent.atomic.AtomicLong; - -import static org.elasticsearch.client.Requests.searchRequest; -import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS; -import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.settings.Settings.settingsBuilder; -import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS; -import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery; -import static org.elasticsearch.index.query.QueryBuilders.termQuery; -import static org.elasticsearch.node.NodeBuilder.nodeBuilder; -import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; - -/** - * - */ -public class NodesStressBenchmark { - - private Node[] nodes; - - private int numberOfNodes = 2; - - private Client[] clients; - - private AtomicLong idGenerator = new AtomicLong(); - - private int fieldNumLimit = 50; - - private long searcherIterations = 10; - private Searcher[] searcherThreads = new Searcher[1]; - - private long indexIterations = 10; - private Indexer[] indexThreads = new Indexer[1]; - - private TimeValue sleepAfterDone = TimeValue.timeValueMillis(0); - private TimeValue sleepBeforeClose = TimeValue.timeValueMillis(0); - - private CountDownLatch latch; - private CyclicBarrier barrier1; - private CyclicBarrier barrier2; - - public NodesStressBenchmark() { - } - - public NodesStressBenchmark numberOfNodes(int numberOfNodes) { - this.numberOfNodes = numberOfNodes; - return this; - } - - public NodesStressBenchmark fieldNumLimit(int fieldNumLimit) { - this.fieldNumLimit = fieldNumLimit; - return this; - } - - public NodesStressBenchmark searchIterations(int searchIterations) { - this.searcherIterations = searchIterations; - return this; - } - - public NodesStressBenchmark searcherThreads(int numberOfSearcherThreads) { - searcherThreads = new Searcher[numberOfSearcherThreads]; - return this; - } - - public NodesStressBenchmark indexIterations(long indexIterations) { - this.indexIterations = indexIterations; - return this; - } - - public NodesStressBenchmark indexThreads(int numberOfWriterThreads) { - indexThreads = new Indexer[numberOfWriterThreads]; - return this; - } - - public NodesStressBenchmark sleepAfterDone(TimeValue time) { - this.sleepAfterDone = time; - return this; - } - - public NodesStressBenchmark sleepBeforeClose(TimeValue time) { - this.sleepBeforeClose = time; - return this; - } - - public NodesStressBenchmark build(Settings settings) throws Exception { - settings = settingsBuilder() -// .put("index.refresh_interval", 1, TimeUnit.SECONDS) - .put(SETTING_NUMBER_OF_SHARDS, 5) - .put(SETTING_NUMBER_OF_REPLICAS, 1) - .put(settings) - .build(); - - nodes = new Node[numberOfNodes]; - clients = new Client[numberOfNodes]; - for (int i = 0; i < numberOfNodes; i++) { - nodes[i] = nodeBuilder().settings(settingsBuilder().put(settings).put("name", "node" + i)).node(); - clients[i] = nodes[i].client(); - } - - for (int i = 0; i < searcherThreads.length; i++) { - searcherThreads[i] = new Searcher(i); - } - for (int i = 0; i < indexThreads.length; i++) { - indexThreads[i] = new Indexer(i); - } - - latch = new CountDownLatch(1); - barrier1 = new CyclicBarrier(2); - barrier2 = new CyclicBarrier(2); - // warmup - StopWatch stopWatch = new StopWatch().start(); - Indexer warmup = new Indexer(-1).max(10000); - warmup.start(); - barrier1.await(); - barrier2.await(); - latch.await(); - stopWatch.stop(); - System.out.println("Done Warmup, took [" + stopWatch.totalTime() + "]"); - - latch = new CountDownLatch(searcherThreads.length + indexThreads.length); - barrier1 = new CyclicBarrier(searcherThreads.length + indexThreads.length + 1); - barrier2 = new CyclicBarrier(searcherThreads.length + indexThreads.length + 1); - - return this; - } - - public void start() throws Exception { - for (Thread t : searcherThreads) { - t.start(); - } - for (Thread t : indexThreads) { - t.start(); - } - barrier1.await(); - - StopWatch stopWatch = new StopWatch(); - stopWatch.start(); - - barrier2.await(); - - latch.await(); - stopWatch.stop(); - - System.out.println("Done, took [" + stopWatch.totalTime() + "]"); - System.out.println("Sleeping before close: " + sleepBeforeClose); - Thread.sleep(sleepBeforeClose.millis()); - - for (Client client : clients) { - client.close(); - } - for (Node node : nodes) { - node.close(); - } - - System.out.println("Sleeping before exit: " + sleepBeforeClose); - Thread.sleep(sleepAfterDone.millis()); - } - - class Searcher extends Thread { - final int id; - long counter = 0; - long max = searcherIterations; - - Searcher(int id) { - super("Searcher" + id); - this.id = id; - } - - @Override - public void run() { - try { - barrier1.await(); - barrier2.await(); - for (; counter < max; counter++) { - Client client = client(counter); - QueryBuilder query = termQuery("num", counter % fieldNumLimit); - query = constantScoreQuery(query); - - SearchResponse search = client.search(searchRequest() - .source(searchSource().query(query))) - .actionGet(); -// System.out.println("Got search response, hits [" + search.hits().totalHits() + "]"); - } - } catch (Exception e) { - System.err.println("Failed to search:"); - e.printStackTrace(); - } finally { - latch.countDown(); - } - } - } - - class Indexer extends Thread { - - final int id; - long counter = 0; - long max = indexIterations; - - Indexer(int id) { - super("Indexer" + id); - this.id = id; - } - - Indexer max(int max) { - this.max = max; - return this; - } - - @Override - public void run() { - try { - barrier1.await(); - barrier2.await(); - for (; counter < max; counter++) { - Client client = client(counter); - long id = idGenerator.incrementAndGet(); - client.index(Requests.indexRequest().index("test").type("type1").id(Long.toString(id)) - .source(XContentFactory.jsonBuilder().startObject() - .field("num", id % fieldNumLimit) - .endObject())) - .actionGet(); - } - System.out.println("Indexer [" + id + "]: Done"); - } catch (Exception e) { - System.err.println("Failed to index:"); - e.printStackTrace(); - } finally { - latch.countDown(); - } - } - } - - private Client client(long i) { - return clients[((int) (i % clients.length))]; - } - - public static void main(String[] args) throws Exception { - NodesStressBenchmark test = new NodesStressBenchmark() - .numberOfNodes(2) - .indexThreads(5) - .indexIterations(10 * 1000) - .searcherThreads(5) - .searchIterations(10 * 1000) - .sleepBeforeClose(TimeValue.timeValueMinutes(10)) - .sleepAfterDone(TimeValue.timeValueMinutes(10)) - .build(EMPTY_SETTINGS); - - test.start(); - } -} diff --git a/core/src/test/java/org/elasticsearch/benchmark/stress/SingleThreadBulkStress.java b/core/src/test/java/org/elasticsearch/benchmark/stress/SingleThreadBulkStress.java deleted file mode 100644 index 32c35cc0858..00000000000 --- a/core/src/test/java/org/elasticsearch/benchmark/stress/SingleThreadBulkStress.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.benchmark.stress; - -import org.elasticsearch.action.bulk.BulkRequestBuilder; -import org.elasticsearch.action.bulk.BulkResponse; -import org.elasticsearch.client.Client; -import org.elasticsearch.client.Requests; -import org.elasticsearch.common.StopWatch; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.SizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.node.Node; - -import java.io.IOException; -import java.util.Random; - -import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS; -import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.settings.Settings.settingsBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; -import static org.elasticsearch.node.NodeBuilder.nodeBuilder; - -/** - * - */ -public class SingleThreadBulkStress { - - public static void main(String[] args) throws Exception { - Random random = new Random(); - - int shardsCount = Integer.parseInt(System.getProperty("es.shards", "1")); - int replicaCount = Integer.parseInt(System.getProperty("es.replica", "1")); - boolean autoGenerateId = true; - - Settings settings = settingsBuilder() - .put("index.refresh_interval", "1s") - .put("index.merge.async", true) - .put("index.translog.flush_threshold_ops", 5000) - .put(SETTING_NUMBER_OF_SHARDS, shardsCount) - .put(SETTING_NUMBER_OF_REPLICAS, replicaCount) - .build(); - - Node[] nodes = new Node[1]; - for (int i = 0; i < nodes.length; i++) { - nodes[i] = nodeBuilder().settings(settingsBuilder().put(settings).put("name", "node" + i)).node(); - } - - //Node client = nodeBuilder().settings(settingsBuilder().put(settings).put("name", "client")).client(true).node(); - Node client = nodes[0]; - - Client client1 = client.client(); - - Thread.sleep(1000); - client1.admin().indices().prepareCreate("test").setSettings(settings).addMapping("type1", XContentFactory.jsonBuilder().startObject().startObject("type1") - .startObject("_source").field("enabled", false).endObject() - .startObject("_all").field("enabled", false).endObject() - .startObject("_type").field("index", "no").endObject() - .startObject("_id").field("index", "no").endObject() - .startObject("properties") - .startObject("field").field("type", "string").field("index", "not_analyzed").field("omit_norms", true).endObject() -// .startObject("field").field("index", "analyzed").field("omit_norms", false).endObject() - .endObject() - .endObject().endObject()).execute().actionGet(); - Thread.sleep(5000); - - StopWatch stopWatch = new StopWatch().start(); - long COUNT = SizeValue.parseSizeValue("2m").singles(); - int BATCH = 500; - System.out.println("Indexing [" + COUNT + "] ..."); - long ITERS = COUNT / BATCH; - long i = 1; - int counter = 0; - for (; i <= ITERS; i++) { - BulkRequestBuilder request = client1.prepareBulk(); - for (int j = 0; j < BATCH; j++) { - counter++; - request.add(Requests.indexRequest("test").type("type1").id(autoGenerateId ? null : Integer.toString(counter)).source(source(Integer.toString(counter), "test" + counter))); - } - BulkResponse response = request.execute().actionGet(); - if (response.hasFailures()) { - System.err.println("failures..."); - } - if (((i * BATCH) % 10000) == 0) { - System.out.println("Indexed " + (i * BATCH) + " took " + stopWatch.stop().lastTaskTime()); - stopWatch.start(); - } - } - System.out.println("Indexing took " + stopWatch.totalTime() + ", TPS " + (((double) COUNT) / stopWatch.totalTime().secondsFrac())); - - client.client().admin().indices().prepareRefresh().execute().actionGet(); - System.out.println("Count: " + client.client().prepareCount().setQuery(matchAllQuery()).execute().actionGet().getCount()); - - client.close(); - - for (Node node : nodes) { - node.close(); - } - } - - private static XContentBuilder source(String id, String nameValue) throws IOException { - return jsonBuilder().startObject().field("field", nameValue).endObject(); - } -} diff --git a/core/src/test/java/org/elasticsearch/benchmark/stress/SingleThreadIndexingStress.java b/core/src/test/java/org/elasticsearch/benchmark/stress/SingleThreadIndexingStress.java deleted file mode 100644 index 610745c51d9..00000000000 --- a/core/src/test/java/org/elasticsearch/benchmark/stress/SingleThreadIndexingStress.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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. - */ - -package org.elasticsearch.benchmark.stress; - -import org.elasticsearch.client.Client; -import org.elasticsearch.common.StopWatch; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.node.Node; - -import java.io.IOException; - -import static org.elasticsearch.client.Requests.createIndexRequest; -import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS; -import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.settings.Settings.settingsBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; -import static org.elasticsearch.node.NodeBuilder.nodeBuilder; - -/** - * - */ -public class SingleThreadIndexingStress { - - public static void main(String[] args) throws Exception { - Settings settings = settingsBuilder() - .put("index.refresh_interval", "1s") - .put("index.merge.async", true) - .put("index.translog.flush_threshold_ops", 5000) - .put(SETTING_NUMBER_OF_SHARDS, 2) - .put(SETTING_NUMBER_OF_REPLICAS, 1) - .build(); - - Node[] nodes = new Node[1]; - for (int i = 0; i < nodes.length; i++) { - nodes[i] = nodeBuilder().settings(settingsBuilder().put(settings).put("name", "node" + i)).node(); - } - - Node client = nodeBuilder().settings(settingsBuilder().put(settings).put("name", "client")).client(true).node(); - - Client client1 = client.client(); - - Thread.sleep(1000); - client1.admin().indices().create(createIndexRequest("test")).actionGet(); - Thread.sleep(5000); - - StopWatch stopWatch = new StopWatch().start(); - int COUNT = 200000; - int ID_RANGE = 100; - System.out.println("Indexing [" + COUNT + "] ..."); - int i = 1; - for (; i <= COUNT; i++) { -// client1.admin().cluster().preparePingSingle("test", "type1", Integer.toString(i)).execute().actionGet(); - client1.prepareIndex("test", "type1").setId(Integer.toString(i % ID_RANGE)).setSource(source(Integer.toString(i), "test" + i)) - .setCreate(false).execute().actionGet(); - if ((i % 10000) == 0) { - System.out.println("Indexed " + i + " took " + stopWatch.stop().lastTaskTime()); - stopWatch.start(); - } - } - System.out.println("Indexing took " + stopWatch.totalTime() + ", TPS " + (((double) COUNT) / stopWatch.totalTime().secondsFrac())); - - client.client().admin().indices().prepareRefresh().execute().actionGet(); - System.out.println("Count: " + client.client().prepareCount().setQuery(matchAllQuery()).execute().actionGet().getCount()); - - client.close(); - - for (Node node : nodes) { - node.close(); - } - } - - private static XContentBuilder source(String id, String nameValue) throws IOException { - long time = System.currentTimeMillis(); - return jsonBuilder().startObject() - .field("id", id) -// .field("numeric1", time) -// .field("numeric2", time) -// .field("numeric3", time) -// .field("numeric4", time) -// .field("numeric5", time) -// .field("numeric6", time) -// .field("numeric7", time) -// .field("numeric8", time) -// .field("numeric9", time) -// .field("numeric10", time) - .field("name", nameValue) - .endObject(); - } -} From fe46227db871b6d1af6333c21f4bc684d350dd97 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 2 Sep 2015 17:29:46 -0400 Subject: [PATCH 27/40] Remove sole usgae of com.google.common.annotations.Beta --- .../org/elasticsearch/common/util/concurrent/BaseFuture.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/common/util/concurrent/BaseFuture.java b/core/src/main/java/org/elasticsearch/common/util/concurrent/BaseFuture.java index 2ef8e1901f9..a48eb60a2d8 100644 --- a/core/src/main/java/org/elasticsearch/common/util/concurrent/BaseFuture.java +++ b/core/src/main/java/org/elasticsearch/common/util/concurrent/BaseFuture.java @@ -19,7 +19,6 @@ package org.elasticsearch.common.util.concurrent; -import com.google.common.annotations.Beta; import org.elasticsearch.common.Nullable; import org.elasticsearch.transport.Transports; @@ -195,7 +194,6 @@ public abstract class BaseFuture implements Future { return result; } - @Beta protected void done() { } From 06d5e24548d1df0eae0559d4eefd344f17cae497 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 2 Sep 2015 13:39:49 -0700 Subject: [PATCH 28/40] Tests: Rename test suffix so we only use "Tests" We currently have a small number of test classes with the suffix "Test", yet most use the suffix "Tests". This change renames all the "Test" classes, so that we have a simple rule: "Non-inner classes ending with Tests". --- ...BlendedTermQueryTest.java => BlendedTermQueryTests.java} | 2 +- .../java/org/elasticsearch/ExceptionSerializationTests.java | 3 ++- .../test/java/org/elasticsearch/NamingConventionTests.java | 6 +----- ...rStateRequestTest.java => ClusterStateRequestTests.java} | 2 +- ...BuilderTest.java => CreateIndexRequestBuilderTests.java} | 2 +- ...esponseTest.java => IndicesShardStoreResponseTests.java} | 2 +- ...eldStatsRequestTest.java => FieldStatsRequestTests.java} | 2 +- ...equestBuilderTest.java => IndexRequestBuilderTests.java} | 2 +- ...rviceTest.java => MetaDataIndexUpgradeServiceTests.java} | 2 +- .../{RoutingTableTest.java => RoutingTableTests.java} | 2 +- ...dClusterTest.java => BalanceUnbalancedClusterTests.java} | 2 +- .../common/{Base64Test.java => Base64Tests.java} | 2 +- .../blobstore/{BlobStoreTest.java => BlobStoreTests.java} | 2 +- ...ytesReferenceTest.java => PagedBytesReferenceTests.java} | 2 +- .../common/lucene/{LuceneTest.java => LuceneTests.java} | 2 +- ...tyPlaceholderTest.java => PropertyPlaceholderTests.java} | 2 +- ...ellableThreadsTest.java => CancellableThreadsTests.java} | 2 +- .../concurrent/{CountDownTest.java => CountDownTests.java} | 2 +- .../{RefCountedTest.java => RefCountedTests.java} | 2 +- ...tMasterServiceTest.java => ElectMasterServiceTests.java} | 2 +- ...ZenDiscoveryUnitTest.java => ZenDiscoveryUnitTests.java} | 2 +- ...taStateFormatTest.java => MetaDataStateFormatTests.java} | 6 +++--- ...eliningTest.java => NettyHttpServerPipeliningTests.java} | 4 ++-- ...ningHandlerTest.java => HttpPipeliningHandlerTests.java} | 2 +- .../{PatternAnalyzerTest.java => PatternAnalyzerTests.java} | 2 +- ...SynonymsAnalysisTest.java => SynonymsAnalysisTests.java} | 2 +- ...tSetFilterCacheTest.java => BitSetFilterCacheTests.java} | 2 +- .../{PostingsFormatTest.java => PostingsFormatTests.java} | 2 +- ...neSettingsTest.java => InternalEngineSettingsTests.java} | 2 +- .../{FilterFieldDataTest.java => FilterFieldDataTests.java} | 2 +- .../{MapperServiceTest.java => MapperServiceTests.java} | 2 +- ...ubleIndexingDocTest.java => DoubleIndexingDocTests.java} | 2 +- ...NumericValuesTest.java => StoredNumericValuesTests.java} | 2 +- ...ueryParserTest.java => CommonTermsQueryParserTests.java} | 2 +- ...QueryBuilderTest.java => TemplateQueryBuilderTests.java} | 2 +- ...teQueryParserTest.java => TemplateQueryParserTests.java} | 2 +- ...olicySettingsTest.java => MergePolicySettingsTests.java} | 2 +- .../{NewPathForShardTest.java => NewPathForShardTests.java} | 2 +- ...ieldUpgraderTest.java => VersionFieldUpgraderTests.java} | 2 +- .../blobstore/{FileInfoTest.java => FileInfoTests.java} | 2 +- ...icedInputStreamTest.java => SlicedInputStreamTests.java} | 2 +- .../{DirectoryUtilsTest.java => DirectoryUtilsTests.java} | 2 +- .../{IndexStoreBWCTest.java => IndexStoreBWCTests.java} | 2 +- .../index/store/{StoreTest.java => StoreTests.java} | 4 ++-- .../{IndicesServiceTest.java => IndicesServiceTests.java} | 2 +- ...hSingleNodeTest.java => SyncedFlushSingleNodeTests.java} | 2 +- .../{RecoveryStateTest.java => RecoveryStateTests.java} | 2 +- ...overyRequestTest.java => StartRecoveryRequestTests.java} | 2 +- ...RecoverySettingsTest.java => RecoverySettingsTests.java} | 2 +- .../support/{RestTableTest.java => RestTableTests.java} | 2 +- ...meterParserTest.java => ScriptParameterParserTests.java} | 2 +- ...ScriptEngineTest.java => MustacheScriptEngineTests.java} | 2 +- .../mustache/{MustacheTest.java => MustacheTests.java} | 2 +- ...NestedAggregatorTest.java => NestedAggregatorTests.java} | 2 +- ...SourceBuilderTest.java => SearchSourceBuilderTests.java} | 2 +- ...ildrenFilterTest.java => NestedChildrenFilterTests.java} | 2 +- ...TokenStreamTest.java => CompletionTokenStreamTests.java} | 2 +- .../completion/AnalyzingCompletionLookupProviderV1.java | 2 +- ...gsFormatTest.java => CompletionPostingsFormatTests.java} | 2 +- ...MappingTest.java => GeoLocationContextMappingTests.java} | 2 +- .../test/java/org/elasticsearch/test/ESIntegTestCase.java | 4 ++-- .../watcher/{FileWatcherTest.java => FileWatcherTests.java} | 2 +- .../cloud/aws/{AWSSignersTest.java => AWSSignersTests.java} | 2 +- .../{S3OutputStreamTest.java => S3OutputStreamTests.java} | 2 +- .../ec2/{Ec2DiscoveryITest.java => Ec2DiscoveryTests.java} | 2 +- ...tingsITest.java => Ec2DiscoveryUpdateSettingsTests.java} | 2 +- ...est.java => S3ProxiedSnapshotRestoreOverHttpsTests.java} | 2 +- ...verHttpTest.java => S3SnapshotRestoreOverHttpTests.java} | 2 +- ...rHttpsTest.java => S3SnapshotRestoreOverHttpsTests.java} | 2 +- ...SmbMMapDirectoryTest.java => SmbMMapDirectoryTests.java} | 2 +- ...eFSDirectoryTest.java => SmbSimpleFSDirectoryTests.java} | 2 +- .../itest/{AzureSimpleITest.java => AzureSimpleTests.java} | 2 +- ...ase.java => AbstractAzureRepositoryServiceTestCase.java} | 4 ++-- ...sterNodesTest.java => AzureMinimumMasterNodesTests.java} | 4 ++-- .../azure/{AzureSimpleTest.java => AzureSimpleTests.java} | 4 ++-- ...StartedNodesTest.java => AzureTwoStartedNodesTests.java} | 4 ++-- .../index/store/{SmbMMapFsTest.java => SmbMMapFsTests.java} | 2 +- .../store/{SmbSimpleFsTest.java => SmbSimpleFsTests.java} | 2 +- ...storeTest.java => AzureSnapshotRestoreServiceTests.java} | 6 +++--- ...shotRestoreITest.java => AzureSnapshotRestoreTests.java} | 2 +- .../gce/{GceDiscoveryTest.java => GceDiscoveryTests.java} | 4 ++-- ...dedTest.java => JavaScriptScriptMultiThreadedTests.java} | 2 +- ...hreadedTest.java => PythonScriptMultiThreadedTests.java} | 2 +- pom.xml | 1 - 84 files changed, 96 insertions(+), 100 deletions(-) rename core/src/test/java/org/apache/lucene/queries/{BlendedTermQueryTest.java => BlendedTermQueryTests.java} (99%) rename core/src/test/java/org/elasticsearch/action/admin/cluster/state/{ClusterStateRequestTest.java => ClusterStateRequestTests.java} (98%) rename core/src/test/java/org/elasticsearch/action/admin/indices/create/{CreateIndexRequestBuilderTest.java => CreateIndexRequestBuilderTests.java} (98%) rename core/src/test/java/org/elasticsearch/action/admin/indices/shards/{IndicesShardStoreResponseTest.java => IndicesShardStoreResponseTests.java} (99%) rename core/src/test/java/org/elasticsearch/action/fieldstats/{FieldStatsRequestTest.java => FieldStatsRequestTests.java} (98%) rename core/src/test/java/org/elasticsearch/action/index/{IndexRequestBuilderTest.java => IndexRequestBuilderTests.java} (98%) rename core/src/test/java/org/elasticsearch/cluster/metadata/{MetaDataIndexUpgradeServiceTest.java => MetaDataIndexUpgradeServiceTests.java} (97%) rename core/src/test/java/org/elasticsearch/cluster/routing/{RoutingTableTest.java => RoutingTableTests.java} (99%) rename core/src/test/java/org/elasticsearch/cluster/routing/allocation/{BalanceUnbalancedClusterTest.java => BalanceUnbalancedClusterTests.java} (98%) rename core/src/test/java/org/elasticsearch/common/{Base64Test.java => Base64Tests.java} (97%) rename core/src/test/java/org/elasticsearch/common/blobstore/{BlobStoreTest.java => BlobStoreTests.java} (99%) rename core/src/test/java/org/elasticsearch/common/bytes/{PagedBytesReferenceTest.java => PagedBytesReferenceTests.java} (99%) rename core/src/test/java/org/elasticsearch/common/lucene/{LuceneTest.java => LuceneTests.java} (99%) rename core/src/test/java/org/elasticsearch/common/property/{PropertyPlaceholderTest.java => PropertyPlaceholderTests.java} (99%) rename core/src/test/java/org/elasticsearch/common/util/{CancellableThreadsTest.java => CancellableThreadsTests.java} (99%) rename core/src/test/java/org/elasticsearch/common/util/concurrent/{CountDownTest.java => CountDownTests.java} (98%) rename core/src/test/java/org/elasticsearch/common/util/concurrent/{RefCountedTest.java => RefCountedTests.java} (98%) rename core/src/test/java/org/elasticsearch/discovery/zen/{ElectMasterServiceTest.java => ElectMasterServiceTests.java} (98%) rename core/src/test/java/org/elasticsearch/discovery/zen/{ZenDiscoveryUnitTest.java => ZenDiscoveryUnitTests.java} (99%) rename core/src/test/java/org/elasticsearch/gateway/{MetaDataStateFormatTest.java => MetaDataStateFormatTests.java} (99%) rename core/src/test/java/org/elasticsearch/http/netty/{NettyHttpServerPipeliningTest.java => NettyHttpServerPipeliningTests.java} (98%) rename core/src/test/java/org/elasticsearch/http/netty/pipelining/{HttpPipeliningHandlerTest.java => HttpPipeliningHandlerTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/analysis/{PatternAnalyzerTest.java => PatternAnalyzerTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/analysis/synonyms/{SynonymsAnalysisTest.java => SynonymsAnalysisTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/cache/bitset/{BitSetFilterCacheTest.java => BitSetFilterCacheTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/codec/postingformat/{PostingsFormatTest.java => PostingsFormatTests.java} (95%) rename core/src/test/java/org/elasticsearch/index/engine/{InternalEngineSettingsTest.java => InternalEngineSettingsTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/fielddata/{FilterFieldDataTest.java => FilterFieldDataTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{MapperServiceTest.java => MapperServiceTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/mapper/lucene/{DoubleIndexingDocTest.java => DoubleIndexingDocTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/mapper/lucene/{StoredNumericValuesTest.java => StoredNumericValuesTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/query/{CommonTermsQueryParserTest.java => CommonTermsQueryParserTests.java} (96%) rename core/src/test/java/org/elasticsearch/index/query/{TemplateQueryBuilderTest.java => TemplateQueryBuilderTests.java} (96%) rename core/src/test/java/org/elasticsearch/index/query/{TemplateQueryParserTest.java => TemplateQueryParserTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/shard/{MergePolicySettingsTest.java => MergePolicySettingsTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/shard/{NewPathForShardTest.java => NewPathForShardTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/shard/{VersionFieldUpgraderTest.java => VersionFieldUpgraderTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/snapshots/blobstore/{FileInfoTest.java => FileInfoTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/snapshots/blobstore/{SlicedInputStreamTest.java => SlicedInputStreamTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/store/{DirectoryUtilsTest.java => DirectoryUtilsTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/store/{IndexStoreBWCTest.java => IndexStoreBWCTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/store/{StoreTest.java => StoreTests.java} (99%) rename core/src/test/java/org/elasticsearch/indices/{IndicesServiceTest.java => IndicesServiceTests.java} (99%) rename core/src/test/java/org/elasticsearch/indices/flush/{SyncedFlushSingleNodeTest.java => SyncedFlushSingleNodeTests.java} (99%) rename core/src/test/java/org/elasticsearch/indices/recovery/{RecoveryStateTest.java => RecoveryStateTests.java} (99%) rename core/src/test/java/org/elasticsearch/indices/recovery/{StartRecoveryRequestTest.java => StartRecoveryRequestTests.java} (98%) rename core/src/test/java/org/elasticsearch/recovery/{RecoverySettingsTest.java => RecoverySettingsTests.java} (99%) rename core/src/test/java/org/elasticsearch/rest/action/support/{RestTableTest.java => RestTableTests.java} (98%) rename core/src/test/java/org/elasticsearch/script/{ScriptParameterParserTest.java => ScriptParameterParserTests.java} (99%) rename core/src/test/java/org/elasticsearch/script/mustache/{MustacheScriptEngineTest.java => MustacheScriptEngineTests.java} (99%) rename core/src/test/java/org/elasticsearch/script/mustache/{MustacheTest.java => MustacheTests.java} (97%) rename core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/{NestedAggregatorTest.java => NestedAggregatorTests.java} (99%) rename core/src/test/java/org/elasticsearch/search/builder/{SearchSourceBuilderTest.java => SearchSourceBuilderTests.java} (98%) rename core/src/test/java/org/elasticsearch/search/fetch/innerhits/{NestedChildrenFilterTest.java => NestedChildrenFilterTests.java} (98%) rename core/src/test/java/org/elasticsearch/search/suggest/{CompletionTokenStreamTest.java => CompletionTokenStreamTests.java} (99%) rename core/src/test/java/org/elasticsearch/search/suggest/completion/{CompletionPostingsFormatTest.java => CompletionPostingsFormatTests.java} (99%) rename core/src/test/java/org/elasticsearch/search/suggest/context/{GeoLocationContextMappingTest.java => GeoLocationContextMappingTests.java} (99%) rename core/src/test/java/org/elasticsearch/watcher/{FileWatcherTest.java => FileWatcherTests.java} (99%) rename plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/{AWSSignersTest.java => AWSSignersTests.java} (97%) rename plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/{S3OutputStreamTest.java => S3OutputStreamTests.java} (98%) rename plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/{Ec2DiscoveryITest.java => Ec2DiscoveryTests.java} (96%) rename plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/{Ec2DiscoveryUpdateSettingsITest.java => Ec2DiscoveryUpdateSettingsTests.java} (97%) rename plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/{S3ProxiedSnapshotRestoreOverHttpsTest.java => S3ProxiedSnapshotRestoreOverHttpsTests.java} (94%) rename plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/{S3SnapshotRestoreOverHttpTest.java => S3SnapshotRestoreOverHttpTests.java} (92%) rename plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/{S3SnapshotRestoreOverHttpsTest.java => S3SnapshotRestoreOverHttpsTests.java} (92%) rename plugins/cloud-azure/src/test/java/org/apache/lucene/store/{SmbMMapDirectoryTest.java => SmbMMapDirectoryTests.java} (93%) rename plugins/cloud-azure/src/test/java/org/apache/lucene/store/{SmbSimpleFSDirectoryTest.java => SmbSimpleFSDirectoryTests.java} (93%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/{AzureSimpleITest.java => AzureSimpleTests.java} (97%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/{AbstractAzureRepositoryServiceTestCaseCase.java => AbstractAzureRepositoryServiceTestCase.java} (96%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/{AzureMinimumMasterNodesTest.java => AzureMinimumMasterNodesTests.java} (96%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/{AzureSimpleTest.java => AzureSimpleTests.java} (96%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/{AzureTwoStartedNodesTest.java => AzureTwoStartedNodesTests.java} (96%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/{SmbMMapFsTest.java => SmbMMapFsTests.java} (94%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/{SmbSimpleFsTest.java => SmbSimpleFsTests.java} (94%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/{AzureSnapshotRestoreTest.java => AzureSnapshotRestoreServiceTests.java} (97%) rename plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/{AzureSnapshotRestoreITest.java => AzureSnapshotRestoreTests.java} (99%) rename plugins/cloud-gce/src/test/java/org/elasticsearch/discovery/gce/{GceDiscoveryTest.java => GceDiscoveryTests.java} (98%) rename plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/{JavaScriptScriptMultiThreadedTest.java => JavaScriptScriptMultiThreadedTests.java} (99%) rename plugins/lang-python/src/test/java/org/elasticsearch/script/python/{PythonScriptMultiThreadedTest.java => PythonScriptMultiThreadedTests.java} (99%) diff --git a/core/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java b/core/src/test/java/org/apache/lucene/queries/BlendedTermQueryTests.java similarity index 99% rename from core/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java rename to core/src/test/java/org/apache/lucene/queries/BlendedTermQueryTests.java index 74eb4babc6c..ec66a53f1e4 100644 --- a/core/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java +++ b/core/src/test/java/org/apache/lucene/queries/BlendedTermQueryTests.java @@ -56,7 +56,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class BlendedTermQueryTest extends ESTestCase { +public class BlendedTermQueryTests extends ESTestCase { @Test public void testBooleanQuery() throws IOException { diff --git a/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java b/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java index 9587846ec1d..dc0dd76e414 100644 --- a/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java +++ b/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java @@ -38,6 +38,7 @@ import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.io.stream.*; import org.elasticsearch.common.transport.LocalTransportAddress; import org.elasticsearch.common.unit.ByteSizeValue; +import org.elasticsearch.common.util.CancellableThreadsTests; import org.elasticsearch.common.xcontent.*; import org.elasticsearch.discovery.DiscoverySettings; import org.elasticsearch.index.AlreadyExpiredException; @@ -95,7 +96,7 @@ public class ExceptionSerializationTests extends ESTestCase { org.elasticsearch.test.rest.parser.RestTestParseException.class, org.elasticsearch.index.query.TestQueryParsingException.class, org.elasticsearch.test.rest.client.RestException.class, - org.elasticsearch.common.util.CancellableThreadsTest.CustomException.class, + CancellableThreadsTests.CustomException.class, org.elasticsearch.rest.BytesRestResponseTests.WithHeadersException.class, AbstractClientHeadersTestCase.InternalException.class); FileVisitor visitor = new FileVisitor() { diff --git a/core/src/test/java/org/elasticsearch/NamingConventionTests.java b/core/src/test/java/org/elasticsearch/NamingConventionTests.java index 2d0c8d885b7..b317152c377 100644 --- a/core/src/test/java/org/elasticsearch/NamingConventionTests.java +++ b/core/src/test/java/org/elasticsearch/NamingConventionTests.java @@ -73,8 +73,7 @@ public class NamingConventionTests extends ESTestCase { String filename = file.getFileName().toString(); if (filename.endsWith(".class")) { Class clazz = loadClass(filename); - if (clazz.getName().endsWith("Tests") || - clazz.getName().endsWith("Test")) { // don't worry about the ones that match the pattern + if (clazz.getName().endsWith("Tests")) { // don't worry about the ones that match the pattern if (ESIntegTestCase.class.isAssignableFrom(clazz)) { integTestsInDisguise.add(clazz); @@ -147,7 +146,6 @@ public class NamingConventionTests extends ESTestCase { assertTrue(notRunnable.remove(DummyInterfaceTests.class)); assertTrue(innerClasses.remove(InnerTests.class)); assertTrue(notImplementing.remove(NotImplementingTests.class)); - assertTrue(notImplementing.remove(NotImplementingTest.class)); assertTrue(pureUnitTest.remove(PlainUnit.class)); assertTrue(pureUnitTest.remove(PlainUnitTheSecond.class)); @@ -177,8 +175,6 @@ public class NamingConventionTests extends ESTestCase { public static final class NotImplementingTests {} - public static final class NotImplementingTest {} - public static final class WrongName extends ESTestCase {} public static abstract class DummyAbstractTests extends ESTestCase {} diff --git a/core/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTest.java b/core/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTest.java rename to core/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTests.java index 1b5a4ef41bc..5c0627555ad 100644 --- a/core/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTest.java +++ b/core/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTests.java @@ -32,7 +32,7 @@ import static org.hamcrest.CoreMatchers.equalTo; /** * Unit tests for the {@link ClusterStateRequest}. */ -public class ClusterStateRequestTest extends ESTestCase { +public class ClusterStateRequestTests extends ESTestCase { @Test public void testSerialization() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTest.java b/core/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTest.java rename to core/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java index 2fff8357fd3..98569b7db8f 100644 --- a/core/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTest.java +++ b/core/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java @@ -33,7 +33,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -public class CreateIndexRequestBuilderTest extends ESTestCase { +public class CreateIndexRequestBuilderTests extends ESTestCase { private static final String KEY = "my.settings.key"; private static final String VALUE = "my.settings.value"; diff --git a/core/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTest.java b/core/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTest.java rename to core/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java index 925e01e8f2e..777555f5b73 100644 --- a/core/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTest.java +++ b/core/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java @@ -36,7 +36,7 @@ import java.util.*; import static org.hamcrest.Matchers.equalTo; -public class IndicesShardStoreResponseTest extends ESTestCase { +public class IndicesShardStoreResponseTests extends ESTestCase { @Test public void testBasicSerialization() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/action/fieldstats/FieldStatsRequestTest.java b/core/src/test/java/org/elasticsearch/action/fieldstats/FieldStatsRequestTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/action/fieldstats/FieldStatsRequestTest.java rename to core/src/test/java/org/elasticsearch/action/fieldstats/FieldStatsRequestTests.java index dd562a9bccd..e33fba69b8b 100644 --- a/core/src/test/java/org/elasticsearch/action/fieldstats/FieldStatsRequestTest.java +++ b/core/src/test/java/org/elasticsearch/action/fieldstats/FieldStatsRequestTests.java @@ -28,7 +28,7 @@ import static org.elasticsearch.action.fieldstats.IndexConstraint.Property.MAX; import static org.elasticsearch.action.fieldstats.IndexConstraint.Property.MIN; import static org.hamcrest.Matchers.equalTo; -public class FieldStatsRequestTest extends ESTestCase { +public class FieldStatsRequestTests extends ESTestCase { public void testFieldsParsing() throws Exception { byte[] data = StreamsUtils.copyToBytesFromClasspath("/org/elasticsearch/action/fieldstats/fieldstats-index-constraints-request.json"); diff --git a/core/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTest.java b/core/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTest.java rename to core/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTests.java index 8e3b8b2a575..f9dc86b59e9 100644 --- a/core/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTest.java +++ b/core/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTests.java @@ -33,7 +33,7 @@ import java.io.ByteArrayOutputStream; import java.util.HashMap; import java.util.Map; -public class IndexRequestBuilderTest extends ESTestCase { +public class IndexRequestBuilderTests extends ESTestCase { private static final String EXPECTED_SOURCE = "{\"SomeKey\":\"SomeValue\"}"; private NoOpClient testClient; diff --git a/core/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexUpgradeServiceTest.java b/core/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexUpgradeServiceTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexUpgradeServiceTest.java rename to core/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexUpgradeServiceTests.java index e83e68b335e..88f27bcf609 100644 --- a/core/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexUpgradeServiceTest.java +++ b/core/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexUpgradeServiceTests.java @@ -27,7 +27,7 @@ import org.elasticsearch.test.ESTestCase; import java.util.Arrays; import java.util.Locale; -public class MetaDataIndexUpgradeServiceTest extends ESTestCase { +public class MetaDataIndexUpgradeServiceTests extends ESTestCase { public void testUpgradeStoreSettings() { final String type = RandomPicks.randomFrom(random(), Arrays.asList("nio_fs", "mmap_fs", "simple_fs", "default", "fs")); diff --git a/core/src/test/java/org/elasticsearch/cluster/routing/RoutingTableTest.java b/core/src/test/java/org/elasticsearch/cluster/routing/RoutingTableTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/cluster/routing/RoutingTableTest.java rename to core/src/test/java/org/elasticsearch/cluster/routing/RoutingTableTests.java index 9a0cbb2bcca..ea5dda0128b 100644 --- a/core/src/test/java/org/elasticsearch/cluster/routing/RoutingTableTest.java +++ b/core/src/test/java/org/elasticsearch/cluster/routing/RoutingTableTests.java @@ -38,7 +38,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; -public class RoutingTableTest extends ESAllocationTestCase { +public class RoutingTableTests extends ESAllocationTestCase { private static final String TEST_INDEX_1 = "test1"; private static final String TEST_INDEX_2 = "test2"; diff --git a/core/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceUnbalancedClusterTest.java b/core/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceUnbalancedClusterTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceUnbalancedClusterTest.java rename to core/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceUnbalancedClusterTests.java index 89e0cf8332b..d0e3d727c10 100644 --- a/core/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceUnbalancedClusterTest.java +++ b/core/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceUnbalancedClusterTests.java @@ -40,7 +40,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; /** * see issue #9023 */ -public class BalanceUnbalancedClusterTest extends CatAllocationTestCase { +public class BalanceUnbalancedClusterTests extends CatAllocationTestCase { @Override protected Path getCatPath() throws IOException { diff --git a/core/src/test/java/org/elasticsearch/common/Base64Test.java b/core/src/test/java/org/elasticsearch/common/Base64Tests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/common/Base64Test.java rename to core/src/test/java/org/elasticsearch/common/Base64Tests.java index 07a3689130c..6bceec92984 100644 --- a/core/src/test/java/org/elasticsearch/common/Base64Test.java +++ b/core/src/test/java/org/elasticsearch/common/Base64Tests.java @@ -30,7 +30,7 @@ import static org.hamcrest.Matchers.is; /** * */ -public class Base64Test extends ESTestCase { +public class Base64Tests extends ESTestCase { @Test // issue #6334 public void testBase64DecodeWithExtraCharactersAfterPadding() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/common/blobstore/BlobStoreTest.java b/core/src/test/java/org/elasticsearch/common/blobstore/BlobStoreTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/common/blobstore/BlobStoreTest.java rename to core/src/test/java/org/elasticsearch/common/blobstore/BlobStoreTests.java index 62daeb7e2b5..57322e2bce0 100644 --- a/core/src/test/java/org/elasticsearch/common/blobstore/BlobStoreTest.java +++ b/core/src/test/java/org/elasticsearch/common/blobstore/BlobStoreTests.java @@ -40,7 +40,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; @LuceneTestCase.SuppressFileSystems("ExtrasFS") -public class BlobStoreTest extends ESTestCase { +public class BlobStoreTests extends ESTestCase { @Test public void testWriteRead() throws IOException { diff --git a/core/src/test/java/org/elasticsearch/common/bytes/PagedBytesReferenceTest.java b/core/src/test/java/org/elasticsearch/common/bytes/PagedBytesReferenceTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/common/bytes/PagedBytesReferenceTest.java rename to core/src/test/java/org/elasticsearch/common/bytes/PagedBytesReferenceTests.java index 59a3d01255e..802ea7cc628 100644 --- a/core/src/test/java/org/elasticsearch/common/bytes/PagedBytesReferenceTest.java +++ b/core/src/test/java/org/elasticsearch/common/bytes/PagedBytesReferenceTests.java @@ -42,7 +42,7 @@ import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.util.Arrays; -public class PagedBytesReferenceTest extends ESTestCase { +public class PagedBytesReferenceTests extends ESTestCase { private static final int PAGE_SIZE = BigArrays.BYTE_PAGE_SIZE; diff --git a/core/src/test/java/org/elasticsearch/common/lucene/LuceneTest.java b/core/src/test/java/org/elasticsearch/common/lucene/LuceneTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/common/lucene/LuceneTest.java rename to core/src/test/java/org/elasticsearch/common/lucene/LuceneTests.java index 8418befe54a..2fb90c776da 100644 --- a/core/src/test/java/org/elasticsearch/common/lucene/LuceneTest.java +++ b/core/src/test/java/org/elasticsearch/common/lucene/LuceneTests.java @@ -37,7 +37,7 @@ import java.util.concurrent.atomic.AtomicBoolean; /** * */ -public class LuceneTest extends ESTestCase { +public class LuceneTests extends ESTestCase { /* diff --git a/core/src/test/java/org/elasticsearch/common/property/PropertyPlaceholderTest.java b/core/src/test/java/org/elasticsearch/common/property/PropertyPlaceholderTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/common/property/PropertyPlaceholderTest.java rename to core/src/test/java/org/elasticsearch/common/property/PropertyPlaceholderTests.java index 0c4ea861448..bfa08ddfdab 100644 --- a/core/src/test/java/org/elasticsearch/common/property/PropertyPlaceholderTest.java +++ b/core/src/test/java/org/elasticsearch/common/property/PropertyPlaceholderTests.java @@ -25,7 +25,7 @@ import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; -public class PropertyPlaceholderTest extends ESTestCase { +public class PropertyPlaceholderTests extends ESTestCase { @Test public void testSimple() { diff --git a/core/src/test/java/org/elasticsearch/common/util/CancellableThreadsTest.java b/core/src/test/java/org/elasticsearch/common/util/CancellableThreadsTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/common/util/CancellableThreadsTest.java rename to core/src/test/java/org/elasticsearch/common/util/CancellableThreadsTests.java index 85dd1c14b36..2bdaea34d1e 100644 --- a/core/src/test/java/org/elasticsearch/common/util/CancellableThreadsTest.java +++ b/core/src/test/java/org/elasticsearch/common/util/CancellableThreadsTests.java @@ -25,7 +25,7 @@ import org.junit.Test; import java.util.concurrent.CountDownLatch; -public class CancellableThreadsTest extends ESTestCase { +public class CancellableThreadsTests extends ESTestCase { public static class CustomException extends RuntimeException { diff --git a/core/src/test/java/org/elasticsearch/common/util/concurrent/CountDownTest.java b/core/src/test/java/org/elasticsearch/common/util/concurrent/CountDownTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/common/util/concurrent/CountDownTest.java rename to core/src/test/java/org/elasticsearch/common/util/concurrent/CountDownTests.java index 52fe7247257..6a45bfbd3d2 100644 --- a/core/src/test/java/org/elasticsearch/common/util/concurrent/CountDownTest.java +++ b/core/src/test/java/org/elasticsearch/common/util/concurrent/CountDownTests.java @@ -30,7 +30,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; -public class CountDownTest extends ESTestCase { +public class CountDownTests extends ESTestCase { @Test public void testConcurrent() throws InterruptedException { diff --git a/core/src/test/java/org/elasticsearch/common/util/concurrent/RefCountedTest.java b/core/src/test/java/org/elasticsearch/common/util/concurrent/RefCountedTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/common/util/concurrent/RefCountedTest.java rename to core/src/test/java/org/elasticsearch/common/util/concurrent/RefCountedTests.java index 1301c9efcb4..9b01b785f2b 100644 --- a/core/src/test/java/org/elasticsearch/common/util/concurrent/RefCountedTest.java +++ b/core/src/test/java/org/elasticsearch/common/util/concurrent/RefCountedTests.java @@ -33,7 +33,7 @@ import static org.hamcrest.Matchers.is; /** */ -public class RefCountedTest extends ESTestCase { +public class RefCountedTests extends ESTestCase { @Test public void testRefCount() throws IOException { diff --git a/core/src/test/java/org/elasticsearch/discovery/zen/ElectMasterServiceTest.java b/core/src/test/java/org/elasticsearch/discovery/zen/ElectMasterServiceTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/discovery/zen/ElectMasterServiceTest.java rename to core/src/test/java/org/elasticsearch/discovery/zen/ElectMasterServiceTests.java index 884d238827d..eddc4d9bae7 100644 --- a/core/src/test/java/org/elasticsearch/discovery/zen/ElectMasterServiceTest.java +++ b/core/src/test/java/org/elasticsearch/discovery/zen/ElectMasterServiceTests.java @@ -29,7 +29,7 @@ import org.junit.Test; import java.util.*; -public class ElectMasterServiceTest extends ESTestCase { +public class ElectMasterServiceTests extends ESTestCase { ElectMasterService electMasterService() { return new ElectMasterService(Settings.EMPTY, Version.CURRENT); diff --git a/core/src/test/java/org/elasticsearch/discovery/zen/ZenDiscoveryUnitTest.java b/core/src/test/java/org/elasticsearch/discovery/zen/ZenDiscoveryUnitTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/discovery/zen/ZenDiscoveryUnitTest.java rename to core/src/test/java/org/elasticsearch/discovery/zen/ZenDiscoveryUnitTests.java index cc6bc2b235c..6bd2bd7d30e 100644 --- a/core/src/test/java/org/elasticsearch/discovery/zen/ZenDiscoveryUnitTest.java +++ b/core/src/test/java/org/elasticsearch/discovery/zen/ZenDiscoveryUnitTests.java @@ -35,7 +35,7 @@ import static org.hamcrest.core.IsNull.nullValue; /** */ -public class ZenDiscoveryUnitTest extends ESTestCase { +public class ZenDiscoveryUnitTests extends ESTestCase { public void testShouldIgnoreNewClusterState() { ClusterName clusterName = new ClusterName("abc"); diff --git a/core/src/test/java/org/elasticsearch/gateway/MetaDataStateFormatTest.java b/core/src/test/java/org/elasticsearch/gateway/MetaDataStateFormatTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/gateway/MetaDataStateFormatTest.java rename to core/src/test/java/org/elasticsearch/gateway/MetaDataStateFormatTests.java index 8650fd5cd1a..98630edd176 100644 --- a/core/src/test/java/org/elasticsearch/gateway/MetaDataStateFormatTest.java +++ b/core/src/test/java/org/elasticsearch/gateway/MetaDataStateFormatTests.java @@ -68,7 +68,7 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.startsWith; @LuceneTestCase.SuppressFileSystems("ExtrasFS") // TODO: fix test to work with ExtrasFS -public class MetaDataStateFormatTest extends ESTestCase { +public class MetaDataStateFormatTests extends ESTestCase { /** @@ -349,7 +349,7 @@ public class MetaDataStateFormatTest extends ESTestCase { if (randomBoolean() && (j < numStates - 1 || dirs.length > 0 && i != 0)) { // corrupt a file that we do not necessarily need here.... Path file = dirs[i].resolve(MetaDataStateFormat.STATE_DIR_NAME).resolve("global-" + j + ".st"); corruptedFiles.add(file); - MetaDataStateFormatTest.corruptFile(file, logger); + MetaDataStateFormatTests.corruptFile(file, logger); } } @@ -377,7 +377,7 @@ public class MetaDataStateFormatTest extends ESTestCase { if (corruptedFiles.contains(file)) { continue; } - MetaDataStateFormatTest.corruptFile(file, logger); + MetaDataStateFormatTests.corruptFile(file, logger); } try { format.loadLatestState(logger, dirList.toArray(new Path[0])); diff --git a/core/src/test/java/org/elasticsearch/http/netty/NettyHttpServerPipeliningTest.java b/core/src/test/java/org/elasticsearch/http/netty/NettyHttpServerPipeliningTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/http/netty/NettyHttpServerPipeliningTest.java rename to core/src/test/java/org/elasticsearch/http/netty/NettyHttpServerPipeliningTests.java index e3a5861ea62..3274d4fa70f 100644 --- a/core/src/test/java/org/elasticsearch/http/netty/NettyHttpServerPipeliningTest.java +++ b/core/src/test/java/org/elasticsearch/http/netty/NettyHttpServerPipeliningTests.java @@ -64,7 +64,7 @@ import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1; /** * This test just tests, if he pipelining works in general with out any connection the elasticsearch handler */ -public class NettyHttpServerPipeliningTest extends ESTestCase { +public class NettyHttpServerPipeliningTests extends ESTestCase { private NetworkService networkService; private ThreadPool threadPool; @@ -128,7 +128,7 @@ public class NettyHttpServerPipeliningTest extends ESTestCase { private final ExecutorService executorService; public CustomNettyHttpServerTransport(Settings settings) { - super(settings, NettyHttpServerPipeliningTest.this.networkService, NettyHttpServerPipeliningTest.this.bigArrays); + super(settings, NettyHttpServerPipeliningTests.this.networkService, NettyHttpServerPipeliningTests.this.bigArrays); this.executorService = Executors.newFixedThreadPool(5); } diff --git a/core/src/test/java/org/elasticsearch/http/netty/pipelining/HttpPipeliningHandlerTest.java b/core/src/test/java/org/elasticsearch/http/netty/pipelining/HttpPipeliningHandlerTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/http/netty/pipelining/HttpPipeliningHandlerTest.java rename to core/src/test/java/org/elasticsearch/http/netty/pipelining/HttpPipeliningHandlerTests.java index f0368fba60b..f21153e45a7 100644 --- a/core/src/test/java/org/elasticsearch/http/netty/pipelining/HttpPipeliningHandlerTest.java +++ b/core/src/test/java/org/elasticsearch/http/netty/pipelining/HttpPipeliningHandlerTests.java @@ -53,7 +53,7 @@ import static org.jboss.netty.util.CharsetUtil.UTF_8; /** * */ -public class HttpPipeliningHandlerTest extends ESTestCase { +public class HttpPipeliningHandlerTests extends ESTestCase { private static final long RESPONSE_TIMEOUT = 10000L; private static final long CONNECTION_TIMEOUT = 10000L; diff --git a/core/src/test/java/org/elasticsearch/index/analysis/PatternAnalyzerTest.java b/core/src/test/java/org/elasticsearch/index/analysis/PatternAnalyzerTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/analysis/PatternAnalyzerTest.java rename to core/src/test/java/org/elasticsearch/index/analysis/PatternAnalyzerTests.java index 2f420e56461..9c578ef6385 100644 --- a/core/src/test/java/org/elasticsearch/index/analysis/PatternAnalyzerTest.java +++ b/core/src/test/java/org/elasticsearch/index/analysis/PatternAnalyzerTests.java @@ -31,7 +31,7 @@ import org.elasticsearch.test.ESTokenStreamTestCase; /** * Verifies the behavior of PatternAnalyzer. */ -public class PatternAnalyzerTest extends ESTokenStreamTestCase { +public class PatternAnalyzerTests extends ESTokenStreamTestCase { /** * Test PatternAnalyzer when it is configured with a non-word pattern. diff --git a/core/src/test/java/org/elasticsearch/index/analysis/synonyms/SynonymsAnalysisTest.java b/core/src/test/java/org/elasticsearch/index/analysis/synonyms/SynonymsAnalysisTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/analysis/synonyms/SynonymsAnalysisTest.java rename to core/src/test/java/org/elasticsearch/index/analysis/synonyms/SynonymsAnalysisTests.java index 371a092ff6e..f695b1b197e 100644 --- a/core/src/test/java/org/elasticsearch/index/analysis/synonyms/SynonymsAnalysisTest.java +++ b/core/src/test/java/org/elasticsearch/index/analysis/synonyms/SynonymsAnalysisTests.java @@ -54,7 +54,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class SynonymsAnalysisTest extends ESTestCase { +public class SynonymsAnalysisTests extends ESTestCase { protected final ESLogger logger = Loggers.getLogger(getClass()); private AnalysisService analysisService; diff --git a/core/src/test/java/org/elasticsearch/index/cache/bitset/BitSetFilterCacheTest.java b/core/src/test/java/org/elasticsearch/index/cache/bitset/BitSetFilterCacheTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/cache/bitset/BitSetFilterCacheTest.java rename to core/src/test/java/org/elasticsearch/index/cache/bitset/BitSetFilterCacheTests.java index 389b2095bae..7888704dd89 100644 --- a/core/src/test/java/org/elasticsearch/index/cache/bitset/BitSetFilterCacheTest.java +++ b/core/src/test/java/org/elasticsearch/index/cache/bitset/BitSetFilterCacheTests.java @@ -45,7 +45,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class BitSetFilterCacheTest extends ESTestCase { +public class BitSetFilterCacheTests extends ESTestCase { @Test public void testInvalidateEntries() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/index/codec/postingformat/PostingsFormatTest.java b/core/src/test/java/org/elasticsearch/index/codec/postingformat/PostingsFormatTests.java similarity index 95% rename from core/src/test/java/org/elasticsearch/index/codec/postingformat/PostingsFormatTest.java rename to core/src/test/java/org/elasticsearch/index/codec/postingformat/PostingsFormatTests.java index efaa557cc89..f9884452c62 100644 --- a/core/src/test/java/org/elasticsearch/index/codec/postingformat/PostingsFormatTest.java +++ b/core/src/test/java/org/elasticsearch/index/codec/postingformat/PostingsFormatTests.java @@ -34,7 +34,7 @@ import org.elasticsearch.test.junit.listeners.ReproduceInfoPrinter; }) @TimeoutSuite(millis = TimeUnits.HOUR) @LuceneTestCase.SuppressSysoutChecks(bugUrl = "we log a lot on purpose") -public class PostingsFormatTest extends BasePostingsFormatTestCase { +public class PostingsFormatTests extends BasePostingsFormatTestCase { @Override protected Codec getCodec() { diff --git a/core/src/test/java/org/elasticsearch/index/engine/InternalEngineSettingsTest.java b/core/src/test/java/org/elasticsearch/index/engine/InternalEngineSettingsTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/engine/InternalEngineSettingsTest.java rename to core/src/test/java/org/elasticsearch/index/engine/InternalEngineSettingsTests.java index 21211fe3534..fa5db4cdeb4 100644 --- a/core/src/test/java/org/elasticsearch/index/engine/InternalEngineSettingsTest.java +++ b/core/src/test/java/org/elasticsearch/index/engine/InternalEngineSettingsTests.java @@ -28,7 +28,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -public class InternalEngineSettingsTest extends ESSingleNodeTestCase { +public class InternalEngineSettingsTests extends ESSingleNodeTestCase { public void testSettingsUpdate() { final IndexService service = createIndex("foo"); diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTest.java b/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTest.java rename to core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTests.java index 493b5a56327..4b9d0e1805c 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTest.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTests.java @@ -30,7 +30,7 @@ import java.util.Random; import static org.hamcrest.Matchers.equalTo; -public class FilterFieldDataTest extends AbstractFieldDataTestCase { +public class FilterFieldDataTests extends AbstractFieldDataTestCase { @Override protected FieldDataType getFieldDataType() { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTest.java b/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTest.java rename to core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java index d1c78c6b9f9..add7ee6a7f7 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTest.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java @@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.hasToString; -public class MapperServiceTest extends ESSingleNodeTestCase { +public class MapperServiceTests extends ESSingleNodeTestCase { @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/core/src/test/java/org/elasticsearch/index/mapper/lucene/DoubleIndexingDocTest.java b/core/src/test/java/org/elasticsearch/index/mapper/lucene/DoubleIndexingDocTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/lucene/DoubleIndexingDocTest.java rename to core/src/test/java/org/elasticsearch/index/mapper/lucene/DoubleIndexingDocTests.java index 55845010185..9aade61c5b0 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/lucene/DoubleIndexingDocTest.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/lucene/DoubleIndexingDocTests.java @@ -37,7 +37,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class DoubleIndexingDocTest extends ESSingleNodeTestCase { +public class DoubleIndexingDocTests extends ESSingleNodeTestCase { @Test public void testDoubleIndexingSameDoc() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/lucene/StoredNumericValuesTest.java b/core/src/test/java/org/elasticsearch/index/mapper/lucene/StoredNumericValuesTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/lucene/StoredNumericValuesTest.java rename to core/src/test/java/org/elasticsearch/index/mapper/lucene/StoredNumericValuesTests.java index 558ba257399..380e8e34d0f 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/lucene/StoredNumericValuesTest.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/lucene/StoredNumericValuesTests.java @@ -46,7 +46,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class StoredNumericValuesTest extends ESSingleNodeTestCase { +public class StoredNumericValuesTests extends ESSingleNodeTestCase { @Test public void testBytesAndNumericRepresentation() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/index/query/CommonTermsQueryParserTest.java b/core/src/test/java/org/elasticsearch/index/query/CommonTermsQueryParserTests.java similarity index 96% rename from core/src/test/java/org/elasticsearch/index/query/CommonTermsQueryParserTest.java rename to core/src/test/java/org/elasticsearch/index/query/CommonTermsQueryParserTests.java index c95477e5a3f..d339a5d6232 100644 --- a/core/src/test/java/org/elasticsearch/index/query/CommonTermsQueryParserTest.java +++ b/core/src/test/java/org/elasticsearch/index/query/CommonTermsQueryParserTests.java @@ -25,7 +25,7 @@ import org.junit.Test; import java.io.IOException; -public class CommonTermsQueryParserTest extends ESSingleNodeTestCase { +public class CommonTermsQueryParserTests extends ESSingleNodeTestCase { @Test public void testWhenParsedQueryIsNullNoNullPointerExceptionIsThrown() throws IOException { final String index = "test-index"; diff --git a/core/src/test/java/org/elasticsearch/index/query/TemplateQueryBuilderTest.java b/core/src/test/java/org/elasticsearch/index/query/TemplateQueryBuilderTests.java similarity index 96% rename from core/src/test/java/org/elasticsearch/index/query/TemplateQueryBuilderTest.java rename to core/src/test/java/org/elasticsearch/index/query/TemplateQueryBuilderTests.java index c7441199fce..647ac44c673 100644 --- a/core/src/test/java/org/elasticsearch/index/query/TemplateQueryBuilderTest.java +++ b/core/src/test/java/org/elasticsearch/index/query/TemplateQueryBuilderTests.java @@ -32,7 +32,7 @@ import java.util.Map; /** * Test building and serialising a template search request. * */ -public class TemplateQueryBuilderTest extends ESTestCase { +public class TemplateQueryBuilderTests extends ESTestCase { @Test public void testJSONGeneration() throws IOException { diff --git a/core/src/test/java/org/elasticsearch/index/query/TemplateQueryParserTest.java b/core/src/test/java/org/elasticsearch/index/query/TemplateQueryParserTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/query/TemplateQueryParserTest.java rename to core/src/test/java/org/elasticsearch/index/query/TemplateQueryParserTests.java index e76c13a834a..df65adc7abf 100644 --- a/core/src/test/java/org/elasticsearch/index/query/TemplateQueryParserTest.java +++ b/core/src/test/java/org/elasticsearch/index/query/TemplateQueryParserTests.java @@ -59,7 +59,7 @@ import java.io.IOException; * Test parsing and executing a template request. */ // NOTE: this can't be migrated to ESSingleNodeTestCase because of the custom path.conf -public class TemplateQueryParserTest extends ESTestCase { +public class TemplateQueryParserTests extends ESTestCase { private Injector injector; private QueryParseContext context; diff --git a/core/src/test/java/org/elasticsearch/index/shard/MergePolicySettingsTest.java b/core/src/test/java/org/elasticsearch/index/shard/MergePolicySettingsTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/shard/MergePolicySettingsTest.java rename to core/src/test/java/org/elasticsearch/index/shard/MergePolicySettingsTests.java index 49ec5c29012..0f6b2bd8d9e 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/MergePolicySettingsTest.java +++ b/core/src/test/java/org/elasticsearch/index/shard/MergePolicySettingsTests.java @@ -33,7 +33,7 @@ import java.io.IOException; import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS; import static org.hamcrest.Matchers.equalTo; -public class MergePolicySettingsTest extends ESTestCase { +public class MergePolicySettingsTests extends ESTestCase { protected final ShardId shardId = new ShardId(new Index("index"), 1); diff --git a/core/src/test/java/org/elasticsearch/index/shard/NewPathForShardTest.java b/core/src/test/java/org/elasticsearch/index/shard/NewPathForShardTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/shard/NewPathForShardTest.java rename to core/src/test/java/org/elasticsearch/index/shard/NewPathForShardTests.java index d89c328d9dd..0780cd718ac 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/NewPathForShardTest.java +++ b/core/src/test/java/org/elasticsearch/index/shard/NewPathForShardTests.java @@ -58,7 +58,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; /** Separate test class from ShardPathTests because we need static (BeforeClass) setup to install mock filesystems... */ @SuppressForbidden(reason = "ProviderMismatchException if I try to use PathUtils.getDefault instead") -public class NewPathForShardTest extends ESTestCase { +public class NewPathForShardTests extends ESTestCase { // Sneakiness to install mock file stores so we can pretend how much free space we have on each path.data: private static MockFileStore aFileStore = new MockFileStore("mocka"); diff --git a/core/src/test/java/org/elasticsearch/index/shard/VersionFieldUpgraderTest.java b/core/src/test/java/org/elasticsearch/index/shard/VersionFieldUpgraderTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/shard/VersionFieldUpgraderTest.java rename to core/src/test/java/org/elasticsearch/index/shard/VersionFieldUpgraderTests.java index cf25c1c8919..2fc02fb0503 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/VersionFieldUpgraderTest.java +++ b/core/src/test/java/org/elasticsearch/index/shard/VersionFieldUpgraderTests.java @@ -39,7 +39,7 @@ import org.elasticsearch.index.mapper.internal.VersionFieldMapper; import org.elasticsearch.test.ESTestCase; /** Tests upgrading old document versions from _uid payloads to _version docvalues */ -public class VersionFieldUpgraderTest extends ESTestCase { +public class VersionFieldUpgraderTests extends ESTestCase { /** Simple test: one doc in the old format, check that it looks correct */ public void testUpgradeOneDocument() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTest.java b/core/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTest.java rename to core/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java index 297c228d8b0..8a72a7723fd 100644 --- a/core/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTest.java +++ b/core/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java @@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.is; /** */ -public class FileInfoTest extends ESTestCase { +public class FileInfoTests extends ESTestCase { @Test public void testToFromXContent() throws IOException { diff --git a/core/src/test/java/org/elasticsearch/index/snapshots/blobstore/SlicedInputStreamTest.java b/core/src/test/java/org/elasticsearch/index/snapshots/blobstore/SlicedInputStreamTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/snapshots/blobstore/SlicedInputStreamTest.java rename to core/src/test/java/org/elasticsearch/index/snapshots/blobstore/SlicedInputStreamTests.java index 8adc7f645f0..e9deadb9d04 100644 --- a/core/src/test/java/org/elasticsearch/index/snapshots/blobstore/SlicedInputStreamTest.java +++ b/core/src/test/java/org/elasticsearch/index/snapshots/blobstore/SlicedInputStreamTests.java @@ -27,7 +27,7 @@ import java.util.Random; import static org.hamcrest.Matchers.equalTo; -public class SlicedInputStreamTest extends ESTestCase { +public class SlicedInputStreamTests extends ESTestCase { @Test public void readRandom() throws IOException { diff --git a/core/src/test/java/org/elasticsearch/index/store/DirectoryUtilsTest.java b/core/src/test/java/org/elasticsearch/index/store/DirectoryUtilsTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/store/DirectoryUtilsTest.java rename to core/src/test/java/org/elasticsearch/index/store/DirectoryUtilsTests.java index 3cfdaa26f17..04ae4676fe4 100644 --- a/core/src/test/java/org/elasticsearch/index/store/DirectoryUtilsTest.java +++ b/core/src/test/java/org/elasticsearch/index/store/DirectoryUtilsTests.java @@ -29,7 +29,7 @@ import java.util.Set; import static org.hamcrest.CoreMatchers.*; -public class DirectoryUtilsTest extends ESTestCase { +public class DirectoryUtilsTests extends ESTestCase { @Test public void testGetLeave() throws IOException { diff --git a/core/src/test/java/org/elasticsearch/index/store/IndexStoreBWCTest.java b/core/src/test/java/org/elasticsearch/index/store/IndexStoreBWCTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/store/IndexStoreBWCTest.java rename to core/src/test/java/org/elasticsearch/index/store/IndexStoreBWCTests.java index 7bb1a92be30..e53358c6631 100644 --- a/core/src/test/java/org/elasticsearch/index/store/IndexStoreBWCTest.java +++ b/core/src/test/java/org/elasticsearch/index/store/IndexStoreBWCTests.java @@ -37,7 +37,7 @@ import java.util.Locale; /** */ -public class IndexStoreBWCTest extends ESSingleNodeTestCase { +public class IndexStoreBWCTests extends ESSingleNodeTestCase { public void testOldCoreTypesFail() { diff --git a/core/src/test/java/org/elasticsearch/index/store/StoreTest.java b/core/src/test/java/org/elasticsearch/index/store/StoreTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/store/StoreTest.java rename to core/src/test/java/org/elasticsearch/index/store/StoreTests.java index 5757764d250..b2e49f34b91 100644 --- a/core/src/test/java/org/elasticsearch/index/store/StoreTest.java +++ b/core/src/test/java/org/elasticsearch/index/store/StoreTests.java @@ -65,7 +65,7 @@ import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS; import static org.elasticsearch.test.VersionUtils.randomVersion; import static org.hamcrest.Matchers.*; -public class StoreTest extends ESTestCase { +public class StoreTests extends ESTestCase { @Test public void testRefCount() throws IOException { @@ -693,7 +693,7 @@ public class StoreTest extends ESTestCase { public LuceneManagedDirectoryService(Random random, boolean preventDoubleWrite) { super(new ShardId("fake", 1), Settings.EMPTY); - dir = StoreTest.newDirectory(random); + dir = StoreTests.newDirectory(random); if (dir instanceof MockDirectoryWrapper) { ((MockDirectoryWrapper) dir).setPreventDoubleWrite(preventDoubleWrite); // TODO: fix this test to handle virus checker diff --git a/core/src/test/java/org/elasticsearch/indices/IndicesServiceTest.java b/core/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/indices/IndicesServiceTest.java rename to core/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java index 89f12904d27..08c33380a2b 100644 --- a/core/src/test/java/org/elasticsearch/indices/IndicesServiceTest.java +++ b/core/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java @@ -37,7 +37,7 @@ import java.util.concurrent.TimeUnit; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; -public class IndicesServiceTest extends ESSingleNodeTestCase { +public class IndicesServiceTests extends ESSingleNodeTestCase { public IndicesService getIndicesService() { return getInstanceFromNode(IndicesService.class); diff --git a/core/src/test/java/org/elasticsearch/indices/flush/SyncedFlushSingleNodeTest.java b/core/src/test/java/org/elasticsearch/indices/flush/SyncedFlushSingleNodeTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/indices/flush/SyncedFlushSingleNodeTest.java rename to core/src/test/java/org/elasticsearch/indices/flush/SyncedFlushSingleNodeTests.java index 80cc14392ff..06c2566fc21 100644 --- a/core/src/test/java/org/elasticsearch/indices/flush/SyncedFlushSingleNodeTest.java +++ b/core/src/test/java/org/elasticsearch/indices/flush/SyncedFlushSingleNodeTests.java @@ -36,7 +36,7 @@ import java.util.Map; /** */ -public class SyncedFlushSingleNodeTest extends ESSingleNodeTestCase { +public class SyncedFlushSingleNodeTests extends ESSingleNodeTestCase { public void testModificationPreventsFlushing() throws InterruptedException { createIndex("test"); diff --git a/core/src/test/java/org/elasticsearch/indices/recovery/RecoveryStateTest.java b/core/src/test/java/org/elasticsearch/indices/recovery/RecoveryStateTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/indices/recovery/RecoveryStateTest.java rename to core/src/test/java/org/elasticsearch/indices/recovery/RecoveryStateTests.java index 3f0fe79623b..3a571a6d917 100644 --- a/core/src/test/java/org/elasticsearch/indices/recovery/RecoveryStateTest.java +++ b/core/src/test/java/org/elasticsearch/indices/recovery/RecoveryStateTests.java @@ -40,7 +40,7 @@ import java.util.concurrent.atomic.AtomicReference; import static org.elasticsearch.test.VersionUtils.randomVersion; import static org.hamcrest.Matchers.*; -public class RecoveryStateTest extends ESTestCase { +public class RecoveryStateTests extends ESTestCase { abstract class Streamer extends Thread { diff --git a/core/src/test/java/org/elasticsearch/indices/recovery/StartRecoveryRequestTest.java b/core/src/test/java/org/elasticsearch/indices/recovery/StartRecoveryRequestTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/indices/recovery/StartRecoveryRequestTest.java rename to core/src/test/java/org/elasticsearch/indices/recovery/StartRecoveryRequestTests.java index 52c46c70a4e..4df825704d7 100644 --- a/core/src/test/java/org/elasticsearch/indices/recovery/StartRecoveryRequestTest.java +++ b/core/src/test/java/org/elasticsearch/indices/recovery/StartRecoveryRequestTests.java @@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.nullValue; /** */ -public class StartRecoveryRequestTest extends ESTestCase { +public class StartRecoveryRequestTests extends ESTestCase { @Test public void testSerialization() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/recovery/RecoverySettingsTest.java b/core/src/test/java/org/elasticsearch/recovery/RecoverySettingsTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/recovery/RecoverySettingsTest.java rename to core/src/test/java/org/elasticsearch/recovery/RecoverySettingsTests.java index 3d678865e4d..a722e3ab026 100644 --- a/core/src/test/java/org/elasticsearch/recovery/RecoverySettingsTest.java +++ b/core/src/test/java/org/elasticsearch/recovery/RecoverySettingsTests.java @@ -26,7 +26,7 @@ import org.junit.Test; import java.util.concurrent.TimeUnit; -public class RecoverySettingsTest extends ESSingleNodeTestCase { +public class RecoverySettingsTests extends ESSingleNodeTestCase { @Override protected boolean resetNodeAfterTest() { diff --git a/core/src/test/java/org/elasticsearch/rest/action/support/RestTableTest.java b/core/src/test/java/org/elasticsearch/rest/action/support/RestTableTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/rest/action/support/RestTableTest.java rename to core/src/test/java/org/elasticsearch/rest/action/support/RestTableTests.java index 3df6c256e21..237c62d93c7 100644 --- a/core/src/test/java/org/elasticsearch/rest/action/support/RestTableTest.java +++ b/core/src/test/java/org/elasticsearch/rest/action/support/RestTableTests.java @@ -31,7 +31,7 @@ import java.util.List; import static org.elasticsearch.rest.action.support.RestTable.buildDisplayHeaders; import static org.hamcrest.Matchers.*; -public class RestTableTest extends ESTestCase { +public class RestTableTests extends ESTestCase { private Table table = new Table(); private FakeRestRequest restRequest = new FakeRestRequest(); diff --git a/core/src/test/java/org/elasticsearch/script/ScriptParameterParserTest.java b/core/src/test/java/org/elasticsearch/script/ScriptParameterParserTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/script/ScriptParameterParserTest.java rename to core/src/test/java/org/elasticsearch/script/ScriptParameterParserTests.java index 70c6617592d..85dc650c6a3 100644 --- a/core/src/test/java/org/elasticsearch/script/ScriptParameterParserTest.java +++ b/core/src/test/java/org/elasticsearch/script/ScriptParameterParserTests.java @@ -38,7 +38,7 @@ import java.util.*; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; -public class ScriptParameterParserTest extends ESTestCase { +public class ScriptParameterParserTests extends ESTestCase { @Test public void testTokenDefaultInline() throws IOException { diff --git a/core/src/test/java/org/elasticsearch/script/mustache/MustacheScriptEngineTest.java b/core/src/test/java/org/elasticsearch/script/mustache/MustacheScriptEngineTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/script/mustache/MustacheScriptEngineTest.java rename to core/src/test/java/org/elasticsearch/script/mustache/MustacheScriptEngineTests.java index c2060b915fd..b44d180221e 100644 --- a/core/src/test/java/org/elasticsearch/script/mustache/MustacheScriptEngineTest.java +++ b/core/src/test/java/org/elasticsearch/script/mustache/MustacheScriptEngineTests.java @@ -37,7 +37,7 @@ import static org.hamcrest.Matchers.equalTo; /** * Mustache based templating test */ -public class MustacheScriptEngineTest extends ESTestCase { +public class MustacheScriptEngineTests extends ESTestCase { private MustacheScriptEngineService qe; private JsonEscapingMustacheFactory escaper; diff --git a/core/src/test/java/org/elasticsearch/script/mustache/MustacheTest.java b/core/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/script/mustache/MustacheTest.java rename to core/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java index 7dea0846df7..9bda581b6d5 100644 --- a/core/src/test/java/org/elasticsearch/script/mustache/MustacheTest.java +++ b/core/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java @@ -31,7 +31,7 @@ import java.util.HashMap; /** * Figure out how Mustache works for the simplest use case. Leaving in here for now for reference. * */ -public class MustacheTest extends ESTestCase { +public class MustacheTests extends ESTestCase { @Test public void test() { diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTest.java b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTest.java rename to core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTests.java index 15da498fb67..ef6112d87df 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTest.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTests.java @@ -55,7 +55,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class NestedAggregatorTest extends ESSingleNodeTestCase { +public class NestedAggregatorTests extends ESSingleNodeTestCase { @Test public void testResetRootDocId() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTest.java b/core/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTest.java rename to core/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java index 27d81f434c2..80a683c5021 100644 --- a/core/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTest.java +++ b/core/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java @@ -29,7 +29,7 @@ import java.util.Map; import static org.hamcrest.Matchers.*; -public class SearchSourceBuilderTest extends ESTestCase { +public class SearchSourceBuilderTests extends ESTestCase { SearchSourceBuilder builder = new SearchSourceBuilder(); diff --git a/core/src/test/java/org/elasticsearch/search/fetch/innerhits/NestedChildrenFilterTest.java b/core/src/test/java/org/elasticsearch/search/fetch/innerhits/NestedChildrenFilterTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/search/fetch/innerhits/NestedChildrenFilterTest.java rename to core/src/test/java/org/elasticsearch/search/fetch/innerhits/NestedChildrenFilterTests.java index 977ce01b3cc..ee0b52e319f 100644 --- a/core/src/test/java/org/elasticsearch/search/fetch/innerhits/NestedChildrenFilterTest.java +++ b/core/src/test/java/org/elasticsearch/search/fetch/innerhits/NestedChildrenFilterTests.java @@ -49,7 +49,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class NestedChildrenFilterTest extends ESTestCase { +public class NestedChildrenFilterTests extends ESTestCase { @Test public void testNestedChildrenFilter() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/search/suggest/CompletionTokenStreamTest.java b/core/src/test/java/org/elasticsearch/search/suggest/CompletionTokenStreamTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/search/suggest/CompletionTokenStreamTest.java rename to core/src/test/java/org/elasticsearch/search/suggest/CompletionTokenStreamTests.java index fde5037b850..d7280c89ef4 100644 --- a/core/src/test/java/org/elasticsearch/search/suggest/CompletionTokenStreamTest.java +++ b/core/src/test/java/org/elasticsearch/search/suggest/CompletionTokenStreamTests.java @@ -42,7 +42,7 @@ import java.util.Set; import static org.hamcrest.Matchers.equalTo; -public class CompletionTokenStreamTest extends ESTokenStreamTestCase { +public class CompletionTokenStreamTests extends ESTokenStreamTestCase { final XAnalyzingSuggester suggester = new XAnalyzingSuggester(new SimpleAnalyzer()); diff --git a/core/src/test/java/org/elasticsearch/search/suggest/completion/AnalyzingCompletionLookupProviderV1.java b/core/src/test/java/org/elasticsearch/search/suggest/completion/AnalyzingCompletionLookupProviderV1.java index eb78b6599d6..398310d3a0b 100644 --- a/core/src/test/java/org/elasticsearch/search/suggest/completion/AnalyzingCompletionLookupProviderV1.java +++ b/core/src/test/java/org/elasticsearch/search/suggest/completion/AnalyzingCompletionLookupProviderV1.java @@ -65,7 +65,7 @@ import static org.apache.lucene.search.suggest.analyzing.XAnalyzingSuggester.HOL /** * This is an older implementation of the AnalyzingCompletionLookupProvider class * We use this to test for backwards compatibility in our tests, namely - * CompletionPostingsFormatTest + * CompletionPostingsFormatTests * This ensures upgrades between versions work smoothly */ public class AnalyzingCompletionLookupProviderV1 extends CompletionLookupProvider { diff --git a/core/src/test/java/org/elasticsearch/search/suggest/completion/CompletionPostingsFormatTest.java b/core/src/test/java/org/elasticsearch/search/suggest/completion/CompletionPostingsFormatTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/search/suggest/completion/CompletionPostingsFormatTest.java rename to core/src/test/java/org/elasticsearch/search/suggest/completion/CompletionPostingsFormatTests.java index 35a222a75e1..672f8bbc673 100644 --- a/core/src/test/java/org/elasticsearch/search/suggest/completion/CompletionPostingsFormatTest.java +++ b/core/src/test/java/org/elasticsearch/search/suggest/completion/CompletionPostingsFormatTests.java @@ -70,7 +70,7 @@ import java.util.Set; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -public class CompletionPostingsFormatTest extends ESTestCase { +public class CompletionPostingsFormatTests extends ESTestCase { Settings indexSettings = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT.id).build(); static final CompletionFieldMapper.CompletionFieldType FIELD_TYPE = CompletionFieldMapper.Defaults.FIELD_TYPE.clone(); diff --git a/core/src/test/java/org/elasticsearch/search/suggest/context/GeoLocationContextMappingTest.java b/core/src/test/java/org/elasticsearch/search/suggest/context/GeoLocationContextMappingTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/search/suggest/context/GeoLocationContextMappingTest.java rename to core/src/test/java/org/elasticsearch/search/suggest/context/GeoLocationContextMappingTests.java index f1c17618556..60d2fd661a0 100644 --- a/core/src/test/java/org/elasticsearch/search/suggest/context/GeoLocationContextMappingTest.java +++ b/core/src/test/java/org/elasticsearch/search/suggest/context/GeoLocationContextMappingTests.java @@ -36,7 +36,7 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; /** * */ -public class GeoLocationContextMappingTest extends ESTestCase { +public class GeoLocationContextMappingTests extends ESTestCase { @Test public void testThatParsingGeoPointsWorksWithCoercion() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/test/ESIntegTestCase.java b/core/src/test/java/org/elasticsearch/test/ESIntegTestCase.java index 9fc8f9464c4..2dc270cc8c3 100644 --- a/core/src/test/java/org/elasticsearch/test/ESIntegTestCase.java +++ b/core/src/test/java/org/elasticsearch/test/ESIntegTestCase.java @@ -191,7 +191,7 @@ import static org.hamcrest.Matchers.*; * should be used, here is an example: *

  *
- * @ClusterScope(scope=Scope.TEST) public class SomeIntegrationTest extends ESIntegTestCase {
+ * @ClusterScope(scope=Scope.TEST) public class SomeIT extends ESIntegTestCase {
  * @Test public void testMethod() {}
  * }
  * 
@@ -204,7 +204,7 @@ import static org.hamcrest.Matchers.*; *

*

  * @ClusterScope(scope=Scope.SUITE, numDataNodes=3)
- * public class SomeIntegrationTest extends ESIntegTestCase {
+ * public class SomeIT extends ESIntegTestCase {
  * @Test public void testMethod() {}
  * }
  * 
diff --git a/core/src/test/java/org/elasticsearch/watcher/FileWatcherTest.java b/core/src/test/java/org/elasticsearch/watcher/FileWatcherTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/watcher/FileWatcherTest.java rename to core/src/test/java/org/elasticsearch/watcher/FileWatcherTests.java index 537fd873a09..14f7eca6832 100644 --- a/core/src/test/java/org/elasticsearch/watcher/FileWatcherTest.java +++ b/core/src/test/java/org/elasticsearch/watcher/FileWatcherTests.java @@ -35,7 +35,7 @@ import java.util.List; import static org.hamcrest.Matchers.*; @LuceneTestCase.SuppressFileSystems("ExtrasFS") -public class FileWatcherTest extends ESTestCase { +public class FileWatcherTests extends ESTestCase { private class RecordingChangeListener extends FileChangesListener { diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java similarity index 97% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java rename to plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java index f0a10c06042..1c460c1baa6 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java @@ -25,7 +25,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -public class AWSSignersTest extends ESTestCase { +public class AWSSignersTests extends ESTestCase { @Test public void testSigners() { diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTests.java similarity index 98% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTest.java rename to plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTests.java index b2dc66b8081..f40065c4e2b 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTests.java @@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.equalTo; /** * Unit test for {@link S3OutputStream}. */ -public class S3OutputStreamTest extends ESTestCase { +public class S3OutputStreamTests extends ESTestCase { private static final int BUFFER_SIZE = S3BlobStore.MIN_BUFFER_SIZE.bytesAsInt(); diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryTests.java similarity index 96% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java rename to plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryTests.java index f79b68f289d..8d9c45489ed 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryTests.java @@ -38,7 +38,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; * This test requires AWS to run. */ @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class Ec2DiscoveryITest extends AbstractAwsTestCase { +public class Ec2DiscoveryTests extends AbstractAwsTestCase { @Override protected Collection> nodePlugins() { diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java similarity index 97% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java rename to plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java index 1709d48e399..0fa2d0e4779 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java @@ -40,7 +40,7 @@ import static org.hamcrest.CoreMatchers.is; * This test requires AWS to run. */ @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class Ec2DiscoveryUpdateSettingsITest extends AbstractAwsTestCase { +public class Ec2DiscoveryUpdateSettingsTests extends AbstractAwsTestCase { @Override protected Collection> nodePlugins() { diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTests.java similarity index 94% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java rename to plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTests.java index a8df3165b4c..0710e12dc4d 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTests.java @@ -27,7 +27,7 @@ import org.junit.Before; * cloud.aws.s3.proxy_host: mys3proxy.company.com * cloud.aws.s3.proxy_port: 8080 */ -public class S3ProxiedSnapshotRestoreOverHttpsTest extends AbstractS3SnapshotRestoreTestCase { +public class S3ProxiedSnapshotRestoreOverHttpsTests extends AbstractS3SnapshotRestoreTestCase { private boolean proxySet = false; diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTests.java similarity index 92% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java rename to plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTests.java index 14eee25146d..cbfa4bdd9f2 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTests.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.settings.Settings; /** */ -public class S3SnapshotRestoreOverHttpTest extends AbstractS3SnapshotRestoreTestCase { +public class S3SnapshotRestoreOverHttpTests extends AbstractS3SnapshotRestoreTestCase { @Override public Settings nodeSettings(int nodeOrdinal) { Settings.Builder settings = Settings.builder() diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTests.java similarity index 92% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java rename to plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTests.java index c039e77be1c..2e0f47d8de5 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java +++ b/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTests.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.settings.Settings; /** */ -public class S3SnapshotRestoreOverHttpsTest extends AbstractS3SnapshotRestoreTestCase { +public class S3SnapshotRestoreOverHttpsTests extends AbstractS3SnapshotRestoreTestCase { @Override public Settings nodeSettings(int nodeOrdinal) { Settings.Builder settings = Settings.builder() diff --git a/plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbMMapDirectoryTest.java b/plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbMMapDirectoryTests.java similarity index 93% rename from plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbMMapDirectoryTest.java rename to plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbMMapDirectoryTests.java index eecaa4c13a2..43c61d8c9bb 100644 --- a/plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbMMapDirectoryTest.java +++ b/plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbMMapDirectoryTests.java @@ -22,7 +22,7 @@ package org.apache.lucene.store; import java.io.IOException; import java.nio.file.Path; -public class SmbMMapDirectoryTest extends ESBaseDirectoryTestCase { +public class SmbMMapDirectoryTests extends ESBaseDirectoryTestCase { @Override protected Directory getDirectory(Path file) throws IOException { diff --git a/plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbSimpleFSDirectoryTest.java b/plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbSimpleFSDirectoryTests.java similarity index 93% rename from plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbSimpleFSDirectoryTest.java rename to plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbSimpleFSDirectoryTests.java index 58cdb5f8cb6..208eb6c1447 100644 --- a/plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbSimpleFSDirectoryTest.java +++ b/plugins/cloud-azure/src/test/java/org/apache/lucene/store/SmbSimpleFSDirectoryTests.java @@ -22,7 +22,7 @@ package org.apache.lucene.store; import java.io.IOException; import java.nio.file.Path; -public class SmbSimpleFSDirectoryTest extends ESBaseDirectoryTestCase { +public class SmbSimpleFSDirectoryTests extends ESBaseDirectoryTestCase { @Override protected Directory getDirectory(Path file) throws IOException { diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/AzureSimpleITest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/AzureSimpleTests.java similarity index 97% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/AzureSimpleITest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/AzureSimpleTests.java index 80853862788..389f2a45ef6 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/AzureSimpleITest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/azure/itest/AzureSimpleTests.java @@ -36,7 +36,7 @@ import org.junit.Test; numDataNodes = 1, numClientNodes = 0, transportClientRatio = 0.0) -public class AzureSimpleITest extends AbstractAzureTestCase { +public class AzureSimpleTests extends AbstractAzureTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTestCaseCase.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTestCase.java similarity index 96% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTestCaseCase.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTestCase.java index c798c49a8ca..96fe8ebaec8 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTestCaseCase.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureRepositoryServiceTestCase.java @@ -35,7 +35,7 @@ import org.junit.Before; import java.net.URISyntaxException; import java.util.Collection; -public abstract class AbstractAzureRepositoryServiceTestCaseCase extends AbstractAzureTestCase { +public abstract class AbstractAzureRepositoryServiceTestCase extends AbstractAzureTestCase { public static class TestPlugin extends Plugin { @Override @@ -54,7 +54,7 @@ public abstract class AbstractAzureRepositoryServiceTestCaseCase extends Abstrac protected String basePath; private Class mock; - public AbstractAzureRepositoryServiceTestCaseCase(String basePath) { + public AbstractAzureRepositoryServiceTestCase(String basePath) { this.basePath = basePath; } diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTests.java similarity index 96% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTests.java index fa19137614a..846513623f0 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTests.java @@ -41,9 +41,9 @@ import static org.hamcrest.Matchers.nullValue; transportClientRatio = 0.0, numClientNodes = 0) @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch-cloud-azure/issues/89") -public class AzureMinimumMasterNodesTest extends AbstractAzureComputeServiceTestCase { +public class AzureMinimumMasterNodesTests extends AbstractAzureComputeServiceTestCase { - public AzureMinimumMasterNodesTest() { + public AzureMinimumMasterNodesTests() { super(AzureComputeServiceTwoNodesMock.TestPlugin.class); } diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTests.java similarity index 96% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTests.java index 4dcfacf21a1..74daf1a75e7 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureSimpleTests.java @@ -33,9 +33,9 @@ import static org.hamcrest.Matchers.notNullValue; numDataNodes = 0, transportClientRatio = 0.0, numClientNodes = 0) -public class AzureSimpleTest extends AbstractAzureComputeServiceTestCase { +public class AzureSimpleTests extends AbstractAzureComputeServiceTestCase { - public AzureSimpleTest() { + public AzureSimpleTests() { super(AzureComputeServiceSimpleMock.TestPlugin.class); } diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTests.java similarity index 96% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTests.java index a52deeb0fa8..dbccc4ac452 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/discovery/azure/AzureTwoStartedNodesTests.java @@ -33,9 +33,9 @@ import static org.hamcrest.Matchers.notNullValue; numDataNodes = 0, transportClientRatio = 0.0, numClientNodes = 0) -public class AzureTwoStartedNodesTest extends AbstractAzureComputeServiceTestCase { +public class AzureTwoStartedNodesTests extends AbstractAzureComputeServiceTestCase { - public AzureTwoStartedNodesTest() { + public AzureTwoStartedNodesTests() { super(AzureComputeServiceTwoNodesMock.TestPlugin.class); } diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbMMapFsTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbMMapFsTests.java similarity index 94% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbMMapFsTest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbMMapFsTests.java index 90bc85aac69..0f9e874b713 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbMMapFsTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbMMapFsTests.java @@ -22,7 +22,7 @@ package org.elasticsearch.index.store; import org.elasticsearch.common.settings.Settings; -public class SmbMMapFsTest extends AbstractAzureFsTestCase { +public class SmbMMapFsTests extends AbstractAzureFsTestCase { @Override public Settings indexSettings() { diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTests.java similarity index 94% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTests.java index 18be4967361..ed15718bc54 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/index/store/SmbSimpleFsTests.java @@ -22,7 +22,7 @@ package org.elasticsearch.index.store; import org.elasticsearch.common.settings.Settings; -public class SmbSimpleFsTest extends AbstractAzureFsTestCase { +public class SmbSimpleFsTests extends AbstractAzureFsTestCase { @Override public Settings indexSettings() { return Settings.builder() diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreServiceTests.java similarity index 97% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreServiceTests.java index b0475335870..37a21a38a8a 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreServiceTests.java @@ -24,7 +24,7 @@ import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResp import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse; import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.client.Client; -import org.elasticsearch.cloud.azure.AbstractAzureRepositoryServiceTestCaseCase; +import org.elasticsearch.cloud.azure.AbstractAzureRepositoryServiceTestCase; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; @@ -40,9 +40,9 @@ import static org.hamcrest.Matchers.greaterThan; numDataNodes = 1, numClientNodes = 0, transportClientRatio = 0.0) -public class AzureSnapshotRestoreTest extends AbstractAzureRepositoryServiceTestCaseCase { +public class AzureSnapshotRestoreServiceTests extends AbstractAzureRepositoryServiceTestCase { - public AzureSnapshotRestoreTest() { + public AzureSnapshotRestoreServiceTests() { super("/snapshot-test/repo-" + randomInt()); } diff --git a/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreITest.java b/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTests.java similarity index 99% rename from plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreITest.java rename to plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTests.java index a0039e2c255..6f8d0d0fac7 100644 --- a/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreITest.java +++ b/plugins/cloud-azure/src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreTests.java @@ -61,7 +61,7 @@ import static org.hamcrest.Matchers.greaterThan; scope = ESIntegTestCase.Scope.SUITE, numDataNodes = 1, transportClientRatio = 0.0) -public class AzureSnapshotRestoreITest extends AbstractAzureTestCase { +public class AzureSnapshotRestoreTests extends AbstractAzureTestCase { private String getRepositoryPath() { String testName = "it-".concat(Strings.toUnderscoreCase(getTestName()).replaceAll("_", "-")); diff --git a/plugins/cloud-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoveryTest.java b/plugins/cloud-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoveryTests.java similarity index 98% rename from plugins/cloud-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoveryTest.java rename to plugins/cloud-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoveryTests.java index a31597b8772..b18cca1d84e 100644 --- a/plugins/cloud-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoveryTest.java +++ b/plugins/cloud-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoveryTests.java @@ -59,7 +59,7 @@ import static org.hamcrest.Matchers.is; * compute/v1/projects/mynewawesometest/zones/europe-west1-b/instances.json * */ -public class GceDiscoveryTest extends ESTestCase { +public class GceDiscoveryTests extends ESTestCase { protected static ThreadPool threadPool; protected MockTransportService transportService; @@ -68,7 +68,7 @@ public class GceDiscoveryTest extends ESTestCase { @BeforeClass public static void createThreadPool() { - threadPool = new ThreadPool(GceDiscoveryTest.class.getName()); + threadPool = new ThreadPool(GceDiscoveryTests.class.getName()); } @AfterClass diff --git a/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptMultiThreadedTest.java b/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptMultiThreadedTests.java similarity index 99% rename from plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptMultiThreadedTest.java rename to plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptMultiThreadedTests.java index e56ff8337ee..1d9090d94b2 100644 --- a/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptMultiThreadedTest.java +++ b/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptMultiThreadedTests.java @@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class JavaScriptScriptMultiThreadedTest extends ESTestCase { +public class JavaScriptScriptMultiThreadedTests extends ESTestCase { @Test public void testExecutableNoRuntimeParams() throws Exception { diff --git a/plugins/lang-python/src/test/java/org/elasticsearch/script/python/PythonScriptMultiThreadedTest.java b/plugins/lang-python/src/test/java/org/elasticsearch/script/python/PythonScriptMultiThreadedTests.java similarity index 99% rename from plugins/lang-python/src/test/java/org/elasticsearch/script/python/PythonScriptMultiThreadedTest.java rename to plugins/lang-python/src/test/java/org/elasticsearch/script/python/PythonScriptMultiThreadedTests.java index c4eb9851d05..6798dab8ef0 100644 --- a/plugins/lang-python/src/test/java/org/elasticsearch/script/python/PythonScriptMultiThreadedTest.java +++ b/plugins/lang-python/src/test/java/org/elasticsearch/script/python/PythonScriptMultiThreadedTests.java @@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class PythonScriptMultiThreadedTest extends ESTestCase { +public class PythonScriptMultiThreadedTests extends ESTestCase { @After public void close() { diff --git a/pom.xml b/pom.xml index 4baecd6cbe4..b86f2de5a93 100644 --- a/pom.xml +++ b/pom.xml @@ -716,7 +716,6 @@ **/*Tests.class - **/*Test.class **/*$*.class From 8057f71c1d6b7fd015ab22086e1b5f0c9ba13345 Mon Sep 17 00:00:00 2001 From: Stephen Samuel Date: Wed, 2 Sep 2015 23:07:17 +0100 Subject: [PATCH 29/40] Updated param name to match type --- .../org/elasticsearch/cluster/metadata/AliasAction.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/cluster/metadata/AliasAction.java b/core/src/main/java/org/elasticsearch/cluster/metadata/AliasAction.java index b69849bc059..a039ce80418 100644 --- a/core/src/main/java/org/elasticsearch/cluster/metadata/AliasAction.java +++ b/core/src/main/java/org/elasticsearch/cluster/metadata/AliasAction.java @@ -154,14 +154,14 @@ public class AliasAction implements Streamable { } } - public AliasAction filter(QueryBuilder filterBuilder) { - if (filterBuilder == null) { + public AliasAction filter(QueryBuilder queryBuilder) { + if (queryBuilder == null) { this.filter = null; return this; } try { XContentBuilder builder = XContentFactory.jsonBuilder(); - filterBuilder.toXContent(builder, ToXContent.EMPTY_PARAMS); + queryBuilder.toXContent(builder, ToXContent.EMPTY_PARAMS); builder.close(); this.filter = builder.string(); return this; From 3b0b05f6cdf57a7e1bd9d5c3b2aa4c3aafeb354a Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Wed, 2 Sep 2015 16:44:18 -0600 Subject: [PATCH 30/40] Don't surround -Xloggc log filename with quotes The `-Xloggc:filename.log` parameter has very strict filename semantics: ``` [A-Z][a-z][0-9]-_.%[p|t] ``` Our script specifies \" and \" to surround it, which makes Java think we are sending: -Xloggc:"foo.log" and it fails with: ``` Invalid file name for use with -Xloggc: Filename can only contain the characters [A-Z][a-z][0-9]-_.%[p|t] but it has been "foo.log" Note %p or %t can only be used once Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. ``` We can't quote this, and we should not need to since the valid characters don't include a space character, so we don't need to worry about quoting. Resolves #13277 --- distribution/src/main/resources/bin/elasticsearch.in.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/src/main/resources/bin/elasticsearch.in.sh b/distribution/src/main/resources/bin/elasticsearch.in.sh index 527819d601e..2661544cb52 100644 --- a/distribution/src/main/resources/bin/elasticsearch.in.sh +++ b/distribution/src/main/resources/bin/elasticsearch.in.sh @@ -62,7 +62,7 @@ if [ -n "$ES_GC_LOG_FILE" ]; then JAVA_OPTS="$JAVA_OPTS -XX:+PrintClassHistogram" JAVA_OPTS="$JAVA_OPTS -XX:+PrintTenuringDistribution" JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCApplicationStoppedTime" - JAVA_OPTS="$JAVA_OPTS -Xloggc:\"$ES_GC_LOG_FILE\"" + JAVA_OPTS="$JAVA_OPTS -Xloggc:$ES_GC_LOG_FILE" # Ensure that the directory for the log file exists: the JVM will not create it. mkdir -p "`dirname \"$ES_GC_LOG_FILE\"`" From e288c9b0ce65ae006068333792a97479bf82bc03 Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Wed, 2 Sep 2015 17:47:30 -0400 Subject: [PATCH 31/40] Tests: set the upper bound on the number of simulated failures in a restore test The number and distribution of errors in some restore test may cause restore process to continue to fail for a prolong time. This test caps the total number of simulated failures to make sure that restore is guaranteed to eventually succeed after a limited number of retries. --- .../snapshots/SharedClusterSnapshotRestoreIT.java | 1 + .../snapshots/mockstore/MockRepository.java | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java b/core/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java index b327c064e2e..aea102d5e26 100644 --- a/core/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java +++ b/core/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java @@ -669,6 +669,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas assertThat(restoreSnapshotResponse.getRestoreInfo().totalShards(), greaterThan(0)); CountResponse countResponse = client.prepareCount("test-idx").get(); assertThat(countResponse.getCount(), equalTo(100L)); + logger.info("--> total number of simulated failures during restore: [{}]", getFailureCount("test-repo")); } diff --git a/core/src/test/java/org/elasticsearch/snapshots/mockstore/MockRepository.java b/core/src/test/java/org/elasticsearch/snapshots/mockstore/MockRepository.java index e430827d881..be10f6b399e 100644 --- a/core/src/test/java/org/elasticsearch/snapshots/mockstore/MockRepository.java +++ b/core/src/test/java/org/elasticsearch/snapshots/mockstore/MockRepository.java @@ -108,6 +108,8 @@ public class MockRepository extends FsRepository { private final double randomDataFileIOExceptionRate; + private final long maximumNumberOfFailures; + private final long waitAfterUnblock; private final MockBlobStore mockBlobStore; @@ -127,6 +129,7 @@ public class MockRepository extends FsRepository { super(name, overrideSettings(repositorySettings, clusterService), indexShardRepository, environment); randomControlIOExceptionRate = repositorySettings.settings().getAsDouble("random_control_io_exception_rate", 0.0); randomDataFileIOExceptionRate = repositorySettings.settings().getAsDouble("random_data_file_io_exception_rate", 0.0); + maximumNumberOfFailures = repositorySettings.settings().getAsLong("max_failure_number", 100L); blockOnControlFiles = repositorySettings.settings().getAsBoolean("block_on_control", false); blockOnDataFiles = repositorySettings.settings().getAsBoolean("block_on_data", false); blockOnInitialization = repositorySettings.settings().getAsBoolean("block_on_init", false); @@ -160,8 +163,8 @@ public class MockRepository extends FsRepository { return settingsBuilder().put(settings).put("location", location.toAbsolutePath()).build(); } - private void addFailure() { - failureCounter.incrementAndGet(); + private long incrementAndGetFailureCount() { + return failureCounter.incrementAndGet(); } @Override @@ -269,9 +272,8 @@ public class MockRepository extends FsRepository { private void maybeIOExceptionOrBlock(String blobName) throws IOException { if (blobName.startsWith("__")) { - if (shouldFail(blobName, randomDataFileIOExceptionRate)) { + if (shouldFail(blobName, randomDataFileIOExceptionRate) && (incrementAndGetFailureCount() < maximumNumberOfFailures)) { logger.info("throwing random IOException for file [{}] at path [{}]", blobName, path()); - addFailure(); throw new IOException("Random IOException"); } else if (blockOnDataFiles) { logger.info("blocking I/O operation for file [{}] at path [{}]", blobName, path()); @@ -286,9 +288,8 @@ public class MockRepository extends FsRepository { } } } else { - if (shouldFail(blobName, randomControlIOExceptionRate)) { + if (shouldFail(blobName, randomControlIOExceptionRate) && (incrementAndGetFailureCount() < maximumNumberOfFailures)) { logger.info("throwing random IOException for file [{}] at path [{}]", blobName, path()); - addFailure(); throw new IOException("Random IOException"); } else if (blockOnControlFiles) { logger.info("blocking I/O operation for file [{}] at path [{}]", blobName, path()); From bd44dbe5cdbe457f3e6ff51f0b6202d79253037f Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Thu, 3 Sep 2015 09:36:03 +0200 Subject: [PATCH 32/40] Docs: Insist that setting size=0 will help performance. --- docs/reference/search/request-body.asciidoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/reference/search/request-body.asciidoc b/docs/reference/search/request-body.asciidoc index 1469073b2c7..857047cd51c 100644 --- a/docs/reference/search/request-body.asciidoc +++ b/docs/reference/search/request-body.asciidoc @@ -59,7 +59,9 @@ And here is a sample response: `size`:: - The number of hits to return. Defaults to `10`. + The number of hits to return. Defaults to `10`. If you do not care about + getting some hits back but only about the number of matches and/or + aggregations, setting the value to `0` will help performance. `search_type`:: From 5ff9ca9965a5b38d463dbb2a45161f1b2c95a4af Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Fri, 21 Aug 2015 13:47:26 +0200 Subject: [PATCH 33/40] Optimize counts on simple queries. Today we always collect in order to compute counts, but some of them can be easily optimized by using pre-computed index statistics. This is especially true in the case that there are no deletions, which should be common for the time-based data use-case. Counts on match_all queries can always be optimized, so requests like ``` GET index/_search?size=0 GET index/_search { "size": 0, "query" : { "match_all": {} } } ``` should now return almost instantly. Additionally, when there are no deletions, term queries are also optimized, so the below queries which all boil down to a single term query would also return almost immediately: ``` GET index/type/_search?size=0 GET index/_search { "size": 0, "query" : { "match": { "foo": "bar" } } } GET index/_search { "size": 0, "query" : { "constant_score": { "filter": { "exists": { "field": "foo" } } } } } ``` --- .../search/query/QueryPhase.java | 92 ++++++++-- .../search/query/QueryPhaseTests.java | 167 ++++++++++++++++++ .../elasticsearch/test/TestSearchContext.java | 28 ++- 3 files changed, 261 insertions(+), 26 deletions(-) create mode 100644 core/src/test/java/org/elasticsearch/search/query/QueryPhaseTests.java diff --git a/core/src/main/java/org/elasticsearch/search/query/QueryPhase.java b/core/src/main/java/org/elasticsearch/search/query/QueryPhase.java index 06451af2be9..a7c022aba28 100644 --- a/core/src/main/java/org/elasticsearch/search/query/QueryPhase.java +++ b/core/src/main/java/org/elasticsearch/search/query/QueryPhase.java @@ -20,6 +20,9 @@ package org.elasticsearch.search.query; import com.google.common.collect.ImmutableMap; + +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.Term; import org.apache.lucene.queries.MinDocQuery; import org.apache.lucene.search.*; import org.elasticsearch.action.search.SearchType; @@ -100,23 +103,39 @@ public class QueryPhase implements SearchPhase { // here to make sure it happens during the QUERY phase aggregationPhase.preProcess(searchContext); - searchContext.queryResult().searchTimedOut(false); + boolean rescore = execute(searchContext, searchContext.searcher()); + + if (rescore) { // only if we do a regular search + rescorePhase.execute(searchContext); + } + suggestPhase.execute(searchContext); + aggregationPhase.execute(searchContext); + } + + /** + * In a package-private method so that it can be tested without having to + * wire everything (mapperService, etc.) + * @return whether the rescoring phase should be executed + */ + static boolean execute(SearchContext searchContext, final IndexSearcher searcher) throws QueryPhaseExecutionException { + QuerySearchResult queryResult = searchContext.queryResult(); + queryResult.searchTimedOut(false); final SearchType searchType = searchContext.searchType(); boolean rescore = false; try { - searchContext.queryResult().from(searchContext.from()); - searchContext.queryResult().size(searchContext.size()); + queryResult.from(searchContext.from()); + queryResult.size(searchContext.size()); - final IndexSearcher searcher = searchContext.searcher(); Query query = searchContext.query(); final int totalNumDocs = searcher.getIndexReader().numDocs(); int numDocs = Math.min(searchContext.from() + searchContext.size(), totalNumDocs); Collector collector; - final Callable topDocsCallable; + Callable topDocsCallable; + assert query == searcher.rewrite(query); // already rewritten if (searchContext.size() == 0) { // no matter what the value of from is final TotalHitCountCollector totalHitCountCollector = new TotalHitCountCollector(); collector = totalHitCountCollector; @@ -240,36 +259,75 @@ public class QueryPhase implements SearchPhase { collector = new MinimumScoreCollector(collector, searchContext.minimumScore()); } + if (collector.getClass() == TotalHitCountCollector.class) { + // Optimize counts in simple cases to return in constant time + // instead of using a collector + while (true) { + // remove wrappers that don't matter for counts + // this is necessary so that we don't only optimize match_all + // queries but also match_all queries that are nested in + // a constant_score query + if (query instanceof ConstantScoreQuery) { + query = ((ConstantScoreQuery) query).getQuery(); + } else { + break; + } + } + + if (query.getClass() == MatchAllDocsQuery.class) { + collector = null; + topDocsCallable = new Callable() { + @Override + public TopDocs call() throws Exception { + int count = searcher.getIndexReader().numDocs(); + return new TopDocs(count, Lucene.EMPTY_SCORE_DOCS, 0); + } + }; + } else if (query.getClass() == TermQuery.class && searcher.getIndexReader().hasDeletions() == false) { + final Term term = ((TermQuery) query).getTerm(); + collector = null; + topDocsCallable = new Callable() { + @Override + public TopDocs call() throws Exception { + int count = 0; + for (LeafReaderContext context : searcher.getIndexReader().leaves()) { + count += context.reader().docFreq(term); + } + return new TopDocs(count, Lucene.EMPTY_SCORE_DOCS, 0); + } + }; + } + } + final boolean timeoutSet = searchContext.timeoutInMillis() != SearchService.NO_TIMEOUT.millis(); - if (timeoutSet) { + if (timeoutSet && collector != null) { // collector might be null if no collection is actually needed // TODO: change to use our own counter that uses the scheduler in ThreadPool // throws TimeLimitingCollector.TimeExceededException when timeout has reached collector = Lucene.wrapTimeLimitingCollector(collector, searchContext.timeEstimateCounter(), searchContext.timeoutInMillis()); } try { - searchContext.searcher().search(query, collector); + if (collector != null) { + searcher.search(query, collector); + } } catch (TimeLimitingCollector.TimeExceededException e) { assert timeoutSet : "TimeExceededException thrown even though timeout wasn't set"; - searchContext.queryResult().searchTimedOut(true); + queryResult.searchTimedOut(true); } catch (Lucene.EarlyTerminationException e) { assert terminateAfterSet : "EarlyTerminationException thrown even though terminateAfter wasn't set"; - searchContext.queryResult().terminatedEarly(true); + queryResult.terminatedEarly(true); } finally { searchContext.clearReleasables(SearchContext.Lifetime.COLLECTION); } - if (terminateAfterSet && searchContext.queryResult().terminatedEarly() == null) { - searchContext.queryResult().terminatedEarly(false); + if (terminateAfterSet && queryResult.terminatedEarly() == null) { + queryResult.terminatedEarly(false); } - searchContext.queryResult().topDocs(topDocsCallable.call()); + queryResult.topDocs(topDocsCallable.call()); + + return rescore; } catch (Throwable e) { throw new QueryPhaseExecutionException(searchContext, "Failed to execute main query", e); } - if (rescore) { // only if we do a regular search - rescorePhase.execute(searchContext); - } - suggestPhase.execute(searchContext); - aggregationPhase.execute(searchContext); } } diff --git a/core/src/test/java/org/elasticsearch/search/query/QueryPhaseTests.java b/core/src/test/java/org/elasticsearch/search/query/QueryPhaseTests.java new file mode 100644 index 00000000000..99d600752ad --- /dev/null +++ b/core/src/test/java/org/elasticsearch/search/query/QueryPhaseTests.java @@ -0,0 +1,167 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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. + */ + +package org.elasticsearch.search.query; + +import org.apache.lucene.document.Document; +import org.apache.lucene.document.Field.Store; +import org.apache.lucene.document.StringField; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.MultiReader; +import org.apache.lucene.index.NoMergePolicy; +import org.apache.lucene.index.RandomIndexWriter; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.BooleanClause.Occur; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.ConstantScoreQuery; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.MatchAllDocsQuery; +import org.apache.lucene.search.MatchNoDocsQuery; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.TermQuery; +import org.apache.lucene.search.Weight; +import org.apache.lucene.store.Directory; +import org.elasticsearch.index.query.ParsedQuery; +import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.test.TestSearchContext; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; + +public class QueryPhaseTests extends ESTestCase { + + private void countTestCase(Query query, IndexReader reader, boolean shouldCollect) throws Exception { + TestSearchContext context = new TestSearchContext(); + context.parsedQuery(new ParsedQuery(query)); + context.setSize(0); + + IndexSearcher searcher = new IndexSearcher(reader); + final AtomicBoolean collected = new AtomicBoolean(); + IndexSearcher contextSearcher = new IndexSearcher(reader) { + protected void search(List leaves, Weight weight, Collector collector) throws IOException { + collected.set(true); + super.search(leaves, weight, collector); + } + }; + + final boolean rescore = QueryPhase.execute(context, contextSearcher); + assertFalse(rescore); + assertEquals(searcher.count(query), context.queryResult().topDocs().totalHits); + assertEquals(shouldCollect, collected.get()); + } + + private void countTestCase(boolean withDeletions) throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig().setMergePolicy(NoMergePolicy.INSTANCE); + RandomIndexWriter w = new RandomIndexWriter(getRandom(), dir, iwc); + final int numDocs = scaledRandomIntBetween(100, 200); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + if (randomBoolean()) { + doc.add(new StringField("foo", "bar", Store.NO)); + } + if (randomBoolean()) { + doc.add(new StringField("foo", "baz", Store.NO)); + } + if (withDeletions && (rarely() || i == 0)) { + doc.add(new StringField("delete", "yes", Store.NO)); + } + w.addDocument(doc); + } + if (withDeletions) { + w.deleteDocuments(new Term("delete", "yes")); + } + final IndexReader reader = w.getReader(); + Query matchAll = new MatchAllDocsQuery(); + Query matchAllCsq = new ConstantScoreQuery(matchAll); + Query tq = new TermQuery(new Term("foo", "bar")); + Query tCsq = new ConstantScoreQuery(tq); + BooleanQuery bq = new BooleanQuery(); + bq.add(matchAll, Occur.SHOULD); + bq.add(tq, Occur.MUST); + + countTestCase(matchAll, reader, false); + countTestCase(matchAllCsq, reader, false); + countTestCase(tq, reader, withDeletions); + countTestCase(tCsq, reader, withDeletions); + countTestCase(bq, reader, true); + reader.close(); + w.close(); + dir.close(); + } + + public void testCountWithoutDeletions() throws Exception { + countTestCase(false); + } + + public void testCountWithDeletions() throws Exception { + countTestCase(true); + } + + public void testPostFilterDisablesCountOptimization() throws Exception { + TestSearchContext context = new TestSearchContext(); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.setSize(0); + + final AtomicBoolean collected = new AtomicBoolean(); + IndexSearcher contextSearcher = new IndexSearcher(new MultiReader()) { + protected void search(List leaves, Weight weight, Collector collector) throws IOException { + collected.set(true); + super.search(leaves, weight, collector); + } + }; + + QueryPhase.execute(context, contextSearcher); + assertEquals(0, context.queryResult().topDocs().totalHits); + assertFalse(collected.get()); + + context.parsedPostFilter(new ParsedQuery(new MatchNoDocsQuery())); + QueryPhase.execute(context, contextSearcher); + assertEquals(0, context.queryResult().topDocs().totalHits); + assertTrue(collected.get()); + } + + public void testMinScoreDisablesCountOptimization() throws Exception { + TestSearchContext context = new TestSearchContext(); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.setSize(0); + + final AtomicBoolean collected = new AtomicBoolean(); + IndexSearcher contextSearcher = new IndexSearcher(new MultiReader()) { + protected void search(List leaves, Weight weight, Collector collector) throws IOException { + collected.set(true); + super.search(leaves, weight, collector); + } + }; + + QueryPhase.execute(context, contextSearcher); + assertEquals(0, context.queryResult().topDocs().totalHits); + assertFalse(collected.get()); + + context.minimumScore(1); + QueryPhase.execute(context, contextSearcher); + assertEquals(0, context.queryResult().topDocs().totalHits); + assertTrue(collected.get()); + } + +} diff --git a/core/src/test/java/org/elasticsearch/test/TestSearchContext.java b/core/src/test/java/org/elasticsearch/test/TestSearchContext.java index 48725f4c3e4..56766b748b0 100644 --- a/core/src/test/java/org/elasticsearch/test/TestSearchContext.java +++ b/core/src/test/java/org/elasticsearch/test/TestSearchContext.java @@ -83,6 +83,12 @@ public class TestSearchContext extends SearchContext { final ThreadPool threadPool; final Map, Collector> queryCollectors = new HashMap<>(); final IndexShard indexShard; + final Counter timeEstimateCounter = Counter.newCounter(); + final QuerySearchResult queryResult = new QuerySearchResult(); + ParsedQuery originalQuery; + ParsedQuery postFilter; + Query query; + Float minScore; ContextIndexSearcher searcher; int size; @@ -363,12 +369,13 @@ public class TestSearchContext extends SearchContext { @Override public SearchContext minimumScore(float minimumScore) { - return null; + this.minScore = minimumScore; + return this; } @Override public Float minimumScore() { - return null; + return minScore; } @Override @@ -393,12 +400,13 @@ public class TestSearchContext extends SearchContext { @Override public SearchContext parsedPostFilter(ParsedQuery postFilter) { - return null; + this.postFilter = postFilter; + return this; } @Override public ParsedQuery parsedPostFilter() { - return null; + return postFilter; } @Override @@ -408,17 +416,19 @@ public class TestSearchContext extends SearchContext { @Override public SearchContext parsedQuery(ParsedQuery query) { - return null; + this.originalQuery = query; + this.query = query.query(); + return this; } @Override public ParsedQuery parsedQuery() { - return null; + return originalQuery; } @Override public Query query() { - return null; + return query; } @Override @@ -537,7 +547,7 @@ public class TestSearchContext extends SearchContext { @Override public QuerySearchResult queryResult() { - return null; + return queryResult; } @Override @@ -580,7 +590,7 @@ public class TestSearchContext extends SearchContext { @Override public Counter timeEstimateCounter() { - throw new UnsupportedOperationException(); + return timeEstimateCounter; } @Override From 796701d52e8a5fd7a1aee8c1023b50e41cdb17f1 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Thu, 3 Sep 2015 10:43:28 +0200 Subject: [PATCH 34/40] Move version to 3.0.0-SNAPSHOT --- core/pom.xml | 2 +- core/src/main/java/org/elasticsearch/Version.java | 7 +++++-- dev-tools/pom.xml | 2 +- distribution/deb/pom.xml | 2 +- distribution/pom.xml | 2 +- distribution/rpm/pom.xml | 2 +- distribution/tar/pom.xml | 2 +- distribution/zip/pom.xml | 2 +- plugins/analysis-icu/pom.xml | 2 +- plugins/analysis-kuromoji/pom.xml | 2 +- plugins/analysis-phonetic/pom.xml | 2 +- plugins/analysis-smartcn/pom.xml | 2 +- plugins/analysis-stempel/pom.xml | 2 +- plugins/cloud-aws/pom.xml | 2 +- plugins/cloud-azure/pom.xml | 2 +- plugins/cloud-gce/pom.xml | 2 +- plugins/delete-by-query/pom.xml | 2 +- plugins/discovery-multicast/pom.xml | 2 +- plugins/jvm-example/pom.xml | 2 +- plugins/lang-javascript/pom.xml | 2 +- plugins/lang-python/pom.xml | 2 +- plugins/mapper-murmur3/pom.xml | 2 +- plugins/mapper-size/pom.xml | 2 +- plugins/pom.xml | 4 ++-- plugins/site-example/pom.xml | 2 +- pom.xml | 2 +- qa/pom.xml | 4 ++-- qa/smoke-test-client/pom.xml | 2 +- qa/smoke-test-multinode/pom.xml | 2 +- qa/smoke-test-plugins/pom.xml | 2 +- qa/vagrant/pom.xml | 2 +- rest-api-spec/pom.xml | 2 +- 32 files changed, 38 insertions(+), 35 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 4b55f93aa19..4004209ff3f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -6,7 +6,7 @@ org.elasticsearch parent - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT org.elasticsearch diff --git a/core/src/main/java/org/elasticsearch/Version.java b/core/src/main/java/org/elasticsearch/Version.java index 624aa02e416..494ae24222b 100644 --- a/core/src/main/java/org/elasticsearch/Version.java +++ b/core/src/main/java/org/elasticsearch/Version.java @@ -259,8 +259,9 @@ public class Version { public static final Version V_2_0_0 = new Version(V_2_0_0_ID, true, org.apache.lucene.util.Version.LUCENE_5_2_1); public static final int V_2_1_0_ID = 2010099; public static final Version V_2_1_0 = new Version(V_2_1_0_ID, true, org.apache.lucene.util.Version.LUCENE_5_3_0); - - public static final Version CURRENT = V_2_1_0; + public static final int V_3_0_0_ID = 3000099; + public static final Version V_3_0_0 = new Version(V_3_0_0_ID, true, org.apache.lucene.util.Version.LUCENE_5_3_0); + public static final Version CURRENT = V_3_0_0; static { assert CURRENT.luceneVersion.equals(Lucene.VERSION) : "Version must be upgraded to [" + Lucene.VERSION + "] is still set to [" + CURRENT.luceneVersion + "]"; @@ -272,6 +273,8 @@ public class Version { public static Version fromId(int id) { switch (id) { + case V_3_0_0_ID: + return V_3_0_0; case V_2_1_0_ID: return V_2_1_0; case V_2_0_0_ID: diff --git a/dev-tools/pom.xml b/dev-tools/pom.xml index 760f13579a0..f02d6a8762a 100644 --- a/dev-tools/pom.xml +++ b/dev-tools/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.elasticsearch dev-tools - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT Build Tools and Resources Tools to assist in building and developing in the Elasticsearch project diff --git a/distribution/deb/pom.xml b/distribution/deb/pom.xml index aae6f6f4595..72376749357 100644 --- a/distribution/deb/pom.xml +++ b/distribution/deb/pom.xml @@ -6,7 +6,7 @@ org.elasticsearch.distribution distributions - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT org.elasticsearch.distribution.deb diff --git a/distribution/pom.xml b/distribution/pom.xml index 94cd8ad75e7..44c59b8ed97 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -6,7 +6,7 @@ org.elasticsearch parent - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT org.elasticsearch.distribution diff --git a/distribution/rpm/pom.xml b/distribution/rpm/pom.xml index f0e22b64963..37f7203d052 100644 --- a/distribution/rpm/pom.xml +++ b/distribution/rpm/pom.xml @@ -6,7 +6,7 @@ org.elasticsearch.distribution distributions - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT org.elasticsearch.distribution.rpm diff --git a/distribution/tar/pom.xml b/distribution/tar/pom.xml index 744d7c924e7..f1ce8271c0c 100644 --- a/distribution/tar/pom.xml +++ b/distribution/tar/pom.xml @@ -6,7 +6,7 @@ org.elasticsearch.distribution distributions - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT org.elasticsearch.distribution.tar diff --git a/distribution/zip/pom.xml b/distribution/zip/pom.xml index 6bb38fbb579..a24c4492d70 100644 --- a/distribution/zip/pom.xml +++ b/distribution/zip/pom.xml @@ -6,7 +6,7 @@ org.elasticsearch.distribution distributions - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT org.elasticsearch.distribution.zip diff --git a/plugins/analysis-icu/pom.xml b/plugins/analysis-icu/pom.xml index b13f69dbd53..a9fced71b17 100644 --- a/plugins/analysis-icu/pom.xml +++ b/plugins/analysis-icu/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT analysis-icu diff --git a/plugins/analysis-kuromoji/pom.xml b/plugins/analysis-kuromoji/pom.xml index 71d290fddc1..9b28307ac0f 100644 --- a/plugins/analysis-kuromoji/pom.xml +++ b/plugins/analysis-kuromoji/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT analysis-kuromoji diff --git a/plugins/analysis-phonetic/pom.xml b/plugins/analysis-phonetic/pom.xml index a5b726ecf7d..a2b47f17c95 100644 --- a/plugins/analysis-phonetic/pom.xml +++ b/plugins/analysis-phonetic/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT analysis-phonetic diff --git a/plugins/analysis-smartcn/pom.xml b/plugins/analysis-smartcn/pom.xml index 294dbaa4b7a..64e7b79f5cd 100644 --- a/plugins/analysis-smartcn/pom.xml +++ b/plugins/analysis-smartcn/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT analysis-smartcn diff --git a/plugins/analysis-stempel/pom.xml b/plugins/analysis-stempel/pom.xml index 139e3dbd908..4b9b7c33985 100644 --- a/plugins/analysis-stempel/pom.xml +++ b/plugins/analysis-stempel/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT analysis-stempel diff --git a/plugins/cloud-aws/pom.xml b/plugins/cloud-aws/pom.xml index 7d0ea71940a..e41b09481a5 100644 --- a/plugins/cloud-aws/pom.xml +++ b/plugins/cloud-aws/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT cloud-aws diff --git a/plugins/cloud-azure/pom.xml b/plugins/cloud-azure/pom.xml index f7fa9dceb2d..e5e19454a9f 100644 --- a/plugins/cloud-azure/pom.xml +++ b/plugins/cloud-azure/pom.xml @@ -18,7 +18,7 @@ governing permissions and limitations under the License. --> org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT cloud-azure diff --git a/plugins/cloud-gce/pom.xml b/plugins/cloud-gce/pom.xml index 724036aafcd..38fed6ea444 100644 --- a/plugins/cloud-gce/pom.xml +++ b/plugins/cloud-gce/pom.xml @@ -18,7 +18,7 @@ governing permissions and limitations under the License. --> org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT cloud-gce diff --git a/plugins/delete-by-query/pom.xml b/plugins/delete-by-query/pom.xml index 07d3bb8fbe8..105c9f9ab4a 100644 --- a/plugins/delete-by-query/pom.xml +++ b/plugins/delete-by-query/pom.xml @@ -18,7 +18,7 @@ governing permissions and limitations under the License. --> org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT delete-by-query diff --git a/plugins/discovery-multicast/pom.xml b/plugins/discovery-multicast/pom.xml index 937034a46b8..eaa1e112f34 100644 --- a/plugins/discovery-multicast/pom.xml +++ b/plugins/discovery-multicast/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT discovery-multicast diff --git a/plugins/jvm-example/pom.xml b/plugins/jvm-example/pom.xml index be67cf54eb1..aa7d8530728 100644 --- a/plugins/jvm-example/pom.xml +++ b/plugins/jvm-example/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT jvm-example diff --git a/plugins/lang-javascript/pom.xml b/plugins/lang-javascript/pom.xml index eaaa29a34b7..a9851a824ad 100644 --- a/plugins/lang-javascript/pom.xml +++ b/plugins/lang-javascript/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT lang-javascript diff --git a/plugins/lang-python/pom.xml b/plugins/lang-python/pom.xml index 7b44f61889b..03f34bf5d01 100644 --- a/plugins/lang-python/pom.xml +++ b/plugins/lang-python/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT lang-python diff --git a/plugins/mapper-murmur3/pom.xml b/plugins/mapper-murmur3/pom.xml index 9c7440d9e72..83dea67c2ad 100644 --- a/plugins/mapper-murmur3/pom.xml +++ b/plugins/mapper-murmur3/pom.xml @@ -18,7 +18,7 @@ governing permissions and limitations under the License. --> org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT mapper-murmur3 diff --git a/plugins/mapper-size/pom.xml b/plugins/mapper-size/pom.xml index bd483e1868d..3e148cdfc28 100644 --- a/plugins/mapper-size/pom.xml +++ b/plugins/mapper-size/pom.xml @@ -18,7 +18,7 @@ governing permissions and limitations under the License. --> org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT mapper-size diff --git a/plugins/pom.xml b/plugins/pom.xml index 63ba87d0c8a..e0735c8b782 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT pom Plugin: Parent POM 2009 @@ -16,7 +16,7 @@ org.elasticsearch parent - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT diff --git a/plugins/site-example/pom.xml b/plugins/site-example/pom.xml index 3c25d5ae130..38b1b0d4ca5 100644 --- a/plugins/site-example/pom.xml +++ b/plugins/site-example/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.plugin plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT site-example diff --git a/pom.xml b/pom.xml index b86f2de5a93..3ba48a6742d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.elasticsearch parent - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT pom Elasticsearch: Parent POM Parent POM diff --git a/qa/pom.xml b/qa/pom.xml index a3ac686cee0..e6bda144ebb 100644 --- a/qa/pom.xml +++ b/qa/pom.xml @@ -7,7 +7,7 @@ org.elasticsearch.qa elasticsearch-qa - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT pom QA: Parent POM 2015 @@ -15,7 +15,7 @@ org.elasticsearch parent - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT diff --git a/qa/smoke-test-client/pom.xml b/qa/smoke-test-client/pom.xml index df48afa2287..82495c1c023 100644 --- a/qa/smoke-test-client/pom.xml +++ b/qa/smoke-test-client/pom.xml @@ -5,7 +5,7 @@ elasticsearch-qa org.elasticsearch.qa - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT 4.0.0 diff --git a/qa/smoke-test-multinode/pom.xml b/qa/smoke-test-multinode/pom.xml index 4c23f7bba56..a2aa7b0288c 100644 --- a/qa/smoke-test-multinode/pom.xml +++ b/qa/smoke-test-multinode/pom.xml @@ -8,7 +8,7 @@ org.elasticsearch.qa elasticsearch-qa - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT diff --git a/plugins/cloud-aws/rest-api-spec/test/cloud_aws/10_basic.yaml b/plugins/discovery-ec2/rest-api-spec/test/discovery_ec2/10_basic.yaml similarity index 58% rename from plugins/cloud-aws/rest-api-spec/test/cloud_aws/10_basic.yaml rename to plugins/discovery-ec2/rest-api-spec/test/discovery_ec2/10_basic.yaml index a2c8f882adc..e3b7844fd54 100644 --- a/plugins/cloud-aws/rest-api-spec/test/cloud_aws/10_basic.yaml +++ b/plugins/discovery-ec2/rest-api-spec/test/discovery_ec2/10_basic.yaml @@ -1,6 +1,6 @@ -# Integration tests for Cloud AWS components +# Integration tests for Discovery EC2 component # -"Cloud AWS loaded": +"Discovery EC2 loaded": - do: cluster.state: {} @@ -10,5 +10,5 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: cloud-aws } + - match: { nodes.$master.plugins.0.name: discovery-ec2 } - match: { nodes.$master.plugins.0.jvm: true } diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsEc2Service.java b/plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/AwsEc2Service.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsEc2Service.java rename to plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/AwsEc2Service.java diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsSigner.java b/plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/AwsSigner.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsSigner.java rename to plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/AwsSigner.java diff --git a/plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/Ec2Module.java b/plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/Ec2Module.java new file mode 100644 index 00000000000..9852441684c --- /dev/null +++ b/plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/Ec2Module.java @@ -0,0 +1,30 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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. + */ + +package org.elasticsearch.cloud.aws; + +import org.elasticsearch.common.inject.AbstractModule; + +public class Ec2Module extends AbstractModule { + + @Override + protected void configure() { + bind(AwsEc2Service.class).asEagerSingleton(); + } +} diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/network/Ec2NameResolver.java b/plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/network/Ec2NameResolver.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/network/Ec2NameResolver.java rename to plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/network/Ec2NameResolver.java diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/node/Ec2CustomNodeAttributes.java b/plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/node/Ec2CustomNodeAttributes.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/node/Ec2CustomNodeAttributes.java rename to plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/node/Ec2CustomNodeAttributes.java diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/discovery/ec2/AwsEc2UnicastHostsProvider.java b/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/AwsEc2UnicastHostsProvider.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/discovery/ec2/AwsEc2UnicastHostsProvider.java rename to plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/AwsEc2UnicastHostsProvider.java diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/discovery/ec2/Ec2Discovery.java b/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2Discovery.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/discovery/ec2/Ec2Discovery.java rename to plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2Discovery.java diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/plugin/cloud/aws/CloudAwsPlugin.java b/plugins/discovery-ec2/src/main/java/org/elasticsearch/plugin/discovery/ec2/Ec2DiscoveryPlugin.java similarity index 61% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/plugin/cloud/aws/CloudAwsPlugin.java rename to plugins/discovery-ec2/src/main/java/org/elasticsearch/plugin/discovery/ec2/Ec2DiscoveryPlugin.java index d5d7f6b01ed..180581b09ac 100644 --- a/plugins/cloud-aws/src/main/java/org/elasticsearch/plugin/cloud/aws/CloudAwsPlugin.java +++ b/plugins/discovery-ec2/src/main/java/org/elasticsearch/plugin/discovery/ec2/Ec2DiscoveryPlugin.java @@ -17,19 +17,15 @@ * under the License. */ -package org.elasticsearch.plugin.cloud.aws; +package org.elasticsearch.plugin.discovery.ec2; import org.elasticsearch.cloud.aws.AwsEc2Service; -import org.elasticsearch.cloud.aws.AwsModule; +import org.elasticsearch.cloud.aws.Ec2Module; import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.inject.Module; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.discovery.DiscoveryModule; import org.elasticsearch.discovery.ec2.Ec2Discovery; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; -import org.elasticsearch.repositories.RepositoriesModule; -import org.elasticsearch.repositories.s3.S3Repository; import java.util.ArrayList; import java.util.Collection; @@ -37,49 +33,32 @@ import java.util.Collection; /** * */ -public class CloudAwsPlugin extends Plugin { - - private final Settings settings; - - public CloudAwsPlugin(Settings settings) { - this.settings = settings; - } +public class Ec2DiscoveryPlugin extends Plugin { @Override public String name() { - return "cloud-aws"; + return "discovery-ec2"; } @Override public String description() { - return "Cloud AWS Plugin"; + return "EC2 Discovery Plugin"; } @Override public Collection nodeModules() { Collection modules = new ArrayList<>(); - if (settings.getAsBoolean("cloud.enabled", true)) { - modules.add(new AwsModule()); - } + modules.add(new Ec2Module()); return modules; } @Override public Collection> nodeServices() { Collection> services = new ArrayList<>(); - if (settings.getAsBoolean("cloud.enabled", true)) { - services.add(AwsModule.getS3ServiceImpl()); - services.add(AwsEc2Service.class); - } + services.add(AwsEc2Service.class); return services; } - public void onModule(RepositoriesModule repositoriesModule) { - if (settings.getAsBoolean("cloud.enabled", true)) { - repositoriesModule.registerRepository(S3Repository.TYPE, S3Repository.class, BlobStoreIndexShardRepository.class); - } - } - public void onModule(DiscoveryModule discoveryModule) { discoveryModule.addDiscoveryType("ec2", Ec2Discovery.class); } diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java similarity index 97% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java index 1c460c1baa6..f0a10c06042 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java @@ -25,7 +25,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -public class AWSSignersTests extends ESTestCase { +public class AWSSignersTest extends ESTestCase { @Test public void testSigners() { diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java similarity index 90% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java index ba3f84e266e..cb2d123a2ce 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java @@ -23,14 +23,12 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsException; -import org.elasticsearch.plugin.cloud.aws.CloudAwsPlugin; -import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.plugin.discovery.ec2.Ec2DiscoveryPlugin; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ThirdParty; import org.junit.After; import org.junit.Before; -import java.util.Collection; import java.util.HashMap; import java.util.Map; @@ -41,7 +39,7 @@ import java.util.Map; * in order to run these tests. */ @ThirdParty -public abstract class AbstractAwsTestCase extends ESIntegTestCase { +public abstract class AbstractAwsTest extends ESIntegTestCase { /** * Those properties are set by the AWS SDK v1.9.4 and if not ignored, @@ -77,6 +75,7 @@ public abstract class AbstractAwsTestCase extends ESIntegTestCase { Settings.Builder settings = Settings.builder() .put(super.nodeSettings(nodeOrdinal)) .put("path.home", createTempDir()) + .extendArray("plugin.types", Ec2DiscoveryPlugin.class.getName()) .put("cloud.aws.test.random", randomInt()) .put("cloud.aws.test.write_failures", 0.1) .put("cloud.aws.test.read_failures", 0.1); @@ -93,9 +92,4 @@ public abstract class AbstractAwsTestCase extends ESIntegTestCase { } return settings.build(); } - - @Override - protected Collection> nodePlugins() { - return pluginList(CloudAwsPlugin.class, TestAwsS3Service.TestPlugin.class); - } } diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/CloudAWSRestIT.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/DiscoveryEc2RestIT.java similarity index 91% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/CloudAWSRestIT.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/DiscoveryEc2RestIT.java index ce47b60bb23..24ccf82a3d8 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/CloudAWSRestIT.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/DiscoveryEc2RestIT.java @@ -27,9 +27,9 @@ import org.elasticsearch.test.rest.parser.RestTestParseException; import java.io.IOException; -public class CloudAWSRestIT extends ESRestTestCase { +public class DiscoveryEc2RestIT extends ESRestTestCase { - public CloudAWSRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public DiscoveryEc2RestIT(@Name("yaml") RestTestCandidate testCandidate) { super(testCandidate); } diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryTests.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java similarity index 75% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryTests.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java index 8d9c45489ed..15decc09ab4 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryTests.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java @@ -20,35 +20,27 @@ package org.elasticsearch.discovery.ec2; -import org.elasticsearch.cloud.aws.AbstractAwsTestCase; +import org.elasticsearch.cloud.aws.AbstractAwsTest; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.plugin.cloud.aws.CloudAwsPlugin; -import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.plugin.discovery.ec2.Ec2DiscoveryPlugin; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; import org.junit.Test; -import java.util.Collection; - import static org.elasticsearch.common.settings.Settings.settingsBuilder; /** - * Just an empty Node Start test to check eveything if fine when + * Just an empty Node Start test to check everything if fine when * starting. * This test requires AWS to run. */ @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class Ec2DiscoveryTests extends AbstractAwsTestCase { - - @Override - protected Collection> nodePlugins() { - return pluginList(CloudAwsPlugin.class); - } +public class Ec2DiscoveryITest extends AbstractAwsTest { @Test public void testStart() { Settings nodeSettings = settingsBuilder() - .put("cloud.enabled", true) + .put("plugin.types", Ec2DiscoveryPlugin.class.getName()) .put("discovery.type", "ec2") .build(); internalCluster().startNode(nodeSettings); diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java similarity index 85% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java index 0fa2d0e4779..19a0a0ffcaa 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java @@ -21,16 +21,13 @@ package org.elasticsearch.discovery.ec2; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; -import org.elasticsearch.cloud.aws.AbstractAwsTestCase; +import org.elasticsearch.cloud.aws.AbstractAwsTest; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.plugin.cloud.aws.CloudAwsPlugin; -import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.plugin.discovery.ec2.Ec2DiscoveryPlugin; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; import org.junit.Test; -import java.util.Collection; - import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.CoreMatchers.is; @@ -40,16 +37,12 @@ import static org.hamcrest.CoreMatchers.is; * This test requires AWS to run. */ @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class Ec2DiscoveryUpdateSettingsTests extends AbstractAwsTestCase { - - @Override - protected Collection> nodePlugins() { - return pluginList(CloudAwsPlugin.class); - } +public class Ec2DiscoveryUpdateSettingsITest extends AbstractAwsTest { @Test public void testMinimumMasterNodesStart() { Settings nodeSettings = settingsBuilder() + .put("plugin.types", Ec2DiscoveryPlugin.class.getName()) .put("cloud.enabled", true) .put("discovery.type", "ec2") .build(); diff --git a/plugins/pom.xml b/plugins/pom.xml index e0735c8b782..cd131328d38 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -425,20 +425,23 @@ + analysis-icu analysis-kuromoji + analysis-phonetic analysis-smartcn analysis-stempel - analysis-phonetic - analysis-icu - cloud-gce cloud-azure - cloud-aws + cloud-gce delete-by-query + discovery-ec2 discovery-multicast - lang-python lang-javascript + lang-python mapper-murmur3 mapper-size + repository-s3 + + jvm-example site-example diff --git a/plugins/repository-s3/LICENSE.txt b/plugins/repository-s3/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/plugins/repository-s3/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/plugins/repository-s3/NOTICE.txt b/plugins/repository-s3/NOTICE.txt new file mode 100644 index 00000000000..48809049486 --- /dev/null +++ b/plugins/repository-s3/NOTICE.txt @@ -0,0 +1,8 @@ +Elasticsearch +Copyright 2009-2015 Elasticsearch + +This product includes software developed by The Apache Software +Foundation (http://www.apache.org/). + +The LICENSE and NOTICE files for all dependencies may be found in the licenses/ +directory. diff --git a/plugins/repository-s3/licenses/aws-java-sdk-LICENSE.txt b/plugins/repository-s3/licenses/aws-java-sdk-LICENSE.txt new file mode 100644 index 00000000000..98d1f9319f3 --- /dev/null +++ b/plugins/repository-s3/licenses/aws-java-sdk-LICENSE.txt @@ -0,0 +1,63 @@ +Apache License +Version 2.0, January 2004 + +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: + + 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and + 2. You must cause any modified files to carry prominent notices stating that You changed the files; and + 3. 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 + 4. 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 + +Note: Other license terms may apply to certain, identified software files contained within or distributed with the accompanying software if such terms are included in the directory containing the accompanying software. Such other license terms will then apply in lieu of the terms of the software license above. + +JSON processing code subject to the JSON License from JSON.org: + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +The Software shall be used for Good, not Evil. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/plugins/repository-s3/licenses/aws-java-sdk-NOTICE.txt b/plugins/repository-s3/licenses/aws-java-sdk-NOTICE.txt new file mode 100644 index 00000000000..565bd6085c7 --- /dev/null +++ b/plugins/repository-s3/licenses/aws-java-sdk-NOTICE.txt @@ -0,0 +1,15 @@ +AWS SDK for Java +Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +This product includes software developed by +Amazon Technologies, Inc (http://www.amazon.com/). + +********************** +THIRD PARTY COMPONENTS +********************** +This software includes third party software subject to the following copyrights: +- XML parsing and utility functions from JetS3t - Copyright 2006-2009 James Murty. +- JSON parsing and utility functions from JSON.org - Copyright 2002 JSON.org. +- PKCS#1 PEM encoded private key parsing and utility functions from oauth.googlecode.com - Copyright 1998-2010 AOL Inc. + +The licenses for these third party components are included in LICENSE.txt diff --git a/plugins/repository-s3/licenses/aws-java-sdk-core-1.10.12.jar.sha1 b/plugins/repository-s3/licenses/aws-java-sdk-core-1.10.12.jar.sha1 new file mode 100644 index 00000000000..659b6cc62f5 --- /dev/null +++ b/plugins/repository-s3/licenses/aws-java-sdk-core-1.10.12.jar.sha1 @@ -0,0 +1 @@ +7ff51040bbcc9085dcb9a24a2c2a3cc7ac995988 diff --git a/plugins/cloud-aws/licenses/aws-java-sdk-kms-1.10.12.jar.sha1 b/plugins/repository-s3/licenses/aws-java-sdk-kms-1.10.12.jar.sha1 similarity index 100% rename from plugins/cloud-aws/licenses/aws-java-sdk-kms-1.10.12.jar.sha1 rename to plugins/repository-s3/licenses/aws-java-sdk-kms-1.10.12.jar.sha1 diff --git a/plugins/cloud-aws/licenses/aws-java-sdk-s3-1.10.12.jar.sha1 b/plugins/repository-s3/licenses/aws-java-sdk-s3-1.10.12.jar.sha1 similarity index 100% rename from plugins/cloud-aws/licenses/aws-java-sdk-s3-1.10.12.jar.sha1 rename to plugins/repository-s3/licenses/aws-java-sdk-s3-1.10.12.jar.sha1 diff --git a/plugins/repository-s3/licenses/commons-codec-1.6.jar.sha1 b/plugins/repository-s3/licenses/commons-codec-1.6.jar.sha1 new file mode 100644 index 00000000000..bf78aff7364 --- /dev/null +++ b/plugins/repository-s3/licenses/commons-codec-1.6.jar.sha1 @@ -0,0 +1 @@ +b7f0fc8f61ecadeb3695f0b9464755eee44374d4 diff --git a/plugins/repository-s3/licenses/commons-codec-LICENSE.txt b/plugins/repository-s3/licenses/commons-codec-LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/plugins/repository-s3/licenses/commons-codec-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/plugins/repository-s3/licenses/commons-codec-NOTICE.txt b/plugins/repository-s3/licenses/commons-codec-NOTICE.txt new file mode 100644 index 00000000000..56916449bbe --- /dev/null +++ b/plugins/repository-s3/licenses/commons-codec-NOTICE.txt @@ -0,0 +1,17 @@ +Apache Commons Codec +Copyright 2002-2015 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java +contains test data from http://aspell.net/test/orig/batch0.tab. +Copyright (C) 2002 Kevin Atkinson (kevina@gnu.org) + +=============================================================================== + +The content of package org.apache.commons.codec.language.bm has been translated +from the original php source code available at http://stevemorse.org/phoneticinfo.htm +with permission from the original authors. +Original source copyright: +Copyright (c) 2008 Alexander Beider & Stephen P. Morse. diff --git a/plugins/repository-s3/licenses/commons-logging-1.1.3.jar.sha1 b/plugins/repository-s3/licenses/commons-logging-1.1.3.jar.sha1 new file mode 100644 index 00000000000..c8756c43832 --- /dev/null +++ b/plugins/repository-s3/licenses/commons-logging-1.1.3.jar.sha1 @@ -0,0 +1 @@ +f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f diff --git a/plugins/repository-s3/licenses/commons-logging-LICENSE.txt b/plugins/repository-s3/licenses/commons-logging-LICENSE.txt new file mode 100644 index 00000000000..57bc88a15a0 --- /dev/null +++ b/plugins/repository-s3/licenses/commons-logging-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/plugins/repository-s3/licenses/commons-logging-NOTICE.txt b/plugins/repository-s3/licenses/commons-logging-NOTICE.txt new file mode 100644 index 00000000000..72eb32a9024 --- /dev/null +++ b/plugins/repository-s3/licenses/commons-logging-NOTICE.txt @@ -0,0 +1,5 @@ +Apache Commons CLI +Copyright 2001-2009 The Apache Software Foundation + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/). diff --git a/plugins/repository-s3/licenses/httpclient-4.3.6.jar.sha1 b/plugins/repository-s3/licenses/httpclient-4.3.6.jar.sha1 new file mode 100644 index 00000000000..3d35ee99d07 --- /dev/null +++ b/plugins/repository-s3/licenses/httpclient-4.3.6.jar.sha1 @@ -0,0 +1 @@ +4c47155e3e6c9a41a28db36680b828ced53b8af4 diff --git a/plugins/repository-s3/licenses/httpclient-LICENSE.txt b/plugins/repository-s3/licenses/httpclient-LICENSE.txt new file mode 100644 index 00000000000..32f01eda18f --- /dev/null +++ b/plugins/repository-s3/licenses/httpclient-LICENSE.txt @@ -0,0 +1,558 @@ + 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 + +========================================================================= + +This project includes Public Suffix List copied from + +licensed under the terms of the Mozilla Public License, v. 2.0 + +Full license text: + +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/plugins/repository-s3/licenses/httpclient-NOTICE.txt b/plugins/repository-s3/licenses/httpclient-NOTICE.txt new file mode 100644 index 00000000000..4f6058178b2 --- /dev/null +++ b/plugins/repository-s3/licenses/httpclient-NOTICE.txt @@ -0,0 +1,5 @@ +Apache HttpComponents Client +Copyright 1999-2015 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/plugins/repository-s3/licenses/httpcore-4.3.3.jar.sha1 b/plugins/repository-s3/licenses/httpcore-4.3.3.jar.sha1 new file mode 100644 index 00000000000..5d9c0e26c09 --- /dev/null +++ b/plugins/repository-s3/licenses/httpcore-4.3.3.jar.sha1 @@ -0,0 +1 @@ +f91b7a4aadc5cf486df6e4634748d7dd7a73f06d diff --git a/plugins/repository-s3/licenses/httpcore-LICENSE.txt b/plugins/repository-s3/licenses/httpcore-LICENSE.txt new file mode 100644 index 00000000000..72819a9f06f --- /dev/null +++ b/plugins/repository-s3/licenses/httpcore-LICENSE.txt @@ -0,0 +1,241 @@ + + 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 + +========================================================================= + +This project contains annotations in the package org.apache.http.annotation +which are derived from JCIP-ANNOTATIONS +Copyright (c) 2005 Brian Goetz and Tim Peierls. +See http://www.jcip.net and the Creative Commons Attribution License +(http://creativecommons.org/licenses/by/2.5) +Full text: http://creativecommons.org/licenses/by/2.5/legalcode + +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. + +1. Definitions + + "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License. + "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License. + "Licensor" means the individual or entity that offers the Work under the terms of this License. + "Original Author" means the individual or entity who created the Work. + "Work" means the copyrightable work of authorship offered under the terms of this License. + "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. + +2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: + + to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works; + to create and reproduce Derivative Works; + to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works; + to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works. + + For the avoidance of doubt, where the work is a musical composition: + Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work. + Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions). + Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions). + +The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved. + +4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: + + You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(b), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(b), as requested. + If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + + This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. + Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. + +8. Miscellaneous + + Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. + Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. + If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. + This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. diff --git a/plugins/repository-s3/licenses/httpcore-NOTICE.txt b/plugins/repository-s3/licenses/httpcore-NOTICE.txt new file mode 100644 index 00000000000..c0be50a505e --- /dev/null +++ b/plugins/repository-s3/licenses/httpcore-NOTICE.txt @@ -0,0 +1,8 @@ +Apache HttpComponents Core +Copyright 2005-2014 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +This project contains annotations derived from JCIP-ANNOTATIONS +Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net diff --git a/plugins/repository-s3/licenses/jackson-LICENSE b/plugins/repository-s3/licenses/jackson-LICENSE new file mode 100644 index 00000000000..f5f45d26a49 --- /dev/null +++ b/plugins/repository-s3/licenses/jackson-LICENSE @@ -0,0 +1,8 @@ +This copy of Jackson JSON processor streaming parser/generator is licensed under the +Apache (Software) License, version 2.0 ("the License"). +See the License for details about distribution rights, and the +specific rights regarding derivate works. + +You may obtain a copy of the License at: + +http://www.apache.org/licenses/LICENSE-2.0 diff --git a/plugins/repository-s3/licenses/jackson-NOTICE b/plugins/repository-s3/licenses/jackson-NOTICE new file mode 100644 index 00000000000..4c976b7b4cc --- /dev/null +++ b/plugins/repository-s3/licenses/jackson-NOTICE @@ -0,0 +1,20 @@ +# Jackson JSON processor + +Jackson is a high-performance, Free/Open Source JSON processing library. +It was originally written by Tatu Saloranta (tatu.saloranta@iki.fi), and has +been in development since 2007. +It is currently developed by a community of developers, as well as supported +commercially by FasterXML.com. + +## Licensing + +Jackson core and extension components may licensed under different licenses. +To find the details that apply to this artifact see the accompanying LICENSE file. +For more information, including possible other licensing options, contact +FasterXML.com (http://fasterxml.com). + +## Credits + +A list of contributors may be found from CREDITS file, which is included +in some artifacts (usually source distributions); but is always available +from the source code management (SCM) system project uses. diff --git a/plugins/repository-s3/licenses/jackson-annotations-2.5.0.jar.sha1 b/plugins/repository-s3/licenses/jackson-annotations-2.5.0.jar.sha1 new file mode 100644 index 00000000000..862ac6f304f --- /dev/null +++ b/plugins/repository-s3/licenses/jackson-annotations-2.5.0.jar.sha1 @@ -0,0 +1 @@ +a2a55a3375bc1cef830ca426d68d2ea22961190e diff --git a/plugins/repository-s3/licenses/jackson-databind-2.5.3.jar.sha1 b/plugins/repository-s3/licenses/jackson-databind-2.5.3.jar.sha1 new file mode 100644 index 00000000000..cdc66958059 --- /dev/null +++ b/plugins/repository-s3/licenses/jackson-databind-2.5.3.jar.sha1 @@ -0,0 +1 @@ +c37875ff66127d93e5f672708cb2dcc14c8232ab diff --git a/plugins/repository-s3/pom.xml b/plugins/repository-s3/pom.xml new file mode 100644 index 00000000000..8b71e9207aa --- /dev/null +++ b/plugins/repository-s3/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + + org.elasticsearch.plugin + plugins + 3.0.0-SNAPSHOT + + + repository-s3 + Plugin: Repository: S3 + The S3 repository plugin adds S3 repositories. + + + org.elasticsearch.plugin.repository.s3.S3RepositoryPlugin + 1.10.12 + 1 + repository_s3 + false + + + + + + com.amazonaws + aws-java-sdk-s3 + ${amazonaws.version} + + + + + org.apache.httpcomponents + httpclient + compile + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + + + diff --git a/plugins/repository-s3/rest-api-spec/test/repository_s3/10_basic.yaml b/plugins/repository-s3/rest-api-spec/test/repository_s3/10_basic.yaml new file mode 100644 index 00000000000..811ff888baa --- /dev/null +++ b/plugins/repository-s3/rest-api-spec/test/repository_s3/10_basic.yaml @@ -0,0 +1,14 @@ +# Integration tests for Repository S3 component +# +"Repository S3 loaded": + - do: + cluster.state: {} + + # Get master node id + - set: { master_node: master } + + - do: + nodes.info: {} + + - match: { nodes.$master.plugins.0.name: repository-s3 } + - match: { nodes.$master.plugins.0.jvm: true } diff --git a/plugins/cloud-aws/rest-api-spec/test/cloud_aws/20_repository.yaml b/plugins/repository-s3/rest-api-spec/test/repository_s3/20_repository.yaml similarity index 93% rename from plugins/cloud-aws/rest-api-spec/test/cloud_aws/20_repository.yaml rename to plugins/repository-s3/rest-api-spec/test/repository_s3/20_repository.yaml index df26e517312..69b50b66530 100644 --- a/plugins/cloud-aws/rest-api-spec/test/cloud_aws/20_repository.yaml +++ b/plugins/repository-s3/rest-api-spec/test/repository_s3/20_repository.yaml @@ -1,4 +1,4 @@ -# Integration tests for Cloud AWS components +# Integration tests for Repository S3 component # "S3 repository can be registereed": - do: diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsS3Service.java b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/AwsS3Service.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsS3Service.java rename to plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/AwsS3Service.java diff --git a/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/AwsSigner.java b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/AwsSigner.java new file mode 100644 index 00000000000..476bb7428e8 --- /dev/null +++ b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/AwsSigner.java @@ -0,0 +1,53 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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. + */ + +package org.elasticsearch.cloud.aws; + +import com.amazonaws.ClientConfiguration; +import com.amazonaws.auth.SignerFactory; + +public class AwsSigner { + + private AwsSigner() { + + } + + /** + * Add a AWS API Signer. + * @param signer Signer to use + * @param configuration AWS Client configuration + * @throws IllegalArgumentException if signer does not exist + */ + public static void configureSigner(String signer, ClientConfiguration configuration) + throws IllegalArgumentException { + + if (signer == null) { + throw new IllegalArgumentException("[null] signer set"); + } + + try { + // We check this signer actually exists in AWS SDK + // It throws a IllegalArgumentException if not found + SignerFactory.getSignerByTypeAndService(signer, null); + configuration.setSignerOverride(signer); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException("wrong signer set [" + signer + "]"); + } + } +} diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/InternalAwsS3Service.java b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/InternalAwsS3Service.java similarity index 96% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/InternalAwsS3Service.java rename to plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/InternalAwsS3Service.java index b7e029b5297..5405ce5cd61 100644 --- a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/InternalAwsS3Service.java +++ b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/InternalAwsS3Service.java @@ -26,12 +26,12 @@ import com.amazonaws.http.IdleConnectionReaper; import com.amazonaws.internal.StaticCredentialsProvider; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client; - import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.settings.SettingsFilter; import java.util.HashMap; import java.util.Locale; @@ -48,8 +48,12 @@ public class InternalAwsS3Service extends AbstractLifecycleComponent, AmazonS3Client> clients = new HashMap, AmazonS3Client>(); @Inject - public InternalAwsS3Service(Settings settings) { + public InternalAwsS3Service(Settings settings, SettingsFilter settingsFilter) { super(settings); + settingsFilter.addFilter("cloud.aws.access_key"); + settingsFilter.addFilter("cloud.aws.secret_key"); + settingsFilter.addFilter("access_key"); + settingsFilter.addFilter("secret_key"); } @Override diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsModule.java b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/S3Module.java similarity index 89% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsModule.java rename to plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/S3Module.java index e848d33ff99..11294054c21 100644 --- a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/AwsModule.java +++ b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/S3Module.java @@ -20,9 +20,8 @@ package org.elasticsearch.cloud.aws; import org.elasticsearch.common.inject.AbstractModule; -import org.elasticsearch.common.settings.Settings; -public class AwsModule extends AbstractModule { +public class S3Module extends AbstractModule { // pkg private so it is settable by tests @@ -35,6 +34,5 @@ public class AwsModule extends AbstractModule { @Override protected void configure() { bind(AwsS3Service.class).to(s3ServiceImpl).asEagerSingleton(); - bind(AwsEc2Service.class).asEagerSingleton(); } -} \ No newline at end of file +} diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/blobstore/DefaultS3OutputStream.java b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/blobstore/DefaultS3OutputStream.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/blobstore/DefaultS3OutputStream.java rename to plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/blobstore/DefaultS3OutputStream.java diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3BlobContainer.java b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3BlobContainer.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3BlobContainer.java rename to plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3BlobContainer.java diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3BlobStore.java b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3BlobStore.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3BlobStore.java rename to plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3BlobStore.java diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStream.java b/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStream.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStream.java rename to plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStream.java diff --git a/plugins/repository-s3/src/main/java/org/elasticsearch/plugin/repository/s3/S3RepositoryPlugin.java b/plugins/repository-s3/src/main/java/org/elasticsearch/plugin/repository/s3/S3RepositoryPlugin.java new file mode 100644 index 00000000000..2911e278c38 --- /dev/null +++ b/plugins/repository-s3/src/main/java/org/elasticsearch/plugin/repository/s3/S3RepositoryPlugin.java @@ -0,0 +1,64 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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. + */ + +package org.elasticsearch.plugin.repository.s3; + +import org.elasticsearch.cloud.aws.S3Module; +import org.elasticsearch.common.component.LifecycleComponent; +import org.elasticsearch.common.inject.Module; +import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; +import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.repositories.RepositoriesModule; +import org.elasticsearch.repositories.s3.S3Repository; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; + +/** + * + */ +public class S3RepositoryPlugin extends Plugin { + + @Override + public String name() { + return "repository-s3"; + } + + @Override + public String description() { + return "S3 Repository Plugin"; + } + + @Override + public Collection nodeModules() { + Collection modules = new ArrayList<>(); + modules.add(new S3Module()); + return modules; + } + + @Override + public Collection> nodeServices() { + return Collections.>singleton(S3Module.getS3ServiceImpl()); + } + + public void onModule(RepositoriesModule repositoriesModule) { + repositoriesModule.registerRepository(S3Repository.TYPE, S3Repository.class, BlobStoreIndexShardRepository.class); + } +} diff --git a/plugins/cloud-aws/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java b/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java similarity index 100% rename from plugins/cloud-aws/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java rename to plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java new file mode 100644 index 00000000000..f0a10c06042 --- /dev/null +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java @@ -0,0 +1,53 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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. + */ + +package org.elasticsearch.cloud.aws; + +import com.amazonaws.ClientConfiguration; +import org.elasticsearch.test.ESTestCase; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.is; + +public class AWSSignersTest extends ESTestCase { + + @Test + public void testSigners() { + assertThat(signerTester(null), is(false)); + assertThat(signerTester("QueryStringSignerType"), is(true)); + assertThat(signerTester("AWS3SignerType"), is(true)); + assertThat(signerTester("AWS4SignerType"), is(true)); + assertThat(signerTester("NoOpSignerType"), is(true)); + assertThat(signerTester("UndefinedSigner"), is(false)); + } + + /** + * Test a signer configuration + * @param signer signer name + * @return true if successful, false otherwise + */ + private boolean signerTester(String signer) { + try { + AwsSigner.configureSigner(signer, new ClientConfiguration()); + return true; + } catch (IllegalArgumentException e) { + return false; + } + } +} diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java new file mode 100644 index 00000000000..2988c5f8d96 --- /dev/null +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java @@ -0,0 +1,95 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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. + */ + +package org.elasticsearch.cloud.aws; + +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.io.PathUtils; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.settings.SettingsException; +import org.elasticsearch.plugin.repository.s3.S3RepositoryPlugin; +import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.ESIntegTestCase.ThirdParty; +import org.junit.After; +import org.junit.Before; + +import java.util.HashMap; +import java.util.Map; + +/** + * Base class for AWS tests that require credentials. + *

+ * You must specify {@code -Dtests.thirdparty=true -Dtests.config=/path/to/config} + * in order to run these tests. + */ +@ThirdParty +public abstract class AbstractAwsTest extends ESIntegTestCase { + + /** + * Those properties are set by the AWS SDK v1.9.4 and if not ignored, + * lead to tests failure (see AbstractRandomizedTest#IGNORED_INVARIANT_PROPERTIES) + */ + private static final String[] AWS_INVARIANT_PROPERTIES = { + "com.sun.org.apache.xml.internal.dtm.DTMManager", + "javax.xml.parsers.DocumentBuilderFactory" + }; + + private Map properties = new HashMap<>(); + + @Before + public void saveProperties() { + for (String p : AWS_INVARIANT_PROPERTIES) { + properties.put(p, System.getProperty(p)); + } + } + + @After + public void restoreProperties() { + for (String p : AWS_INVARIANT_PROPERTIES) { + if (properties.get(p) != null) { + System.setProperty(p, properties.get(p)); + } else { + System.clearProperty(p); + } + } + } + + @Override + protected Settings nodeSettings(int nodeOrdinal) { + Settings.Builder settings = Settings.builder() + .put(super.nodeSettings(nodeOrdinal)) + .put("path.home", createTempDir()) + .extendArray("plugin.types", S3RepositoryPlugin.class.getName(), TestAwsS3Service.TestPlugin.class.getName()) + .put("cloud.aws.test.random", randomInt()) + .put("cloud.aws.test.write_failures", 0.1) + .put("cloud.aws.test.read_failures", 0.1); + + // if explicit, just load it and don't load from env + try { + if (Strings.hasText(System.getProperty("tests.config"))) { + settings.loadFromPath(PathUtils.get(System.getProperty("tests.config"))); + } else { + throw new IllegalStateException("to run integration tests, you need to set -Dtest.thirdparty=true and -Dtests.config=/path/to/elasticsearch.yml"); + } + } catch (SettingsException exception) { + throw new IllegalStateException("your test configuration file is incorrect: " + System.getProperty("tests.config"), exception); + } + return settings.build(); + } +} diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AmazonS3Wrapper.java b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AmazonS3Wrapper.java similarity index 100% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AmazonS3Wrapper.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AmazonS3Wrapper.java index 24c7196c681..846892b8704 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/AmazonS3Wrapper.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AmazonS3Wrapper.java @@ -28,13 +28,13 @@ import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.S3ClientOptions; import com.amazonaws.services.s3.S3ResponseMetadata; import com.amazonaws.services.s3.model.*; +import org.elasticsearch.common.SuppressForbidden; import java.io.File; import java.io.InputStream; import java.net.URL; import java.util.Date; import java.util.List; -import org.elasticsearch.common.SuppressForbidden; /** * diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/TestAmazonS3.java b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/TestAmazonS3.java similarity index 100% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/TestAmazonS3.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/TestAmazonS3.java diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/TestAwsS3Service.java b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/TestAwsS3Service.java similarity index 89% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/TestAwsS3Service.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/TestAwsS3Service.java index 92e4d72ac27..81a0312e37f 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/TestAwsS3Service.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/TestAwsS3Service.java @@ -22,6 +22,7 @@ import com.amazonaws.services.s3.AmazonS3; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.plugins.Plugin; import java.util.IdentityHashMap; @@ -36,16 +37,16 @@ public class TestAwsS3Service extends InternalAwsS3Service { public String description() { return "plugs in mock s3 service"; } - public void onModule(AwsModule awsModule) { - awsModule.s3ServiceImpl = TestAwsS3Service.class; + public void onModule(S3Module s3Module) { + s3Module.s3ServiceImpl = TestAwsS3Service.class; } } IdentityHashMap clients = new IdentityHashMap(); @Inject - public TestAwsS3Service(Settings settings) { - super(settings); + public TestAwsS3Service(Settings settings, SettingsFilter settingsFilter) { + super(settings, settingsFilter); } diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/MockDefaultS3OutputStream.java b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/MockDefaultS3OutputStream.java similarity index 100% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/MockDefaultS3OutputStream.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/MockDefaultS3OutputStream.java diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTests.java b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTest.java similarity index 98% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTests.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTest.java index f40065c4e2b..b2dc66b8081 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTests.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTest.java @@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.equalTo; /** * Unit test for {@link S3OutputStream}. */ -public class S3OutputStreamTests extends ESTestCase { +public class S3OutputStreamTest extends ESTestCase { private static final int BUFFER_SIZE = S3BlobStore.MIN_BUFFER_SIZE.bytesAsInt(); diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTestCase.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java similarity index 98% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTestCase.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java index 61a42fbaaa5..cd381f4996a 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTestCase.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java @@ -29,12 +29,11 @@ import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRes import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.client.Client; import org.elasticsearch.client.ClusterAdminClient; -import org.elasticsearch.cloud.aws.AbstractAwsTestCase; +import org.elasticsearch.cloud.aws.AbstractAwsTest; import org.elasticsearch.cloud.aws.AwsS3Service; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.plugin.cloud.aws.CloudAwsPlugin; -import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.plugin.repository.s3.S3RepositoryPlugin; import org.elasticsearch.repositories.RepositoryMissingException; import org.elasticsearch.repositories.RepositoryVerificationException; import org.elasticsearch.snapshots.SnapshotMissingException; @@ -47,7 +46,6 @@ import org.junit.Before; import org.junit.Test; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import static org.hamcrest.Matchers.*; @@ -55,7 +53,7 @@ import static org.hamcrest.Matchers.*; /** */ @ClusterScope(scope = Scope.SUITE, numDataNodes = 2, numClientNodes = 0, transportClientRatio = 0.0) -abstract public class AbstractS3SnapshotRestoreTestCase extends AbstractAwsTestCase { +abstract public class AbstractS3SnapshotRestoreTest extends AbstractAwsTest { @Override public Settings indexSettings() { @@ -65,15 +63,11 @@ abstract public class AbstractS3SnapshotRestoreTestCase extends AbstractAwsTestC .put(MockFSDirectoryService.RANDOM_PREVENT_DOUBLE_WRITE, false) .put(MockFSDirectoryService.RANDOM_NO_DELETE_OPEN_FILE, false) .put("cloud.enabled", true) + .put("plugin.types", S3RepositoryPlugin.class.getName()) .put("repositories.s3.base_path", basePath) .build(); } - @Override - protected Collection> nodePlugins() { - return pluginList(CloudAwsPlugin.class); - } - private String basePath; @Before diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3RestIT.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3RestIT.java new file mode 100644 index 00000000000..d8e436b50bb --- /dev/null +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3RestIT.java @@ -0,0 +1,41 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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. + */ + +package org.elasticsearch.repositories.s3; + +import com.carrotsearch.randomizedtesting.annotations.Name; +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.test.rest.RestTestCandidate; +import org.elasticsearch.test.rest.parser.RestTestParseException; + +import java.io.IOException; + +public class RepositoryS3RestIT extends ESRestTestCase { + + public RepositoryS3RestIT(@Name("yaml") RestTestCandidate testCandidate) { + super(testCandidate); + } + + @ParametersFactory + public static Iterable parameters() throws IOException, RestTestParseException { + return ESRestTestCase.createParameters(0, 1); + } +} + diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTests.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java similarity index 94% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTests.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java index 0710e12dc4d..dbcb7d8b7e3 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTests.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java @@ -27,7 +27,7 @@ import org.junit.Before; * cloud.aws.s3.proxy_host: mys3proxy.company.com * cloud.aws.s3.proxy_port: 8080 */ -public class S3ProxiedSnapshotRestoreOverHttpsTests extends AbstractS3SnapshotRestoreTestCase { +public class S3ProxiedSnapshotRestoreOverHttpsTest extends AbstractS3SnapshotRestoreTest { private boolean proxySet = false; diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTests.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java similarity index 92% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTests.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java index cbfa4bdd9f2..045d18a6709 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTests.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.settings.Settings; /** */ -public class S3SnapshotRestoreOverHttpTests extends AbstractS3SnapshotRestoreTestCase { +public class S3SnapshotRestoreOverHttpTest extends AbstractS3SnapshotRestoreTest { @Override public Settings nodeSettings(int nodeOrdinal) { Settings.Builder settings = Settings.builder() diff --git a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTests.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java similarity index 92% rename from plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTests.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java index 2e0f47d8de5..ca098cbaec3 100644 --- a/plugins/cloud-aws/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTests.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.settings.Settings; /** */ -public class S3SnapshotRestoreOverHttpsTests extends AbstractS3SnapshotRestoreTestCase { +public class S3SnapshotRestoreOverHttpsTest extends AbstractS3SnapshotRestoreTest { @Override public Settings nodeSettings(int nodeOrdinal) { Settings.Builder settings = Settings.builder() diff --git a/qa/smoke-test-plugins/pom.xml b/qa/smoke-test-plugins/pom.xml index 518317ec48f..128dab187e9 100644 --- a/qa/smoke-test-plugins/pom.xml +++ b/qa/smoke-test-plugins/pom.xml @@ -240,6 +240,14 @@ + + org.elasticsearch.plugin + analysis-icu + ${elasticsearch.version} + zip + true + + org.elasticsearch.plugin analysis-kuromoji @@ -248,6 +256,14 @@ true + + org.elasticsearch.plugin + analysis-phonetic + ${elasticsearch.version} + zip + true + + org.elasticsearch.plugin analysis-smartcn @@ -266,15 +282,7 @@ org.elasticsearch.plugin - analysis-phonetic - ${elasticsearch.version} - zip - true - - - - org.elasticsearch.plugin - analysis-icu + cloud-azure ${elasticsearch.version} zip true @@ -288,22 +296,6 @@ true - - org.elasticsearch.plugin - cloud-azure - ${elasticsearch.version} - zip - true - - - - org.elasticsearch.plugin - cloud-aws - ${elasticsearch.version} - zip - true - - org.elasticsearch.plugin delete-by-query @@ -312,6 +304,14 @@ true + + org.elasticsearch.plugin + discovery-ec2 + ${elasticsearch.version} + zip + true + + org.elasticsearch.plugin discovery-multicast @@ -322,7 +322,7 @@ org.elasticsearch.plugin - lang-python + lang-javascript ${elasticsearch.version} zip true @@ -330,7 +330,7 @@ org.elasticsearch.plugin - lang-javascript + lang-python ${elasticsearch.version} zip true @@ -354,7 +354,16 @@ org.elasticsearch.plugin - site-example + repository-s3 + ${elasticsearch.version} + zip + true + + + + + org.elasticsearch.plugin + jvm-example ${elasticsearch.version} zip true @@ -362,7 +371,7 @@ org.elasticsearch.plugin - jvm-example + site-example ${elasticsearch.version} zip true From a117fc85a698d63ac95eaf78cfa2e959eba58d0f Mon Sep 17 00:00:00 2001 From: David Pilato Date: Thu, 3 Sep 2015 11:29:45 +0200 Subject: [PATCH 37/40] Update help install for discovery-ec2 and repository-s3 --- .../resources/org/elasticsearch/plugins/plugin-install.help | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/resources/org/elasticsearch/plugins/plugin-install.help b/core/src/main/resources/org/elasticsearch/plugins/plugin-install.help index 6bce1dd6f5b..758d055b6eb 100644 --- a/core/src/main/resources/org/elasticsearch/plugins/plugin-install.help +++ b/core/src/main/resources/org/elasticsearch/plugins/plugin-install.help @@ -38,15 +38,16 @@ OFFICIAL PLUGINS - analysis-phonetic - analysis-smartcn - analysis-stempel - - cloud-aws - cloud-azure - cloud-gce - delete-by-query + - discovery-ec2 - discovery-multicast - lang-javascript - lang-python - mapper-murmur3 - mapper-size + - repository-s3 OPTIONS From 4bffdbfafcb95fc263cd6766a07247d9a546a8be Mon Sep 17 00:00:00 2001 From: David Pilato Date: Thu, 3 Sep 2015 12:11:58 +0200 Subject: [PATCH 38/40] =?UTF-8?q?[doc]=C2=A0fix=20cross=20link=20between?= =?UTF-8?q?=20core=20and=20plugins=20doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For ec2 and s3 --- docs/reference/modules/discovery/ec2.asciidoc | 2 +- docs/reference/modules/network.asciidoc | 2 +- docs/reference/modules/snapshots.asciidoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/modules/discovery/ec2.asciidoc b/docs/reference/modules/discovery/ec2.asciidoc index 77d217f2a44..ba15f6bffa4 100644 --- a/docs/reference/modules/discovery/ec2.asciidoc +++ b/docs/reference/modules/discovery/ec2.asciidoc @@ -1,4 +1,4 @@ [[modules-discovery-ec2]] === EC2 Discovery -EC2 discovery is available as a plugin. See {plugins}/discovery.html#discovery-ec2[discovery-ec2] for more information. +EC2 discovery is available as a plugin. See {plugins}/discovery-ec2.html[discovery-ec2] for more information. diff --git a/docs/reference/modules/network.asciidoc b/docs/reference/modules/network.asciidoc index e855d826a32..dc6aca718cd 100644 --- a/docs/reference/modules/network.asciidoc +++ b/docs/reference/modules/network.asciidoc @@ -51,7 +51,7 @@ provided network interface. For example `_en0:ipv4_`. provided network interface. For example `_en0:ipv6_`. |======================================================================= -When the `cloud-aws` plugin is installed, the following are also allowed +When the `discovery-ec2` plugin is installed, the following are also allowed as valid network host settings: [cols="<,<",options="header",] diff --git a/docs/reference/modules/snapshots.asciidoc b/docs/reference/modules/snapshots.asciidoc index b7ff41e7a45..449ca4b3ca9 100644 --- a/docs/reference/modules/snapshots.asciidoc +++ b/docs/reference/modules/snapshots.asciidoc @@ -150,7 +150,7 @@ shared file system repository. Other repository backends are available in these official plugins: -* {plugins}/repository.html#repository-s3[repository-s3] for S3 repository support +* {plugins}/repository-s3.html[repository-s3] for S3 repository support * https://github.com/elasticsearch/elasticsearch-hadoop/tree/master/repository-hdfs[HDFS Plugin] for Hadoop environments * https://github.com/elasticsearch/elasticsearch-cloud-azure#azure-repository[Azure Cloud Plugin] for Azure storage repositories From 6953193f5b43cc87fb884b552b1afcb53e7babc3 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Thu, 3 Sep 2015 12:21:26 +0200 Subject: [PATCH 39/40] =?UTF-8?q?[test]=C2=A0fix=20test=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For aws s3 and ec2 --- .../cloud/aws/{AWSSignersTest.java => AWSSignersTests.java} | 2 +- .../aws/{AbstractAwsTest.java => AbstractAwsTestCase.java} | 2 +- .../ec2/{Ec2DiscoveryITest.java => Ec2DiscoveryTests.java} | 4 ++-- ...ettingsITest.java => Ec2DiscoveryUpdateSettingsTests.java} | 4 ++-- .../cloud/aws/{AWSSignersTest.java => AWSSignersTests.java} | 2 +- .../aws/{AbstractAwsTest.java => AbstractAwsTestCase.java} | 2 +- .../{S3OutputStreamTest.java => S3OutputStreamTests.java} | 2 +- .../repositories/s3/AbstractS3SnapshotRestoreTest.java | 4 ++-- ...sTest.java => S3ProxiedSnapshotRestoreOverHttpsTests.java} | 2 +- ...eOverHttpTest.java => S3SnapshotRestoreOverHttpTests.java} | 2 +- ...verHttpsTest.java => S3SnapshotRestoreOverHttpsTests.java} | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) rename plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/{AWSSignersTest.java => AWSSignersTests.java} (97%) rename plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/{AbstractAwsTest.java => AbstractAwsTestCase.java} (98%) rename plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/{Ec2DiscoveryITest.java => Ec2DiscoveryTests.java} (93%) rename plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/{Ec2DiscoveryUpdateSettingsITest.java => Ec2DiscoveryUpdateSettingsTests.java} (94%) rename plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/{AWSSignersTest.java => AWSSignersTests.java} (97%) rename plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/{AbstractAwsTest.java => AbstractAwsTestCase.java} (98%) rename plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/{S3OutputStreamTest.java => S3OutputStreamTests.java} (98%) rename plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/{S3ProxiedSnapshotRestoreOverHttpsTest.java => S3ProxiedSnapshotRestoreOverHttpsTests.java} (94%) rename plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/{S3SnapshotRestoreOverHttpTest.java => S3SnapshotRestoreOverHttpTests.java} (93%) rename plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/{S3SnapshotRestoreOverHttpsTest.java => S3SnapshotRestoreOverHttpsTests.java} (93%) diff --git a/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java similarity index 97% rename from plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java index f0a10c06042..1c460c1baa6 100644 --- a/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java @@ -25,7 +25,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -public class AWSSignersTest extends ESTestCase { +public class AWSSignersTests extends ESTestCase { @Test public void testSigners() { diff --git a/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java similarity index 98% rename from plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java index cb2d123a2ce..47647e17333 100644 --- a/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java @@ -39,7 +39,7 @@ import java.util.Map; * in order to run these tests. */ @ThirdParty -public abstract class AbstractAwsTest extends ESIntegTestCase { +public abstract class AbstractAwsTestCase extends ESIntegTestCase { /** * Those properties are set by the AWS SDK v1.9.4 and if not ignored, diff --git a/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryTests.java similarity index 93% rename from plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryTests.java index 15decc09ab4..a794db630a6 100644 --- a/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryITest.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryTests.java @@ -20,7 +20,7 @@ package org.elasticsearch.discovery.ec2; -import org.elasticsearch.cloud.aws.AbstractAwsTest; +import org.elasticsearch.cloud.aws.AbstractAwsTestCase; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugin.discovery.ec2.Ec2DiscoveryPlugin; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; @@ -35,7 +35,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; * This test requires AWS to run. */ @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class Ec2DiscoveryITest extends AbstractAwsTest { +public class Ec2DiscoveryTests extends AbstractAwsTestCase { @Test public void testStart() { diff --git a/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java similarity index 94% rename from plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java index 19a0a0ffcaa..de3efcf1342 100644 --- a/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsITest.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java @@ -21,7 +21,7 @@ package org.elasticsearch.discovery.ec2; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; -import org.elasticsearch.cloud.aws.AbstractAwsTest; +import org.elasticsearch.cloud.aws.AbstractAwsTestCase; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugin.discovery.ec2.Ec2DiscoveryPlugin; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; @@ -37,7 +37,7 @@ import static org.hamcrest.CoreMatchers.is; * This test requires AWS to run. */ @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class Ec2DiscoveryUpdateSettingsITest extends AbstractAwsTest { +public class Ec2DiscoveryUpdateSettingsTests extends AbstractAwsTestCase { @Test public void testMinimumMasterNodesStart() { diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java similarity index 97% rename from plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java index f0a10c06042..1c460c1baa6 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTest.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AWSSignersTests.java @@ -25,7 +25,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -public class AWSSignersTest extends ESTestCase { +public class AWSSignersTests extends ESTestCase { @Test public void testSigners() { diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java similarity index 98% rename from plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java index 2988c5f8d96..9a49c674cd8 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTest.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/AbstractAwsTestCase.java @@ -39,7 +39,7 @@ import java.util.Map; * in order to run these tests. */ @ThirdParty -public abstract class AbstractAwsTest extends ESIntegTestCase { +public abstract class AbstractAwsTestCase extends ESIntegTestCase { /** * Those properties are set by the AWS SDK v1.9.4 and if not ignored, diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTest.java b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTests.java similarity index 98% rename from plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTest.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTests.java index b2dc66b8081..f40065c4e2b 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTest.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/cloud/aws/blobstore/S3OutputStreamTests.java @@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.equalTo; /** * Unit test for {@link S3OutputStream}. */ -public class S3OutputStreamTest extends ESTestCase { +public class S3OutputStreamTests extends ESTestCase { private static final int BUFFER_SIZE = S3BlobStore.MIN_BUFFER_SIZE.bytesAsInt(); diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java index cd381f4996a..c47202dc467 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/AbstractS3SnapshotRestoreTest.java @@ -29,7 +29,7 @@ import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRes import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.client.Client; import org.elasticsearch.client.ClusterAdminClient; -import org.elasticsearch.cloud.aws.AbstractAwsTest; +import org.elasticsearch.cloud.aws.AbstractAwsTestCase; import org.elasticsearch.cloud.aws.AwsS3Service; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.settings.Settings; @@ -53,7 +53,7 @@ import static org.hamcrest.Matchers.*; /** */ @ClusterScope(scope = Scope.SUITE, numDataNodes = 2, numClientNodes = 0, transportClientRatio = 0.0) -abstract public class AbstractS3SnapshotRestoreTest extends AbstractAwsTest { +abstract public class AbstractS3SnapshotRestoreTest extends AbstractAwsTestCase { @Override public Settings indexSettings() { diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTests.java similarity index 94% rename from plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTests.java index dbcb7d8b7e3..667a75656b3 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTest.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3ProxiedSnapshotRestoreOverHttpsTests.java @@ -27,7 +27,7 @@ import org.junit.Before; * cloud.aws.s3.proxy_host: mys3proxy.company.com * cloud.aws.s3.proxy_port: 8080 */ -public class S3ProxiedSnapshotRestoreOverHttpsTest extends AbstractS3SnapshotRestoreTest { +public class S3ProxiedSnapshotRestoreOverHttpsTests extends AbstractS3SnapshotRestoreTest { private boolean proxySet = false; diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTests.java similarity index 93% rename from plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTests.java index 045d18a6709..bcc430e840c 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTest.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpTests.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.settings.Settings; /** */ -public class S3SnapshotRestoreOverHttpTest extends AbstractS3SnapshotRestoreTest { +public class S3SnapshotRestoreOverHttpTests extends AbstractS3SnapshotRestoreTest { @Override public Settings nodeSettings(int nodeOrdinal) { Settings.Builder settings = Settings.builder() diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTests.java similarity index 93% rename from plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTests.java index ca098cbaec3..8bb53edce54 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTest.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3SnapshotRestoreOverHttpsTests.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.settings.Settings; /** */ -public class S3SnapshotRestoreOverHttpsTest extends AbstractS3SnapshotRestoreTest { +public class S3SnapshotRestoreOverHttpsTests extends AbstractS3SnapshotRestoreTest { @Override public Settings nodeSettings(int nodeOrdinal) { Settings.Builder settings = Settings.builder() From 2b27bc11b67027ffdc469c2ebf1ab10d5e6f5df6 Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Thu, 3 Sep 2015 12:23:53 +0200 Subject: [PATCH 40/40] [doc] remove comment about function_score faster than script sort. It is not so. --- docs/reference/search/request/sort.asciidoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/reference/search/request/sort.asciidoc b/docs/reference/search/request/sort.asciidoc index 1cc07e21313..63fca20467b 100644 --- a/docs/reference/search/request/sort.asciidoc +++ b/docs/reference/search/request/sort.asciidoc @@ -337,8 +337,6 @@ Allow to sort based on custom scripts, here is an example: } -------------------------------------------------- -Note, it is recommended, for single custom based script based sorting, -to use `function_score` query instead as sorting based on score is faster. ==== Track Scores