Browse Source

Be more diligent about ThreadPools having names

Add a name parameter to what was the empty ThreadPool constructor. Assert if the the ThreadPool's setting doesn't contain a name.
Boaz Leskes 11 years ago
parent
commit
2c2783875e
18 changed files with 65 additions and 46 deletions
  1. 5 2
      src/main/java/org/elasticsearch/threadpool/ThreadPool.java
  2. 1 1
      src/test/java/org/elasticsearch/benchmark/transport/BenchmarkNettyLargeMessages.java
  3. 2 2
      src/test/java/org/elasticsearch/benchmark/transport/TransportBenchmark.java
  4. 1 1
      src/test/java/org/elasticsearch/common/util/BigArraysTests.java
  5. 2 2
      src/test/java/org/elasticsearch/discovery/zen/ping/multicast/MulticastZenPingTests.java
  6. 1 1
      src/test/java/org/elasticsearch/discovery/zen/ping/unicast/UnicastZenPingTests.java
  7. 17 15
      src/test/java/org/elasticsearch/index/aliases/IndexAliasesServiceTests.java
  8. 1 2
      src/test/java/org/elasticsearch/index/engine/internal/InternalEngineTests.java
  9. 1 0
      src/test/java/org/elasticsearch/index/query/IndexQueryParserFilterCachingTests.java
  10. 1 1
      src/test/java/org/elasticsearch/index/query/SimpleIndexQueryParserTests.java
  11. 4 1
      src/test/java/org/elasticsearch/index/query/TemplateQueryParserTest.java
  12. 3 3
      src/test/java/org/elasticsearch/index/query/guice/IndexQueryParserModuleTests.java
  13. 3 4
      src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPlugin2Tests.java
  14. 3 3
      src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPluginTests.java
  15. 1 1
      src/test/java/org/elasticsearch/index/search/child/ChildrenConstantScoreQueryTests.java
  16. 1 1
      src/test/java/org/elasticsearch/script/NativeScriptTests.java
  17. 17 5
      src/test/java/org/elasticsearch/threadpool/UpdateThreadPoolSettingsTests.java
  18. 1 1
      src/test/java/org/elasticsearch/transport/AbstractSimpleTransportTests.java

+ 5 - 2
src/main/java/org/elasticsearch/threadpool/ThreadPool.java

