From 8eed6cdcaefa07980230fafdf2945adc32c76611 Mon Sep 17 00:00:00 2001 From: Luca Cavanna Date: Sat, 27 Jul 2013 13:49:02 +0200 Subject: [PATCH] Renamed MetaDataStateIndexService to MetaDataIndexStateService for consistency --- .../admin/indices/close/TransportCloseIndexAction.java | 10 +++++----- .../admin/indices/open/TransportOpenIndexAction.java | 10 +++++----- .../java/org/elasticsearch/cluster/ClusterModule.java | 2 +- .../org/elasticsearch/cluster/block/ClusterBlocks.java | 4 ++-- .../cluster/metadata/MetaDataCreateIndexService.java | 2 +- ...ndexService.java => MetaDataIndexStateService.java} | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) rename src/main/java/org/elasticsearch/cluster/metadata/{MetaDataStateIndexService.java => MetaDataIndexStateService.java} (99%) diff --git a/src/main/java/org/elasticsearch/action/admin/indices/close/TransportCloseIndexAction.java b/src/main/java/org/elasticsearch/action/admin/indices/close/TransportCloseIndexAction.java index f3c2cb1139d..c8352158af3 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/close/TransportCloseIndexAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/close/TransportCloseIndexAction.java @@ -27,7 +27,7 @@ import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.block.ClusterBlockLevel; -import org.elasticsearch.cluster.metadata.MetaDataStateIndexService; +import org.elasticsearch.cluster.metadata.MetaDataIndexStateService; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.threadpool.ThreadPool; @@ -38,13 +38,13 @@ import org.elasticsearch.transport.TransportService; */ public class TransportCloseIndexAction extends TransportMasterNodeOperationAction { - private final MetaDataStateIndexService stateIndexService; + private final MetaDataIndexStateService stateIndexService; private final boolean disableCloseAllIndices; @Inject public TransportCloseIndexAction(Settings settings, TransportService transportService, ClusterService clusterService, - ThreadPool threadPool, MetaDataStateIndexService stateIndexService) { + ThreadPool threadPool, MetaDataIndexStateService stateIndexService) { super(settings, transportService, clusterService, threadPool); this.stateIndexService = stateIndexService; this.disableCloseAllIndices = settings.getAsBoolean("action.disable_close_all_indices", false); @@ -94,9 +94,9 @@ public class TransportCloseIndexAction extends TransportMasterNodeOperationActio @Override protected void masterOperation(final CloseIndexRequest request, final ClusterState state, final ActionListener listener) throws ElasticSearchException { - stateIndexService.closeIndex(new MetaDataStateIndexService.Request(request.indices()).timeout(request.timeout()).masterTimeout(request.masterNodeTimeout()), new MetaDataStateIndexService.Listener() { + stateIndexService.closeIndex(new MetaDataIndexStateService.Request(request.indices()).timeout(request.timeout()).masterTimeout(request.masterNodeTimeout()), new MetaDataIndexStateService.Listener() { @Override - public void onResponse(MetaDataStateIndexService.Response response) { + public void onResponse(MetaDataIndexStateService.Response response) { listener.onResponse(new CloseIndexResponse(response.acknowledged())); } diff --git a/src/main/java/org/elasticsearch/action/admin/indices/open/TransportOpenIndexAction.java b/src/main/java/org/elasticsearch/action/admin/indices/open/TransportOpenIndexAction.java index dab69d5fc7f..befaebda4e1 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/open/TransportOpenIndexAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/open/TransportOpenIndexAction.java @@ -26,7 +26,7 @@ import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.block.ClusterBlockLevel; -import org.elasticsearch.cluster.metadata.MetaDataStateIndexService; +import org.elasticsearch.cluster.metadata.MetaDataIndexStateService; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.threadpool.ThreadPool; @@ -37,11 +37,11 @@ import org.elasticsearch.transport.TransportService; */ public class TransportOpenIndexAction extends TransportMasterNodeOperationAction { - private final MetaDataStateIndexService stateIndexService; + private final MetaDataIndexStateService stateIndexService; @Inject public TransportOpenIndexAction(Settings settings, TransportService transportService, ClusterService clusterService, - ThreadPool threadPool, MetaDataStateIndexService stateIndexService) { + ThreadPool threadPool, MetaDataIndexStateService stateIndexService) { super(settings, transportService, clusterService, threadPool); this.stateIndexService = stateIndexService; } @@ -80,9 +80,9 @@ public class TransportOpenIndexAction extends TransportMasterNodeOperationAction @Override protected void masterOperation(final OpenIndexRequest request, final ClusterState state, final ActionListener listener) throws ElasticSearchException { - stateIndexService.openIndex(new MetaDataStateIndexService.Request(request.indices()).timeout(request.timeout()).masterTimeout(request.masterNodeTimeout()), new MetaDataStateIndexService.Listener() { + stateIndexService.openIndex(new MetaDataIndexStateService.Request(request.indices()).timeout(request.timeout()).masterTimeout(request.masterNodeTimeout()), new MetaDataIndexStateService.Listener() { @Override - public void onResponse(MetaDataStateIndexService.Response response) { + public void onResponse(MetaDataIndexStateService.Response response) { listener.onResponse(new OpenIndexResponse(response.acknowledged())); } diff --git a/src/main/java/org/elasticsearch/cluster/ClusterModule.java b/src/main/java/org/elasticsearch/cluster/ClusterModule.java index 5df5395f96c..b0ec776053e 100644 --- a/src/main/java/org/elasticsearch/cluster/ClusterModule.java +++ b/src/main/java/org/elasticsearch/cluster/ClusterModule.java @@ -62,7 +62,7 @@ public class ClusterModule extends AbstractModule implements SpawnModules { bind(MetaDataService.class).asEagerSingleton(); bind(MetaDataCreateIndexService.class).asEagerSingleton(); bind(MetaDataDeleteIndexService.class).asEagerSingleton(); - bind(MetaDataStateIndexService.class).asEagerSingleton(); + bind(MetaDataIndexStateService.class).asEagerSingleton(); bind(MetaDataMappingService.class).asEagerSingleton(); bind(MetaDataIndexAliasesService.class).asEagerSingleton(); bind(MetaDataUpdateSettingsService.class).asEagerSingleton(); diff --git a/src/main/java/org/elasticsearch/cluster/block/ClusterBlocks.java b/src/main/java/org/elasticsearch/cluster/block/ClusterBlocks.java index 5185534514e..ea03c9f246c 100644 --- a/src/main/java/org/elasticsearch/cluster/block/ClusterBlocks.java +++ b/src/main/java/org/elasticsearch/cluster/block/ClusterBlocks.java @@ -24,7 +24,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import org.elasticsearch.cluster.metadata.IndexMetaData; -import org.elasticsearch.cluster.metadata.MetaDataStateIndexService; +import org.elasticsearch.cluster.metadata.MetaDataIndexStateService; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.rest.RestStatus; @@ -237,7 +237,7 @@ public class ClusterBlocks { public Builder addBlocks(IndexMetaData indexMetaData) { if (indexMetaData.state() == IndexMetaData.State.CLOSE) { - addIndexBlock(indexMetaData.index(), MetaDataStateIndexService.INDEX_CLOSED_BLOCK); + addIndexBlock(indexMetaData.index(), MetaDataIndexStateService.INDEX_CLOSED_BLOCK); } if (indexMetaData.settings().getAsBoolean(IndexMetaData.SETTING_READ_ONLY, false)) { addIndexBlock(indexMetaData.index(), IndexMetaData.INDEX_READ_ONLY_BLOCK); diff --git a/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java b/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java index f59206fd5bb..cf93ab1d18f 100644 --- a/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java +++ b/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java @@ -322,7 +322,7 @@ public class MetaDataCreateIndexService extends AbstractComponent { } } if (request.state == State.CLOSE) { - blocks.addIndexBlock(request.index, MetaDataStateIndexService.INDEX_CLOSED_BLOCK); + blocks.addIndexBlock(request.index, MetaDataIndexStateService.INDEX_CLOSED_BLOCK); } ClusterState updatedState = newClusterStateBuilder().state(currentState).blocks(blocks).metaData(newMetaData).build(); diff --git a/src/main/java/org/elasticsearch/cluster/metadata/MetaDataStateIndexService.java b/src/main/java/org/elasticsearch/cluster/metadata/MetaDataIndexStateService.java similarity index 99% rename from src/main/java/org/elasticsearch/cluster/metadata/MetaDataStateIndexService.java rename to src/main/java/org/elasticsearch/cluster/metadata/MetaDataIndexStateService.java index 4110b8890ef..273b50a8ca1 100644 --- a/src/main/java/org/elasticsearch/cluster/metadata/MetaDataStateIndexService.java +++ b/src/main/java/org/elasticsearch/cluster/metadata/MetaDataIndexStateService.java @@ -52,7 +52,7 @@ import java.util.concurrent.atomic.AtomicInteger; /** * */ -public class MetaDataStateIndexService extends AbstractComponent { +public class MetaDataIndexStateService extends AbstractComponent { public static final ClusterBlock INDEX_CLOSED_BLOCK = new ClusterBlock(4, "index closed", false, false, RestStatus.FORBIDDEN, ClusterBlockLevel.READ_WRITE); @@ -63,7 +63,7 @@ public class MetaDataStateIndexService extends AbstractComponent { private final NodeIndicesStateUpdatedAction indicesStateUpdatedAction; @Inject - public MetaDataStateIndexService(Settings settings, ClusterService clusterService, AllocationService allocationService, NodeIndicesStateUpdatedAction indicesStateUpdatedAction) { + public MetaDataIndexStateService(Settings settings, ClusterService clusterService, AllocationService allocationService, NodeIndicesStateUpdatedAction indicesStateUpdatedAction) { super(settings); this.clusterService = clusterService; this.allocationService = allocationService;