當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。