Renamed MetaDataStateIndexService to MetaDataIndexStateService for consistency

This commit is contained in:
Luca Cavanna 2013-07-27 13:49:02 +02:00
parent 105d4bab5f
commit 8eed6cdcae
6 changed files with 16 additions and 16 deletions

View File

@ -27,7 +27,7 @@ import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.block.ClusterBlockException;
import org.elasticsearch.cluster.block.ClusterBlockLevel; 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.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
@ -38,13 +38,13 @@ import org.elasticsearch.transport.TransportService;
*/ */
public class TransportCloseIndexAction extends TransportMasterNodeOperationAction<CloseIndexRequest, CloseIndexResponse> { public class TransportCloseIndexAction extends TransportMasterNodeOperationAction<CloseIndexRequest, CloseIndexResponse> {
private final MetaDataStateIndexService stateIndexService; private final MetaDataIndexStateService stateIndexService;
private final boolean disableCloseAllIndices; private final boolean disableCloseAllIndices;
@Inject @Inject
public TransportCloseIndexAction(Settings settings, TransportService transportService, ClusterService clusterService, public TransportCloseIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
ThreadPool threadPool, MetaDataStateIndexService stateIndexService) { ThreadPool threadPool, MetaDataIndexStateService stateIndexService) {
super(settings, transportService, clusterService, threadPool); super(settings, transportService, clusterService, threadPool);
this.stateIndexService = stateIndexService; this.stateIndexService = stateIndexService;
this.disableCloseAllIndices = settings.getAsBoolean("action.disable_close_all_indices", false); this.disableCloseAllIndices = settings.getAsBoolean("action.disable_close_all_indices", false);
@ -94,9 +94,9 @@ public class TransportCloseIndexAction extends TransportMasterNodeOperationActio
@Override @Override
protected void masterOperation(final CloseIndexRequest request, final ClusterState state, final ActionListener<CloseIndexResponse> listener) throws ElasticSearchException { protected void masterOperation(final CloseIndexRequest request, final ClusterState state, final ActionListener<CloseIndexResponse> 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 @Override
public void onResponse(MetaDataStateIndexService.Response response) { public void onResponse(MetaDataIndexStateService.Response response) {
listener.onResponse(new CloseIndexResponse(response.acknowledged())); listener.onResponse(new CloseIndexResponse(response.acknowledged()));
} }

View File

@ -26,7 +26,7 @@ import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.block.ClusterBlockException;
import org.elasticsearch.cluster.block.ClusterBlockLevel; 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.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
@ -37,11 +37,11 @@ import org.elasticsearch.transport.TransportService;
*/ */
public class TransportOpenIndexAction extends TransportMasterNodeOperationAction<OpenIndexRequest, OpenIndexResponse> { public class TransportOpenIndexAction extends TransportMasterNodeOperationAction<OpenIndexRequest, OpenIndexResponse> {
private final MetaDataStateIndexService stateIndexService; private final MetaDataIndexStateService stateIndexService;
@Inject @Inject
public TransportOpenIndexAction(Settings settings, TransportService transportService, ClusterService clusterService, public TransportOpenIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
ThreadPool threadPool, MetaDataStateIndexService stateIndexService) { ThreadPool threadPool, MetaDataIndexStateService stateIndexService) {
super(settings, transportService, clusterService, threadPool); super(settings, transportService, clusterService, threadPool);
this.stateIndexService = stateIndexService; this.stateIndexService = stateIndexService;
} }
@ -80,9 +80,9 @@ public class TransportOpenIndexAction extends TransportMasterNodeOperationAction
@Override @Override
protected void masterOperation(final OpenIndexRequest request, final ClusterState state, final ActionListener<OpenIndexResponse> listener) throws ElasticSearchException { protected void masterOperation(final OpenIndexRequest request, final ClusterState state, final ActionListener<OpenIndexResponse> 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 @Override
public void onResponse(MetaDataStateIndexService.Response response) { public void onResponse(MetaDataIndexStateService.Response response) {
listener.onResponse(new OpenIndexResponse(response.acknowledged())); listener.onResponse(new OpenIndexResponse(response.acknowledged()));
} }

View File

@ -62,7 +62,7 @@ public class ClusterModule extends AbstractModule implements SpawnModules {
bind(MetaDataService.class).asEagerSingleton(); bind(MetaDataService.class).asEagerSingleton();
bind(MetaDataCreateIndexService.class).asEagerSingleton(); bind(MetaDataCreateIndexService.class).asEagerSingleton();
bind(MetaDataDeleteIndexService.class).asEagerSingleton(); bind(MetaDataDeleteIndexService.class).asEagerSingleton();
bind(MetaDataStateIndexService.class).asEagerSingleton(); bind(MetaDataIndexStateService.class).asEagerSingleton();
bind(MetaDataMappingService.class).asEagerSingleton(); bind(MetaDataMappingService.class).asEagerSingleton();
bind(MetaDataIndexAliasesService.class).asEagerSingleton(); bind(MetaDataIndexAliasesService.class).asEagerSingleton();
bind(MetaDataUpdateSettingsService.class).asEagerSingleton(); bind(MetaDataUpdateSettingsService.class).asEagerSingleton();

View File

@ -24,7 +24,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import org.elasticsearch.cluster.metadata.IndexMetaData; 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.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.RestStatus;
@ -237,7 +237,7 @@ public class ClusterBlocks {
public Builder addBlocks(IndexMetaData indexMetaData) { public Builder addBlocks(IndexMetaData indexMetaData) {
if (indexMetaData.state() == IndexMetaData.State.CLOSE) { 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)) { if (indexMetaData.settings().getAsBoolean(IndexMetaData.SETTING_READ_ONLY, false)) {
addIndexBlock(indexMetaData.index(), IndexMetaData.INDEX_READ_ONLY_BLOCK); addIndexBlock(indexMetaData.index(), IndexMetaData.INDEX_READ_ONLY_BLOCK);

View File

@ -322,7 +322,7 @@ public class MetaDataCreateIndexService extends AbstractComponent {
} }
} }
if (request.state == State.CLOSE) { 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(); ClusterState updatedState = newClusterStateBuilder().state(currentState).blocks(blocks).metaData(newMetaData).build();

View File

@ -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); 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; private final NodeIndicesStateUpdatedAction indicesStateUpdatedAction;
@Inject @Inject
public MetaDataStateIndexService(Settings settings, ClusterService clusterService, AllocationService allocationService, NodeIndicesStateUpdatedAction indicesStateUpdatedAction) { public MetaDataIndexStateService(Settings settings, ClusterService clusterService, AllocationService allocationService, NodeIndicesStateUpdatedAction indicesStateUpdatedAction) {
super(settings); super(settings);
this.clusterService = clusterService; this.clusterService = clusterService;
this.allocationService = allocationService; this.allocationService = allocationService;