public ClusterService(Settings settings, ClusterSettings clusterSettings, ThreadPool threadPool, Map<String, Supplier<ClusterState.Custom>> initialClusterStateCustoms) { super(settings); this.settings = settings; this.nodeName = Node.NODE_NAME_SETTING.get(settings); this.masterService = new MasterService(nodeName, settings, threadPool); this.operationRouting = new OperationRouting(settings, clusterSettings); this.clusterSettings = clusterSettings; this.clusterName = ClusterName.CLUSTER_NAME_SETTING.get(settings); this.clusterSettings.addSettingsUpdateConsumer(CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING, this::setSlowTaskLoggingThreshold); // Add a no-op update consumer so changes are logged this.clusterSettings.addAffixUpdateConsumer(USER_DEFINED_META_DATA, (first, second) -> {}, (first, second) -> {}); this.initialClusterStateCustoms = initialClusterStateCustoms; this.clusterApplierService = new ClusterApplierService(nodeName, settings, clusterSettings, threadPool, this::newClusterStateBuilder); }
public ClusterService(Settings settings, ClusterSettings clusterSettings, ThreadPool threadPool, Map<String, Supplier<ClusterState.Custom>> initialClusterStateCustoms) { super(settings); this.masterService = new MasterService(settings, threadPool); this.operationRouting = new OperationRouting(settings, clusterSettings); this.clusterSettings = clusterSettings; this.clusterName = ClusterName.CLUSTER_NAME_SETTING.get(settings); this.clusterSettings.addSettingsUpdateConsumer(CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING, this::setSlowTaskLoggingThreshold); this.initialClusterStateCustoms = initialClusterStateCustoms; this.clusterApplierService = new ClusterApplierService(settings, clusterSettings, threadPool, this::newClusterStateBuilder); }
public ClusterService(Settings settings, ClusterSettings clusterSettings, ThreadPool threadPool, Map<String, Supplier<ClusterState.Custom>> initialClusterStateCustoms) { super(settings); this.masterService = new MasterService(settings, threadPool); this.operationRouting = new OperationRouting(settings, clusterSettings); this.clusterSettings = clusterSettings; this.clusterName = ClusterName.CLUSTER_NAME_SETTING.get(settings); this.clusterSettings.addSettingsUpdateConsumer(CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING, this::setSlowTaskLoggingThreshold); // Add a no-op update consumer so changes are logged this.clusterSettings.addAffixUpdateConsumer(USER_DEFINED_META_DATA, (first, second) -> {}, (first, second) -> {}); this.initialClusterStateCustoms = initialClusterStateCustoms; this.clusterApplierService = new ClusterApplierService(settings, clusterSettings, threadPool, this::newClusterStateBuilder); }
public BaseClusterService(Settings settings, ClusterSettings clusterSettings, ThreadPool threadPool, Supplier<DiscoveryNode> localNodeSupplier) { super(settings); this.localNodeSupplier = localNodeSupplier; this.operationRouting = new OperationRouting(settings, clusterSettings); this.threadPool = threadPool; this.clusterSettings = clusterSettings; this.clusterName = ClusterName.CLUSTER_NAME_SETTING.get(settings); // will be replaced on doStart. this.state = new AtomicReference<>(ClusterState.builder(clusterName).build()); this.clusterSettings.addSettingsUpdateConsumer(CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING, this::setSlowTaskLoggingThreshold); this.slowTaskLoggingThreshold = CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings); localNodeMasterListeners = new LocalNodeMasterListeners(threadPool); //initialBlocks = ClusterBlocks.builder(); // Add NO_CASSANDRA_RING_BLOCK to avoid to save metadata while cassandra ring not ready. initialBlocks = ClusterBlocks.builder().addGlobalBlock(CassandraGatewayService.NO_CASSANDRA_RING_BLOCK); }