本文整理汇总了Java中org.elasticsearch.cluster.ClusterService.add方法的典型用法代码示例。如果您正苦于以下问题:Java ClusterService.add方法的具体用法?Java ClusterService.add怎么用?Java ClusterService.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.cluster.ClusterService
的用法示例。
在下文中一共展示了ClusterService.add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BlobSchemaInfo
import org.elasticsearch.cluster.ClusterService; //导入方法依赖的package包/类
@Inject
public BlobSchemaInfo(ClusterService clusterService,
BlobEnvironment blobEnvironment,
IndexNameExpressionResolver indexNameExpressionResolver,
Environment environment,
Functions functions) {
this.clusterService = clusterService;
this.blobEnvironment = blobEnvironment;
this.indexNameExpressionResolver = indexNameExpressionResolver;
this.environment = environment;
this.functions = functions;
clusterService.add(this);
tableInfoFunction = new Function<String, TableInfo>() {
@Nullable
@Override
public TableInfo apply(@Nullable String input) {
return getTableInfo(input);
}
};
}
示例2: ReferenceInfos
import org.elasticsearch.cluster.ClusterService; //导入方法依赖的package包/类
@Inject
public ReferenceInfos(Map<String, SchemaInfo> builtInSchemas,
ClusterService clusterService,
IndexNameExpressionResolver indexNameExpressionResolver,
ThreadPool threadPool,
Provider<TransportPutIndexTemplateAction> transportPutIndexTemplateAction,
Functions functions) {
this.clusterService = clusterService;
this.indexNameExpressionResolver = indexNameExpressionResolver;
this.transportPutIndexTemplateAction = transportPutIndexTemplateAction;
this.functions = functions;
this.executorService = (ExecutorService) threadPool.executor(ThreadPool.Names.SUGGEST);
schemas.putAll(builtInSchemas);
schemas.remove(BlobSchemaInfo.NAME); // remove blob schema name
this.builtInSchemas = builtInSchemas;
clusterService.add(this);
}
示例3: setReallocation
import org.elasticsearch.cluster.ClusterService; //导入方法依赖的package包/类
public void setReallocation(final ClusterService clusterService, final RoutingService routingService) {
this.routingService = routingService;
clusterService.add(new ClusterStateListener() {
@Override
public void clusterChanged(ClusterChangedEvent event) {
boolean cleanCache = false;
DiscoveryNode localNode = event.state().nodes().localNode();
if (localNode != null) {
if (localNode.masterNode() == true && event.localNodeMaster() == false) {
cleanCache = true;
}
} else {
cleanCache = true;
}
if (cleanCache) {
Releasables.close(asyncFetchStarted.values());
asyncFetchStarted.clear();
Releasables.close(asyncFetchStore.values());
asyncFetchStore.clear();
}
}
});
}
示例4: DecommissioningService
import org.elasticsearch.cluster.ClusterService; //导入方法依赖的package包/类
@Inject
public DecommissioningService(Settings settings,
final ClusterService clusterService,
NodeSettingsService nodeSettingsService,
TransportSQLAction sqlAction,
TransportSQLBulkAction sqlBulkAction,
final TransportClusterHealthAction healthAction,
final TransportClusterUpdateSettingsAction updateSettingsAction) {
super(settings);
this.clusterService = clusterService;
this.sqlAction = sqlAction;
this.sqlBulkAction = sqlBulkAction;
this.healthAction = healthAction;
this.updateSettingsAction = updateSettingsAction;
ApplySettings applySettings = new ApplySettings();
applySettings.onRefreshSettings(settings);
nodeSettingsService.addListener(applySettings);
clusterService.add(new ClusterStateListener() {
@Override
public void clusterChanged(ClusterChangedEvent event) {
removeRemovedNodes(event);
}
});
try {
Signal signal = new Signal("USR2");
Signal.handle(signal, this);
} catch (IllegalArgumentException e) {
logger.warn("SIGUSR2 signal not supported on {}.", System.getProperty("os.name"), e);
}
}
示例5: SysRepositories
import org.elasticsearch.cluster.ClusterService; //导入方法依赖的package包/类
@Inject
public SysRepositories(ClusterService clusterService) {
RepositoriesMetaData repositoriesMetaData = clusterService.state().metaData().custom(RepositoriesMetaData.TYPE);
addRepositories(repositoriesMetaData);
clusterService.add(this);
}
示例6: setClusterService
import org.elasticsearch.cluster.ClusterService; //导入方法依赖的package包/类
public void setClusterService(ClusterService clusterService) {
clusterService.add(this);
}