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


Java ClusterSettings.addSettingsUpdateConsumer方法代码示例

本文整理汇总了Java中org.elasticsearch.common.settings.ClusterSettings.addSettingsUpdateConsumer方法的典型用法代码示例。如果您正苦于以下问题:Java ClusterSettings.addSettingsUpdateConsumer方法的具体用法?Java ClusterSettings.addSettingsUpdateConsumer怎么用?Java ClusterSettings.addSettingsUpdateConsumer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.common.settings.ClusterSettings的用法示例。


在下文中一共展示了ClusterSettings.addSettingsUpdateConsumer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TransportService

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
/**
 * Build the service.
 *
 * @param clusterSettings if non null the the {@linkplain TransportService} will register with the {@link ClusterSettings} for settings
 *        updates for {@link #TRACE_LOG_EXCLUDE_SETTING} and {@link #TRACE_LOG_INCLUDE_SETTING}.
 */
public TransportService(Settings settings, Transport transport, ThreadPool threadPool, TransportInterceptor transportInterceptor,
                        Function<BoundTransportAddress, DiscoveryNode> localNodeFactory, @Nullable ClusterSettings clusterSettings) {
    super(settings);
    this.transport = transport;
    this.threadPool = threadPool;
    this.localNodeFactory = localNodeFactory;
    this.clusterName = ClusterName.CLUSTER_NAME_SETTING.get(settings);
    setTracerLogInclude(TRACE_LOG_INCLUDE_SETTING.get(settings));
    setTracerLogExclude(TRACE_LOG_EXCLUDE_SETTING.get(settings));
    tracerLog = Loggers.getLogger(logger, ".tracer");
    adapter = createAdapter();
    taskManager = createTaskManager();
    this.interceptor = transportInterceptor;
    this.asyncSender = interceptor.interceptSender(this::sendRequestInternal);
    if (clusterSettings != null) {
        clusterSettings.addSettingsUpdateConsumer(TRACE_LOG_INCLUDE_SETTING, this::setTracerLogInclude);
        clusterSettings.addSettingsUpdateConsumer(TRACE_LOG_EXCLUDE_SETTING, this::setTracerLogExclude);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:26,代码来源:TransportService.java

示例2: InternalClusterInfoService

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
public InternalClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client) {
    super(settings);
    this.leastAvailableSpaceUsages = ImmutableOpenMap.of();
    this.mostAvailableSpaceUsages = ImmutableOpenMap.of();
    this.shardRoutingToDataPath = ImmutableOpenMap.of();
    this.shardSizes = ImmutableOpenMap.of();
    this.clusterService = clusterService;
    this.threadPool = threadPool;
    this.client = client;
    this.updateFrequency = INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING.get(settings);
    this.fetchTimeout = INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING.get(settings);
    this.enabled = DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.get(settings);
    ClusterSettings clusterSettings = clusterService.getClusterSettings();
    clusterSettings.addSettingsUpdateConsumer(INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING, this::setFetchTimeout);
    clusterSettings.addSettingsUpdateConsumer(INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING, this::setUpdateFrequency);
    clusterSettings.addSettingsUpdateConsumer(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING, this::setEnabled);

    // Add InternalClusterInfoService to listen for Master changes
    this.clusterService.addLocalNodeMasterListener(this);
    // Add to listen for state changes (when nodes are added)
    this.clusterService.addListener(this);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:23,代码来源:InternalClusterInfoService.java

示例3: ThrottlingAllocationDecider

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
public ThrottlingAllocationDecider(Settings settings, ClusterSettings clusterSettings) {
    super(settings);
    this.primariesInitialRecoveries = CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_PRIMARIES_RECOVERIES_SETTING.get(settings);
    concurrentIncomingRecoveries = CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING.get(settings);
    concurrentOutgoingRecoveries = CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING.get(settings);

    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_PRIMARIES_RECOVERIES_SETTING,
            this::setPrimariesInitialRecoveries);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING,
            this::setConcurrentIncomingRecoverries);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING,
            this::setConcurrentOutgoingRecoverries);

    logger.debug("using node_concurrent_outgoing_recoveries [{}], node_concurrent_incoming_recoveries [{}], " +
                    "node_initial_primaries_recoveries [{}]",
            concurrentOutgoingRecoveries, concurrentIncomingRecoveries, primariesInitialRecoveries);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:18,代码来源:ThrottlingAllocationDecider.java

