Renamed MetaDataStateIndexService to MetaDataIndexStateService for consistency
This commit is contained in:
parent
105d4bab5f
commit
8eed6cdcae
|
@ -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<CloseIndexRequest, CloseIndexResponse> {
|
||||
|
||||
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<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
|
||||
public void onResponse(MetaDataStateIndexService.Response response) {
|
||||
public void onResponse(MetaDataIndexStateService.Response response) {
|
||||
listener.onResponse(new CloseIndexResponse(response.acknowledged()));
|
||||
}
|
||||
|
||||
|
|
|
@ -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<OpenIndexRequest, OpenIndexResponse> {
|
||||
|
||||
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<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
|
||||
public void onResponse(MetaDataStateIndexService.Response response) {
|
||||
public void onResponse(MetaDataIndexStateService.Response response) {
|
||||
listener.onResponse(new OpenIndexResponse(response.acknowledged()));
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
Loading…
Reference in New Issue