From acf17b4e39ccfb28e1ac13ba48e37c4f4a96516a Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Tue, 13 Aug 2013 14:29:24 +0200 Subject: [PATCH] Added some comments regarding the acknowledgement logic in MetaDataMappingService.putMapping Made left over cluster state debug log entry less verbose. --- .../cluster/metadata/MetaDataMappingService.java | 6 +++--- .../cluster/service/InternalClusterService.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java b/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java index 19cfd36d660..57f06b00947 100644 --- a/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java +++ b/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java @@ -483,8 +483,8 @@ public class MetaDataMappingService extends AbstractComponent { ClusterState updatedState = newClusterStateBuilder().state(currentState).metaData(builder).build(); - // counter the number of nodes participating so we can wait for responses from other nodes if needed - int counter = 1; // this mast node + int counter = 1; // we want to wait on the master node to apply it on its cluster state + // also wait for nodes that actually have the index created on them to apply the mappings internally for (String index : request.indices) { IndexRoutingTable indexRoutingTable = updatedState.routingTable().index(index); if (indexRoutingTable != null) { @@ -506,7 +506,7 @@ public class MetaDataMappingService extends AbstractComponent { @Override public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { if (countDownListener != null) { - // notify we did stuff on our end. + // the master has applied it on its cluster state countDownListener.onNodeMappingCreated(null); } } diff --git a/src/main/java/org/elasticsearch/cluster/service/InternalClusterService.java b/src/main/java/org/elasticsearch/cluster/service/InternalClusterService.java index f19218af271..9804c07ffff 100644 --- a/src/main/java/org/elasticsearch/cluster/service/InternalClusterService.java +++ b/src/main/java/org/elasticsearch/cluster/service/InternalClusterService.java @@ -372,7 +372,7 @@ public class InternalClusterService extends AbstractLifecycleComponent