示例4: HierarchyCircuitBreakerService

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
public HierarchyCircuitBreakerService(Settings settings, ClusterSettings clusterSettings) {
    super(settings);
    this.fielddataSettings = new BreakerSettings(CircuitBreaker.FIELDDATA,
            FIELDDATA_CIRCUIT_BREAKER_LIMIT_SETTING.get(settings).getBytes(),
            FIELDDATA_CIRCUIT_BREAKER_OVERHEAD_SETTING.get(settings),
            FIELDDATA_CIRCUIT_BREAKER_TYPE_SETTING.get(settings)
    );

    this.inFlightRequestsSettings = new BreakerSettings(CircuitBreaker.IN_FLIGHT_REQUESTS,
            IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_LIMIT_SETTING.get(settings).getBytes(),
            IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_OVERHEAD_SETTING.get(settings),
            IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_TYPE_SETTING.get(settings)
    );

    this.requestSettings = new BreakerSettings(CircuitBreaker.REQUEST,
            REQUEST_CIRCUIT_BREAKER_LIMIT_SETTING.get(settings).getBytes(),
            REQUEST_CIRCUIT_BREAKER_OVERHEAD_SETTING.get(settings),
            REQUEST_CIRCUIT_BREAKER_TYPE_SETTING.get(settings)
    );

    this.parentSettings = new BreakerSettings(CircuitBreaker.PARENT,
            TOTAL_CIRCUIT_BREAKER_LIMIT_SETTING.get(settings).getBytes(), 1.0,
            CircuitBreaker.Type.PARENT);

    if (logger.isTraceEnabled()) {
        logger.trace("parent circuit breaker with settings {}", this.parentSettings);
    }

    registerBreaker(this.requestSettings);
    registerBreaker(this.fielddataSettings);
    registerBreaker(this.inFlightRequestsSettings);

    clusterSettings.addSettingsUpdateConsumer(TOTAL_CIRCUIT_BREAKER_LIMIT_SETTING, this::setTotalCircuitBreakerLimit, this::validateTotalCircuitBreakerLimit);
    clusterSettings.addSettingsUpdateConsumer(FIELDDATA_CIRCUIT_BREAKER_LIMIT_SETTING, FIELDDATA_CIRCUIT_BREAKER_OVERHEAD_SETTING, this::setFieldDataBreakerLimit);
    clusterSettings.addSettingsUpdateConsumer(IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_LIMIT_SETTING, IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_OVERHEAD_SETTING, this::setInFlightRequestsBreakerLimit);
    clusterSettings.addSettingsUpdateConsumer(REQUEST_CIRCUIT_BREAKER_LIMIT_SETTING, REQUEST_CIRCUIT_BREAKER_OVERHEAD_SETTING, this::setRequestBreakerLimit);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:38,代码来源:HierarchyCircuitBreakerService.java

示例5: DiscoverySettings

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
public DiscoverySettings(Settings settings, ClusterSettings clusterSettings) {
    super(settings);
    clusterSettings.addSettingsUpdateConsumer(NO_MASTER_BLOCK_SETTING, this::setNoMasterBlock);
    clusterSettings.addSettingsUpdateConsumer(PUBLISH_DIFF_ENABLE_SETTING, this::setPublishDiff);
    clusterSettings.addSettingsUpdateConsumer(COMMIT_TIMEOUT_SETTING, this::setCommitTimeout);
    clusterSettings.addSettingsUpdateConsumer(PUBLISH_TIMEOUT_SETTING, this::setPublishTimeout);
    this.noMasterBlock = NO_MASTER_BLOCK_SETTING.get(settings);
    this.publishTimeout = PUBLISH_TIMEOUT_SETTING.get(settings);
    this.commitTimeout = COMMIT_TIMEOUT_SETTING.get(settings);
    this.publishDiff = PUBLISH_DIFF_ENABLE_SETTING.get(settings);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:DiscoverySettings.java

示例6: DiskThresholdSettings

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
public DiskThresholdSettings(Settings settings, ClusterSettings clusterSettings) {
    final String lowWatermark = CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.get(settings);
    final String highWatermark = CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.get(settings);
    setHighWatermark(highWatermark);
    setLowWatermark(lowWatermark);
    this.includeRelocations = CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING.get(settings);
    this.rerouteInterval = CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING.get(settings);
    this.enabled = CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.get(settings);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING, this::setLowWatermark);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING, this::setHighWatermark);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING, this::setIncludeRelocations);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING, this::setRerouteInterval);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING, this::setEnabled);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:DiskThresholdSettings.java

