当前位置: 首页>>代码示例>>Java>>正文


Java ClusterService.add方法代码示例

本文整理汇总了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);
        }
    };
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:21,代码来源:BlobSchemaInfo.java

示例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);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:ReferenceInfos.java

示例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();
            }
        }
    });
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:24,代码来源:GatewayAllocator.java

示例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);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:33,代码来源:DecommissioningService.java

示例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);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:7,代码来源:SysRepositories.java

示例6: setClusterService

import org.elasticsearch.cluster.ClusterService; //导入方法依赖的package包/类
public void setClusterService(ClusterService clusterService) {
    clusterService.add(this);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:4,代码来源:NodeSettingsService.java


注:本文中的org.elasticsearch.cluster.ClusterService.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。