From 813e3557abab47752b751a58d64b925b3a9a1c85 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Tue, 30 Jul 2013 23:41:22 +0200 Subject: [PATCH] don't call the refresh mapping listener callback twice though not harmful, results in an annoying transport service log --- .../cluster/metadata/MetaDataMappingService.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java b/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java index 6dbb042ddab..a0ad9d3b039 100644 --- a/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java +++ b/src/main/java/org/elasticsearch/cluster/metadata/MetaDataMappingService.java @@ -23,7 +23,10 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import org.elasticsearch.action.support.master.MasterNodeOperationRequest; -import org.elasticsearch.cluster.*; +import org.elasticsearch.cluster.ClusterService; +import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.ClusterStateUpdateTask; +import org.elasticsearch.cluster.TimeoutClusterStateUpdateTask; import org.elasticsearch.cluster.action.index.NodeMappingCreatedAction; import org.elasticsearch.cluster.routing.IndexRoutingTable; import org.elasticsearch.common.Priority; @@ -276,7 +279,7 @@ public class MetaDataMappingService extends AbstractComponent { public void updateMapping(final String index, final String type, final CompressedString mappingSource, final Listener listener) { refreshOrUpdateQueue.add(new UpdateTask(index, type, mappingSource, listener)); - clusterService.submitStateUpdateTask("update-mapping [" + index + "][" + type + "]", Priority.HIGH, new ProcessedClusterStateUpdateTask() { + clusterService.submitStateUpdateTask("update-mapping [" + index + "][" + type + "]", Priority.HIGH, new ClusterStateUpdateTask() { @Override public void onFailure(String source, Throwable t) { listener.onFailure(t); @@ -286,11 +289,6 @@ public class MetaDataMappingService extends AbstractComponent { public ClusterState execute(final ClusterState currentState) throws Exception { return executeRefreshOrUpdate(currentState); } - - @Override - public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { - listener.onResponse(new Response(true)); - } }); }