2010-02-08 15:30:06 +02:00
|
|
|
/*
|
2014-01-06 22:48:02 +01:00
|
|
|
* Licensed to Elasticsearch under one or more contributor
|
|
|
|
* license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright
|
|
|
|
* ownership. Elasticsearch licenses this file to you under
|
|
|
|
* the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
* not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2010-02-08 15:30:06 +02:00
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package org.elasticsearch.cluster;
|
|
|
|
|
2011-12-06 02:42:25 +02:00
|
|
|
import com.google.common.collect.ImmutableList;
|
|
|
|
import org.elasticsearch.cluster.action.index.*;
|
2010-02-08 15:30:06 +02:00
|
|
|
import org.elasticsearch.cluster.action.shard.ShardStateAction;
|
2011-12-06 02:42:25 +02:00
|
|
|
import org.elasticsearch.cluster.metadata.*;
|
2011-09-26 21:01:23 +03:00
|
|
|
import org.elasticsearch.cluster.node.DiscoveryNodeService;
|
2010-02-08 15:30:06 +02:00
|
|
|
import org.elasticsearch.cluster.routing.RoutingService;
|
2011-09-06 17:11:55 +03:00
|
|
|
import org.elasticsearch.cluster.routing.allocation.AllocationModule;
|
2010-10-19 16:23:39 +02:00
|
|
|
import org.elasticsearch.cluster.routing.operation.OperationRoutingModule;
|
2010-02-25 18:40:29 +02:00
|
|
|
import org.elasticsearch.cluster.service.InternalClusterService;
|
2013-02-25 18:39:59 -05:00
|
|
|
import org.elasticsearch.cluster.settings.ClusterDynamicSettingsModule;
|
2010-06-15 16:51:38 +03:00
|
|
|
import org.elasticsearch.common.inject.AbstractModule;
|
2010-08-22 10:42:25 +03:00
|
|
|
import org.elasticsearch.common.inject.Module;
|
|
|
|
import org.elasticsearch.common.inject.SpawnModules;
|
2010-06-15 16:51:38 +03:00
|
|
|
import org.elasticsearch.common.settings.Settings;
|
2013-02-25 18:39:59 -05:00
|
|
|
import org.elasticsearch.index.settings.IndexDynamicSettingsModule;
|
2010-02-08 15:30:06 +02:00
|
|
|
|
|
|
|
/**
|
2011-12-06 02:42:25 +02:00
|
|
|
*
|
2010-02-08 15:30:06 +02:00
|
|
|
*/
|
2010-08-22 10:42:25 +03:00
|
|
|
public class ClusterModule extends AbstractModule implements SpawnModules {
|
2010-02-08 15:30:06 +02:00
|
|
|
|
|
|
|
private final Settings settings;
|
|
|
|
|
|
|
|
public ClusterModule(Settings settings) {
|
|
|
|
this.settings = settings;
|
|
|
|
}
|
|
|
|
|
2011-12-06 02:42:25 +02:00
|
|
|
@Override
|
|
|
|
public Iterable<? extends Module> spawnModules() {
|
2013-02-25 18:39:59 -05:00
|
|
|
return ImmutableList.of(new AllocationModule(settings),
|
|
|
|
new OperationRoutingModule(settings),
|
|
|
|
new ClusterDynamicSettingsModule(),
|
|
|
|
new IndexDynamicSettingsModule());
|
2010-08-22 10:42:25 +03:00
|
|
|
}
|
|
|
|
|
2010-02-08 15:30:06 +02:00
|
|
|
@Override
|
|
|
|
protected void configure() {
|
2011-09-26 21:01:23 +03:00
|
|
|
bind(DiscoveryNodeService.class).asEagerSingleton();
|
2010-02-25 18:40:29 +02:00
|
|
|
bind(ClusterService.class).to(InternalClusterService.class).asEagerSingleton();
|
2011-08-20 04:00:41 +03:00
|
|
|
|
2011-09-02 09:36:25 +03:00
|
|
|
bind(MetaDataService.class).asEagerSingleton();
|
2010-07-13 18:01:57 +03:00
|
|
|
bind(MetaDataCreateIndexService.class).asEagerSingleton();
|
|
|
|
bind(MetaDataDeleteIndexService.class).asEagerSingleton();
|
2013-07-27 13:49:02 +02:00
|
|
|
bind(MetaDataIndexStateService.class).asEagerSingleton();
|
2010-07-13 18:01:57 +03:00
|
|
|
bind(MetaDataMappingService.class).asEagerSingleton();
|
|
|
|
bind(MetaDataIndexAliasesService.class).asEagerSingleton();
|
2010-08-08 09:17:09 +03:00
|
|
|
bind(MetaDataUpdateSettingsService.class).asEagerSingleton();
|
2010-11-26 15:45:18 +02:00
|
|
|
bind(MetaDataIndexTemplateService.class).asEagerSingleton();
|
2010-07-13 18:01:57 +03:00
|
|
|
|
2010-02-08 15:30:06 +02:00
|
|
|
bind(RoutingService.class).asEagerSingleton();
|
|
|
|
|
|
|
|
bind(ShardStateAction.class).asEagerSingleton();
|
|
|
|
bind(NodeIndexDeletedAction.class).asEagerSingleton();
|
2011-04-22 16:07:18 +03:00
|
|
|
bind(NodeMappingRefreshAction.class).asEagerSingleton();
|
2010-02-21 22:57:39 +02:00
|
|
|
bind(MappingUpdatedAction.class).asEagerSingleton();
|
2013-08-16 12:20:56 -06:00
|
|
|
|
|
|
|
bind(ClusterInfoService.class).to(InternalClusterInfoService.class).asEagerSingleton();
|
2010-02-08 15:30:06 +02:00
|
|
|
}
|
|
|
|
}
|