示例7: BalancedShardsAllocator

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
@Inject
public BalancedShardsAllocator(Settings settings, ClusterSettings clusterSettings) {
    super(settings);
    setWeightFunction(INDEX_BALANCE_FACTOR_SETTING.get(settings), SHARD_BALANCE_FACTOR_SETTING.get(settings));
    setThreshold(THRESHOLD_SETTING.get(settings));
    clusterSettings.addSettingsUpdateConsumer(INDEX_BALANCE_FACTOR_SETTING, SHARD_BALANCE_FACTOR_SETTING, this::setWeightFunction);
    clusterSettings.addSettingsUpdateConsumer(THRESHOLD_SETTING, this::setThreshold);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:BalancedShardsAllocator.java

示例8: ClusterRebalanceAllocationDecider

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
public ClusterRebalanceAllocationDecider(Settings settings, ClusterSettings clusterSettings) {
    super(settings);
    try {
        type = CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING.get(settings);
    } catch (IllegalStateException e) {
        logger.warn("[{}] has a wrong value {}, defaulting to 'indices_all_active'",
                CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING,
                CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING.getRaw(settings));
        type = ClusterRebalanceType.INDICES_ALL_ACTIVE;
    }
    logger.debug("using [{}] with [{}]", CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE, type);

    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING, this::setType);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:ClusterRebalanceAllocationDecider.java

示例9: EnableAllocationDecider

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
public EnableAllocationDecider(Settings settings, ClusterSettings clusterSettings) {
    super(settings);
    this.enableAllocation = CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING.get(settings);
    this.enableRebalance = CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.get(settings);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING, this::setEnableAllocation);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING, this::setEnableRebalance);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:EnableAllocationDecider.java

示例10: ConcurrentRebalanceAllocationDecider

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
public ConcurrentRebalanceAllocationDecider(Settings settings, ClusterSettings clusterSettings) {
    super(settings);
    this.clusterConcurrentRebalance = CLUSTER_ROUTING_ALLOCATION_CLUSTER_CONCURRENT_REBALANCE_SETTING.get(settings);
    logger.debug("using [cluster_concurrent_rebalance] with [{}]", clusterConcurrentRebalance);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_CLUSTER_CONCURRENT_REBALANCE_SETTING,
            this::setClusterConcurrentRebalance);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:ConcurrentRebalanceAllocationDecider.java

示例11: AwarenessAllocationDecider

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
public AwarenessAllocationDecider(Settings settings, ClusterSettings clusterSettings) {
    super(settings);
    this.awarenessAttributes = CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING.get(settings);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING, this::setAwarenessAttributes);
    setForcedAwarenessAttributes(CLUSTER_ROUTING_ALLOCATION_AWARENESS_FORCE_GROUP_SETTING.get(settings));
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_AWARENESS_FORCE_GROUP_SETTING,
            this::setForcedAwarenessAttributes);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:AwarenessAllocationDecider.java

示例12: FilterAllocationDecider

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
public FilterAllocationDecider(Settings settings, ClusterSettings clusterSettings) {
    super(settings);
    setClusterRequireFilters(CLUSTER_ROUTING_REQUIRE_GROUP_SETTING.get(settings));
    setClusterExcludeFilters(CLUSTER_ROUTING_EXCLUDE_GROUP_SETTING.get(settings));
    setClusterIncludeFilters(CLUSTER_ROUTING_INCLUDE_GROUP_SETTING.get(settings));
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_REQUIRE_GROUP_SETTING, this::setClusterRequireFilters);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_EXCLUDE_GROUP_SETTING, this::setClusterExcludeFilters);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_INCLUDE_GROUP_SETTING, this::setClusterIncludeFilters);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:FilterAllocationDecider.java

示例13: TransportCloseIndexAction

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
@Inject
public TransportCloseIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                 ThreadPool threadPool, MetaDataIndexStateService indexStateService,
                                 ClusterSettings clusterSettings, ActionFilters actionFilters,
                                 IndexNameExpressionResolver indexNameExpressionResolver, DestructiveOperations destructiveOperations) {
    super(settings, CloseIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, CloseIndexRequest::new);
    this.indexStateService = indexStateService;
    this.destructiveOperations = destructiveOperations;
    this.closeIndexEnabled = CLUSTER_INDICES_CLOSE_ENABLE_SETTING.get(settings);
    clusterSettings.addSettingsUpdateConsumer(CLUSTER_INDICES_CLOSE_ENABLE_SETTING, this::setCloseIndexEnabled);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:TransportCloseIndexAction.java

示例14: processRecoverySettings

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
@Override
protected void processRecoverySettings(ClusterSettings clusterSettings, RecoverySettings recoverySettings) {
    if (false == getPluginsService().filterPlugins(RecoverySettingsChunkSizePlugin.class).isEmpty()) {
        clusterSettings.addSettingsUpdateConsumer(RecoverySettingsChunkSizePlugin.CHUNK_SIZE_SETTING, recoverySettings::setChunkSize);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:MockNode.java

示例15: registerClusterSettingsListeners

import org.elasticsearch.common.settings.ClusterSettings; //导入方法依赖的package包/类
void registerClusterSettingsListeners(ClusterSettings clusterSettings) {
    clusterSettings.addSettingsUpdateConsumer(SCRIPT_MAX_COMPILATIONS_PER_MINUTE, this::setMaxCompilationsPerMinute);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:4,代码来源:ScriptService.java


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