@Override public HazelcastProperties properties() { return node.getProperties(); }
protected final long getMaxJoinTimeToMasterNode() { // max join time to found master node, // this should be significantly greater than MAX_WAIT_SECONDS_BEFORE_JOIN property // hence we add 10 seconds more return TimeUnit.SECONDS.toMillis(MIN_WAIT_BEFORE_JOIN_SECONDS) + node.getProperties().getMillis(GroupProperty.MAX_WAIT_SECONDS_BEFORE_JOIN); }
public DiscoveryJoiner(Node node, DiscoveryService discoveryService, boolean usePublicAddress) { super(node); this.maximumWaitingTimeBeforeJoinSeconds = node.getProperties().getInteger(WAIT_SECONDS_BEFORE_JOIN); this.discoveryService = discoveryService; this.usePublicAddress = usePublicAddress; }
public TcpIpJoiner(Node node) { super(node); int tryCount = node.getProperties().getInteger(GroupProperty.TCP_JOIN_PORT_TRY_COUNT); if (tryCount <= 0) { throw new IllegalArgumentException(String.format("%s should be greater than zero! Current value: %d", GroupProperty.TCP_JOIN_PORT_TRY_COUNT, tryCount)); } maxPortTryCount = tryCount; }
public DiscoveryJoiner(Node node, DiscoveryService discoveryService, boolean usePublicAddress) { super(node); this.maximumWaitingTimeBeforeJoinSeconds = node.getProperties().getInteger(WAIT_SECONDS_BEFORE_JOIN); this.discoveryService = discoveryService; this.usePublicAddress = usePublicAddress; }
public TcpIpJoiner(Node node) { super(node); int tryCount = node.getProperties().getInteger(GroupProperty.TCP_JOIN_PORT_TRY_COUNT); if (tryCount <= 0) { throw new IllegalArgumentException(String.format("%s should be greater than zero! Current value: %d", GroupProperty.TCP_JOIN_PORT_TRY_COUNT, tryCount)); } maxPortTryCount = tryCount; }
private HealthMonitorLevel getHealthMonitorLevel() { String healthMonitorLevel = node.getProperties().getString(GroupProperty.HEALTH_MONITORING_LEVEL); return valueOf(healthMonitorLevel); }
protected PartitioningStrategy getPartitioningStrategy(ClassLoader configClassLoader) throws Exception { String partitioningStrategyClassName = node.getProperties().getString(GroupProperty.PARTITIONING_STRATEGY_CLASS); if (partitioningStrategyClassName != null && partitioningStrategyClassName.length() > 0) { return ClassLoaderUtil.newInstance(configClassLoader, partitioningStrategyClassName); } else { return new DefaultPartitioningStrategy(); } }
private Executor newBlockingExecutor() { final ExecutionService executionService = nodeEngine.getExecutionService(); int coreSize = Runtime.getRuntime().availableProcessors(); int threadCount = node.getProperties().getInteger(GroupProperty.CLIENT_ENGINE_BLOCKING_THREAD_COUNT); if (threadCount <= 0) { threadCount = coreSize * BLOCKING_THREADS_PER_CORE; } logger.finest("Creating new client executor for blocking tasks with threadCount=" + threadCount); return executionService.register(ExecutionService.CLIENT_BLOCKING_EXECUTOR, threadCount, coreSize * EXECUTOR_QUEUE_CAPACITY_PER_CORE, ExecutorType.CONCRETE); }
public TimedMemberStateFactory(HazelcastInstanceImpl instance) { this.instance = instance; if (instance.node.getProperties().get("hazelcast.mc.max.visible.instance.count") != null) { instance.node.loggingService.getLogger(getClass()) .warning("hazelcast.mc.max.visible.instance.count property is removed."); } cacheServiceEnabled = isCacheServiceEnabled(); }
public AbstractJoiner(Node node) { this.node = node; this.logger = node.loggingService.getLogger(getClass()); this.config = node.config; this.clusterService = node.getClusterService(); this.clusterJoinManager = clusterService.getClusterJoinManager(); this.mergeNextRunDelayMs = node.getProperties().getMillis(GroupProperty.MERGE_NEXT_RUN_DELAY_SECONDS); }
public TimedMemberStateFactory(HazelcastInstanceImpl instance) { this.instance = instance; if (instance.node.getProperties().get("hazelcast.mc.max.visible.instance.count") != null) { instance.node.loggingService.getLogger(getClass()) .warning("hazelcast.mc.max.visible.instance.count property is removed."); } cacheServiceEnabled = isCacheServiceEnabled(); }
void scheduleReplicaVersionSync(ExecutionService executionService) { long definedBackupSyncCheckInterval = node.getProperties().getSeconds(GroupProperty.PARTITION_BACKUP_SYNC_INTERVAL); long backupSyncCheckInterval = definedBackupSyncCheckInterval > 0 ? definedBackupSyncCheckInterval : 1; executionService.scheduleWithRepetition(new AntiEntropyTask(), backupSyncCheckInterval, backupSyncCheckInterval, TimeUnit.SECONDS); }
public HealthMonitor(Node node) { this.node = node; this.logger = node.getLogger(HealthMonitor.class); this.metricRegistry = node.nodeEngine.getMetricsRegistry(); this.monitorLevel = getHealthMonitorLevel(); this.thresholdMemoryPercentage = node.getProperties().getInteger(HEALTH_MONITORING_THRESHOLD_MEMORY_PERCENTAGE); this.thresholdCPUPercentage = node.getProperties().getInteger(HEALTH_MONITORING_THRESHOLD_CPU_PERCENTAGE); this.monitorThread = initMonitorThread(); this.healthMetrics = new HealthMetrics(); }
@Override public ConnectionManager createConnectionManager(Node node, ServerSocketChannel serverSocketChannel) { NodeIOService ioService = new NodeIOService(node, node.nodeEngine); Networking networking = createNetworking(node, ioService); return new TcpIpConnectionManager( ioService, serverSocketChannel, node.loggingService, node.nodeEngine.getMetricsRegistry(), networking, node.getProperties()); }
public LocalOperationStatsImpl(Node node) { this.maxVisibleSlowOperationCount = node.getProperties().getInteger(MC_MAX_VISIBLE_SLOW_OPERATION_COUNT); this.slowOperations = node.nodeEngine.getOperationService().getSlowOperationDTOs(); this.creationTime = Clock.currentTimeMillis(); }
private Diagnostics newDiagnostics() { Address address = node.getThisAddress(); String addressString = address.getHost().replace(":", "_") + "_" + address.getPort(); String name = "diagnostics-" + addressString + "-" + currentTimeMillis(); return new Diagnostics( name, loggingService.getLogger(Diagnostics.class), getHazelcastInstance().getName(), node.getProperties()); }
private HealthMonitorThread(int delaySeconds) { super(createThreadName(node.hazelcastInstance.getName(), "HealthMonitor")); setDaemon(true); this.delaySeconds = delaySeconds; this.performanceLogHint = node.getProperties().getBoolean(Diagnostics.ENABLED); }
private Executor newClientExecutor() { final ExecutionService executionService = nodeEngine.getExecutionService(); int coreSize = RuntimeAvailableProcessors.get(); int threadCount = node.getProperties().getInteger(GroupProperty.CLIENT_ENGINE_THREAD_COUNT); if (threadCount <= 0) { threadCount = coreSize * THREADS_PER_CORE; } logger.finest("Creating new client executor with threadCount=" + threadCount); return executionService.register(ExecutionService.CLIENT_EXECUTOR, threadCount, coreSize * EXECUTOR_QUEUE_CAPACITY_PER_CORE, ExecutorType.CONCRETE); }
@Override public void init(NodeEngine nodeEngine, Properties properties) { node.getConnectionManager().addConnectionListener(connectionListener); ClientHeartbeatMonitor heartbeatMonitor = new ClientHeartbeatMonitor( endpointManager, getLogger(ClientHeartbeatMonitor.class), nodeEngine.getExecutionService(), node.getProperties()); heartbeatMonitor.start(); }