@@ -91,14 +91,17 @@ public class ThreadPool extends AbstractComponent {
 
     private final EstimatedTimeThread estimatedTimeThread;
 
-    public ThreadPool() {
-        this(ImmutableSettings.Builder.EMPTY_SETTINGS, null);
+
+    public ThreadPool(String name) {
+        this(ImmutableSettings.builder().put("name", name).build(), null);
     }
 
     @Inject
     public ThreadPool(Settings settings, @Nullable NodeSettingsService nodeSettingsService) {
         super(settings);
 
+        assert settings.get("name") != null : "ThreadPool's settings should contain a name";
+
         Map<String, Settings> groupSettings = settings.getGroups(THREADPOOL_GROUP);
 
         int availableProcessors = EsExecutors.boundedNumberOfProcessors(settings);

+ 1 - 1
src/test/java/org/elasticsearch/benchmark/transport/BenchmarkNettyLargeMessages.java

@@ -53,7 +53,7 @@ public class BenchmarkNettyLargeMessages {
 
         NetworkService networkService = new NetworkService(settings);
 
-        final ThreadPool threadPool = new ThreadPool();
+        final ThreadPool threadPool = new ThreadPool("BenchmarkNettyLargeMessages");
         final TransportService transportServiceServer = new TransportService(new NettyTransport(settings, threadPool, networkService, BigArrays.NON_RECYCLING_INSTANCE, Version.CURRENT), threadPool).start();
         final TransportService transportServiceClient = new TransportService(new NettyTransport(settings, threadPool, networkService, BigArrays.NON_RECYCLING_INSTANCE, Version.CURRENT), threadPool).start();
 

+ 2 - 2
src/test/java/org/elasticsearch/benchmark/transport/TransportBenchmark.java

@@ -72,10 +72,10 @@ public class TransportBenchmark {
         Settings settings = ImmutableSettings.settingsBuilder()
                 .build();
 
-        final ThreadPool serverThreadPool = new ThreadPool();
+        final ThreadPool serverThreadPool = new ThreadPool("server");
         final TransportService serverTransportService = new TransportService(type.newTransport(settings, serverThreadPool), serverThreadPool).start();
 
-        final ThreadPool clientThreadPool = new ThreadPool();
+        final ThreadPool clientThreadPool = new ThreadPool("client");
         final TransportService clientTransportService = new TransportService(type.newTransport(settings, clientThreadPool), clientThreadPool).start();
 
         final DiscoveryNode node = new DiscoveryNode("server", serverTransportService.boundAddress().publishAddress(), Version.CURRENT);

+ 1 - 1
src/test/java/org/elasticsearch/common/util/BigArraysTests.java

@@ -36,7 +36,7 @@ import java.util.Arrays;
 public class BigArraysTests extends ElasticsearchTestCase {
 
     public static BigArrays randombigArrays() {
-        final PageCacheRecycler recycler = randomBoolean() ? null : new MockPageCacheRecycler(ImmutableSettings.EMPTY, new ThreadPool());
+        final PageCacheRecycler recycler = randomBoolean() ? null : new MockPageCacheRecycler(ImmutableSettings.EMPTY, new ThreadPool("BigArraysTests"));
         return new MockBigArrays(ImmutableSettings.EMPTY, recycler);
     }
 

+ 2 - 2
src/test/java/org/elasticsearch/discovery/zen/ping/multicast/MulticastZenPingTests.java

@@ -64,7 +64,7 @@ public class MulticastZenPingTests extends ElasticsearchTestCase {
         Settings settings = ImmutableSettings.EMPTY;
         settings = buildRandomMulticast(settings);
 
-        ThreadPool threadPool = new ThreadPool();
+        ThreadPool threadPool = new ThreadPool("testSimplePings");
         ClusterName clusterName = new ClusterName("test");
         final TransportService transportServiceA = new TransportService(new LocalTransport(settings, threadPool, Version.CURRENT), threadPool).start();
         final DiscoveryNode nodeA = new DiscoveryNode("A", transportServiceA.boundAddress().publishAddress(), Version.CURRENT);
@@ -118,7 +118,7 @@ public class MulticastZenPingTests extends ElasticsearchTestCase {
         Settings settings = ImmutableSettings.EMPTY;
         settings = buildRandomMulticast(settings);
 
-        ThreadPool threadPool = new ThreadPool();
+        ThreadPool threadPool = new ThreadPool("testExternalPing");
         ClusterName clusterName = new ClusterName("test");
         final TransportService transportServiceA = new TransportService(new LocalTransport(settings, threadPool, Version.CURRENT), threadPool).start();
         final DiscoveryNode nodeA = new DiscoveryNode("A", transportServiceA.boundAddress().publishAddress(), Version.CURRENT);

+ 1 - 1
src/test/java/org/elasticsearch/discovery/zen/ping/unicast/UnicastZenPingTests.java

@@ -52,7 +52,7 @@ public class UnicastZenPingTests extends ElasticsearchTestCase {
         int endPort = startPort + 10;
         settings = ImmutableSettings.builder().put(settings).put("transport.tcp.port", startPort + "-" + endPort).build();
 
-        ThreadPool threadPool = new ThreadPool();
+        ThreadPool threadPool = new ThreadPool(getClass().getName());
         ClusterName clusterName = new ClusterName("test");
         NetworkService networkService = new NetworkService(settings);
 

+ 17 - 15
src/test/java/org/elasticsearch/index/aliases/IndexAliasesServiceTests.java

@@ -27,6 +27,7 @@ import org.elasticsearch.common.inject.Injector;
 import org.elasticsearch.common.inject.ModulesBuilder;
 import org.elasticsearch.common.inject.util.Providers;
 import org.elasticsearch.common.settings.ImmutableSettings;
+import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.settings.SettingsModule;
 import org.elasticsearch.common.xcontent.ToXContent;
 import org.elasticsearch.common.xcontent.XContentBuilder;
@@ -44,17 +45,16 @@ import org.elasticsearch.index.query.functionscore.FunctionScoreModule;
 import org.elasticsearch.index.settings.IndexSettingsModule;
 import org.elasticsearch.index.similarity.SimilarityModule;
 import org.elasticsearch.indices.InvalidAliasNameException;
-import org.elasticsearch.indices.query.IndicesQueriesModule;
-import org.elasticsearch.script.ScriptModule;
 import org.elasticsearch.indices.fielddata.breaker.CircuitBreakerService;
 import org.elasticsearch.indices.fielddata.breaker.DummyCircuitBreakerService;
+import org.elasticsearch.indices.query.IndicesQueriesModule;
+import org.elasticsearch.script.ScriptModule;
 import org.elasticsearch.test.ElasticsearchTestCase;
 import org.junit.Test;
 
 import java.io.IOException;
 
 import static org.elasticsearch.index.query.FilterBuilders.termFilter;
-import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.nullValue;
 
@@ -63,23 +63,25 @@ import static org.hamcrest.Matchers.nullValue;
  */
 public class IndexAliasesServiceTests extends ElasticsearchTestCase {
     public static IndexAliasesService newIndexAliasesService() {
-        return new IndexAliasesService(new Index("test"), ImmutableSettings.Builder.EMPTY_SETTINGS, newIndexQueryParserService());
+
+        Settings settings = ImmutableSettings.builder().put("name", "IndexAliasesServiceTests").build();
+        return new IndexAliasesService(new Index("test"), settings, newIndexQueryParserService(settings));
     }
 
-    public static IndexQueryParserService newIndexQueryParserService() {
+    public static IndexQueryParserService newIndexQueryParserService(Settings settings) {
         Injector injector = new ModulesBuilder().add(
                 new IndicesQueriesModule(),
-                new CacheRecyclerModule(ImmutableSettings.Builder.EMPTY_SETTINGS),
-                new CodecModule(ImmutableSettings.Builder.EMPTY_SETTINGS),
-                new IndexSettingsModule(new Index("test"), ImmutableSettings.Builder.EMPTY_SETTINGS),
+                new CacheRecyclerModule(settings),
+                new CodecModule(settings),
+                new IndexSettingsModule(new Index("test"), settings),
                 new IndexNameModule(new Index("test")),
-                new IndexQueryParserModule(ImmutableSettings.Builder.EMPTY_SETTINGS),
-                new AnalysisModule(ImmutableSettings.Builder.EMPTY_SETTINGS),
-                new SimilarityModule(ImmutableSettings.Builder.EMPTY_SETTINGS),
-                new ScriptModule(ImmutableSettings.Builder.EMPTY_SETTINGS),
-                new SettingsModule(ImmutableSettings.Builder.EMPTY_SETTINGS),
-                new IndexEngineModule(ImmutableSettings.Builder.EMPTY_SETTINGS),
-                new IndexCacheModule(ImmutableSettings.Builder.EMPTY_SETTINGS),
+                new IndexQueryParserModule(settings),
+                new AnalysisModule(settings),
+                new SimilarityModule(settings),
+                new ScriptModule(settings),
+                new SettingsModule(settings),
+                new IndexEngineModule(settings),
+                new IndexCacheModule(settings),
                 new FunctionScoreModule(),
                 new AbstractModule() {
                     @Override

+ 1 - 2
src/test/java/org/elasticsearch/index/engine/internal/InternalEngineTests.java

@@ -19,7 +19,6 @@
 
 package org.elasticsearch.index.engine.internal;
 
-import org.apache.log4j.Appender;
 import org.apache.log4j.AppenderSkeleton;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
@@ -115,7 +114,7 @@ public class InternalEngineTests extends ElasticsearchTestCase {
                 .put(InternalEngine.INDEX_COMPOUND_ON_FLUSH, getRandom().nextBoolean())
                 .put(InternalEngine.INDEX_GC_DELETES, "1h") // make sure this doesn't kick in on us
                 .build(); // TODO randomize more settings
-        threadPool = new ThreadPool();
+        threadPool = new ThreadPool(getClass().getName());
         store = createStore();
         store.deleteContent();
         storeReplica = createStoreReplica();

+ 1 - 0
src/test/java/org/elasticsearch/index/query/IndexQueryParserFilterCachingTests.java

@@ -86,6 +86,7 @@ public class IndexQueryParserFilterCachingTests extends ElasticsearchTestCase {
     public static void setupQueryParser() throws IOException {
         Settings settings = ImmutableSettings.settingsBuilder()
                 .put("index.cache.filter.type", "weighted")
+                .put("name", "IndexQueryParserFilterCachingTests")
                 .build();
         Index index = new Index("test");
         injector = new ModulesBuilder().add(

+ 1 - 1
src/test/java/org/elasticsearch/index/query/SimpleIndexQueryParserTests.java

@@ -33,7 +33,6 @@ import org.elasticsearch.ElasticsearchException;
 import org.elasticsearch.action.get.MultiGetRequest;
 import org.elasticsearch.cache.recycler.CacheRecyclerModule;
 import org.elasticsearch.cluster.ClusterService;
-import org.elasticsearch.common.Strings;
 import org.elasticsearch.common.bytes.BytesArray;
 import org.elasticsearch.common.compress.CompressedString;
 import org.elasticsearch.common.inject.AbstractModule;
@@ -110,6 +109,7 @@ public class SimpleIndexQueryParserTests extends ElasticsearchTestCase {
     public static void setupQueryParser() throws IOException {
         Settings settings = ImmutableSettings.settingsBuilder()
                 .put("index.cache.filter.type", "none")
+                .put("name", "SimpleIndexQueryParserTests")
                 .build();
         Index index = new Index("test");
         injector = new ModulesBuilder().add(

+ 4 - 1
src/test/java/org/elasticsearch/index/query/TemplateQueryParserTest.java

@@ -63,7 +63,10 @@ public class TemplateQueryParserTest extends ElasticsearchTestCase {
 
     @Before
     public void setup() throws IOException {
-        Settings settings = ImmutableSettings.settingsBuilder().put("path.conf", this.getResource("config").getPath()).build();
+        Settings settings = ImmutableSettings.settingsBuilder()
+                .put("path.conf", this.getResource("config").getPath())
+                .put("name", getClass().getName())
+                .build();
 
         Index index = new Index("test");
         injector = new ModulesBuilder().add(

+ 3 - 3
src/test/java/org/elasticsearch/index/query/guice/IndexQueryParserModuleTests.java

@@ -38,17 +38,16 @@ import org.elasticsearch.index.query.IndexQueryParserService;
 import org.elasticsearch.index.query.functionscore.FunctionScoreModule;
 import org.elasticsearch.index.settings.IndexSettingsModule;
 import org.elasticsearch.index.similarity.SimilarityModule;
-import org.elasticsearch.indices.query.IndicesQueriesModule;
-import org.elasticsearch.script.ScriptModule;
 import org.elasticsearch.indices.fielddata.breaker.CircuitBreakerService;
 import org.elasticsearch.indices.fielddata.breaker.DummyCircuitBreakerService;
+import org.elasticsearch.indices.query.IndicesQueriesModule;
+import org.elasticsearch.script.ScriptModule;
 import org.elasticsearch.test.ElasticsearchTestCase;
 import org.elasticsearch.threadpool.ThreadPool;
 import org.elasticsearch.threadpool.ThreadPoolModule;
 import org.junit.Test;
 
 import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder;
-import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.equalTo;
 
 /**
@@ -64,6 +63,7 @@ public class IndexQueryParserModuleTests extends ElasticsearchTestCase {
                 .put("index.queryparser.filter.my.type", MyJsonFilterParser.class)
                 .put("index.queryparser.filter.my.param2", "value2")
                 .put("index.cache.filter.type", "none")
+                .put("name", "IndexQueryParserModuleTests")
                 .build();
 
         Index index = new Index("test");

+ 3 - 4
src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPlugin2Tests.java

@@ -39,16 +39,15 @@ import org.elasticsearch.index.query.IndexQueryParserService;
 import org.elasticsearch.index.query.functionscore.FunctionScoreModule;
 import org.elasticsearch.index.settings.IndexSettingsModule;
 import org.elasticsearch.index.similarity.SimilarityModule;
-import org.elasticsearch.indices.query.IndicesQueriesModule;
-import org.elasticsearch.script.ScriptModule;
 import org.elasticsearch.indices.fielddata.breaker.CircuitBreakerService;
 import org.elasticsearch.indices.fielddata.breaker.DummyCircuitBreakerService;
+import org.elasticsearch.indices.query.IndicesQueriesModule;
+import org.elasticsearch.script.ScriptModule;
 import org.elasticsearch.test.ElasticsearchTestCase;
 import org.elasticsearch.threadpool.ThreadPool;
 import org.elasticsearch.threadpool.ThreadPoolModule;
 import org.junit.Test;
 
-import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.equalTo;
 
 /**
@@ -58,7 +57,7 @@ public class IndexQueryParserPlugin2Tests extends ElasticsearchTestCase {
 
     @Test
     public void testCustomInjection() {
-        Settings settings = ImmutableSettings.Builder.EMPTY_SETTINGS;
+        Settings settings = ImmutableSettings.builder().put("name", "testCustomInjection").build();
 
         IndexQueryParserModule queryParserModule = new IndexQueryParserModule(settings);
         queryParserModule.addQueryParser("my", PluginJsonQueryParser.class);

+ 3 - 3
src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPluginTests.java

@@ -39,10 +39,10 @@ import org.elasticsearch.index.query.IndexQueryParserService;
 import org.elasticsearch.index.query.functionscore.FunctionScoreModule;
 import org.elasticsearch.index.settings.IndexSettingsModule;
 import org.elasticsearch.index.similarity.SimilarityModule;
-import org.elasticsearch.indices.query.IndicesQueriesModule;
-import org.elasticsearch.script.ScriptModule;
 import org.elasticsearch.indices.fielddata.breaker.CircuitBreakerService;
 import org.elasticsearch.indices.fielddata.breaker.DummyCircuitBreakerService;
+import org.elasticsearch.indices.query.IndicesQueriesModule;
+import org.elasticsearch.script.ScriptModule;
 import org.elasticsearch.test.ElasticsearchTestCase;
 import org.elasticsearch.threadpool.ThreadPool;
 import org.elasticsearch.threadpool.ThreadPoolModule;
@@ -57,7 +57,7 @@ public class IndexQueryParserPluginTests extends ElasticsearchTestCase {
 
     @Test
     public void testCustomInjection() {
-        Settings settings = ImmutableSettings.Builder.EMPTY_SETTINGS;
+        Settings settings = ImmutableSettings.builder().put("name", "testCustomInjection").build();
 
         IndexQueryParserModule queryParserModule = new IndexQueryParserModule(settings);
         queryParserModule.addProcessor(new IndexQueryParserModule.QueryParsersProcessor() {

+ 1 - 1
src/test/java/org/elasticsearch/index/search/child/ChildrenConstantScoreQueryTests.java

@@ -349,7 +349,7 @@ public class ChildrenConstantScoreQueryTests extends ElasticsearchLuceneTestCase
     static SearchContext createSearchContext(String indexName, String parentType, String childType) throws IOException {
         final Index index = new Index(indexName);
         final CacheRecycler cacheRecycler = new CacheRecycler(ImmutableSettings.EMPTY);
-        ThreadPool threadPool = new ThreadPool();
+        ThreadPool threadPool = new ThreadPool("ChildrenConstantScoreQueryTests");
         final PageCacheRecycler pageCacheRecycler = new PageCacheRecycler(ImmutableSettings.EMPTY, threadPool);
         final BigArrays bigArrays = new BigArrays(ImmutableSettings.EMPTY, pageCacheRecycler);
         Settings settings = ImmutableSettings.EMPTY;

+ 1 - 1
src/test/java/org/elasticsearch/script/NativeScriptTests.java

@@ -30,7 +30,6 @@ import org.junit.Test;
 
 import java.util.Map;
 
-import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.equalTo;
 
 public class NativeScriptTests extends ElasticsearchTestCase {
@@ -39,6 +38,7 @@ public class NativeScriptTests extends ElasticsearchTestCase {
     public void testNativeScript() {
         Settings settings = ImmutableSettings.settingsBuilder()
                 .put("script.native.my.type", MyNativeScriptFactory.class.getName())
+                .put("name", "testNativeScript")
                 .build();
         Injector injector = new ModulesBuilder().add(
                 new SettingsModule(settings),

+ 17 - 5
src/test/java/org/elasticsearch/threadpool/UpdateThreadPoolSettingsTests.java

@@ -49,7 +49,11 @@ public class UpdateThreadPoolSettingsTests extends ElasticsearchTestCase {
 
     @Test
     public void testCachedExecutorType() {
-        ThreadPool threadPool = new ThreadPool(ImmutableSettings.settingsBuilder().put("threadpool.search.type", "cached").build(), null);
+        ThreadPool threadPool = new ThreadPool(
+                ImmutableSettings.settingsBuilder()
+                        .put("threadpool.search.type", "cached")
+                        .put("name","testCachedExecutorType").build(), null);
+
         assertThat(info(threadPool, Names.SEARCH).getType(), equalTo("cached"));
         assertThat(info(threadPool, Names.SEARCH).getKeepAlive().minutes(), equalTo(5L));
         assertThat(threadPool.executor(Names.SEARCH), instanceOf(EsThreadPoolExecutor.class));
@@ -102,7 +106,10 @@ public class UpdateThreadPoolSettingsTests extends ElasticsearchTestCase {
 
     @Test
     public void testFixedExecutorType() {
-        ThreadPool threadPool = new ThreadPool(settingsBuilder().put("threadpool.search.type", "fixed").build(), null);
+        ThreadPool threadPool = new ThreadPool(settingsBuilder()
+                .put("threadpool.search.type", "fixed")
+                .put("name","testCachedExecutorType").build(), null);
+
         assertThat(threadPool.executor(Names.SEARCH), instanceOf(EsThreadPoolExecutor.class));
 
         // Replace with different type
@@ -159,8 +166,11 @@ public class UpdateThreadPoolSettingsTests extends ElasticsearchTestCase {
 
     @Test
     public void testScalingExecutorType() {
-        ThreadPool threadPool = new ThreadPool(
-                settingsBuilder().put("threadpool.search.type", "scaling").put("threadpool.search.size", 10).build(), null);
+        ThreadPool threadPool = new ThreadPool(settingsBuilder()
+                .put("threadpool.search.type", "scaling")
+                .put("threadpool.search.size", 10)
+                .put("name","testCachedExecutorType").build(), null);
+
         assertThat(info(threadPool, Names.SEARCH).getMin(), equalTo(1));
         assertThat(info(threadPool, Names.SEARCH).getMax(), equalTo(10));
         assertThat(info(threadPool, Names.SEARCH).getKeepAlive().minutes(), equalTo(5L));
@@ -191,7 +201,9 @@ public class UpdateThreadPoolSettingsTests extends ElasticsearchTestCase {
 
     @Test(timeout = 10000)
     public void testShutdownDownNowDoesntBlock() throws Exception {
-        ThreadPool threadPool = new ThreadPool(ImmutableSettings.settingsBuilder().put("threadpool.search.type", "cached").build(), null);
+        ThreadPool threadPool = new ThreadPool(ImmutableSettings.settingsBuilder()
+                .put("threadpool.search.type", "cached")
+                .put("name","testCachedExecutorType").build(), null);
 
         final CountDownLatch latch = new CountDownLatch(1);
         Executor oldExecutor = threadPool.executor(Names.SEARCH);

+ 1 - 1
src/test/java/org/elasticsearch/transport/AbstractSimpleTransportTests.java

@@ -61,7 +61,7 @@ public abstract class AbstractSimpleTransportTests extends ElasticsearchTestCase
     @Before
     public void setUp() throws Exception {
         super.setUp();
-        threadPool = new ThreadPool();
+        threadPool = new ThreadPool(getClass().getName());
         serviceA = build(ImmutableSettings.builder().put("name", "TS_A").build(), version0);
         nodeA = new DiscoveryNode("TS_A", "TS_A", serviceA.boundAddress().publishAddress(), ImmutableMap.<String, String>of(), version0);
         serviceB = build(ImmutableSettings.builder().put("name", "TS_B").build(), version1);