com.hazelcast.instance.Node.getProperties()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中com.hazelcast.instance.Node.getProperties()方法的一些代码示例,展示了Node.getProperties()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getProperties()方法的具体详情如下:
包路径:com.hazelcast.instance.Node
类名称:Node
方法名:getProperties

Node.getProperties介绍

暂无

代码示例

代码示例来源:origin: hazelcast/hazelcast-jet

@Override
public HazelcastProperties properties() {
  return node.getProperties();
}

代码示例来源:origin: hazelcast/hazelcast-jet

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);
}

代码示例来源:origin: hazelcast/hazelcast-jet

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;
}

代码示例来源:origin: com.hazelcast/hazelcast-all

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;
}

代码示例来源:origin: com.hazelcast/hazelcast-all

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;
}

代码示例来源:origin: hazelcast/hazelcast-jet

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;
}

代码示例来源:origin: hazelcast/hazelcast-jet

private HealthMonitorLevel getHealthMonitorLevel() {
  String healthMonitorLevel = node.getProperties().getString(GroupProperty.HEALTH_MONITORING_LEVEL);
  return valueOf(healthMonitorLevel);
}

代码示例来源:origin: hazelcast/hazelcast-jet

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();
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet

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);
}

代码示例来源:origin: com.hazelcast/hazelcast-all

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();
}

代码示例来源:origin: hazelcast/hazelcast-jet

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);
}

代码示例来源:origin: hazelcast/hazelcast-jet

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();
}

代码示例来源:origin: hazelcast/hazelcast-jet

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);
}

代码示例来源:origin: hazelcast/hazelcast-jet

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();
}

代码示例来源:origin: hazelcast/hazelcast-jet

@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());
}

代码示例来源:origin: hazelcast/hazelcast-jet

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();
}

代码示例来源:origin: hazelcast/hazelcast-jet

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());
}

代码示例来源:origin: hazelcast/hazelcast-jet

private HealthMonitorThread(int delaySeconds) {
  super(createThreadName(node.hazelcastInstance.getName(), "HealthMonitor"));
  setDaemon(true);
  this.delaySeconds = delaySeconds;
  this.performanceLogHint = node.getProperties().getBoolean(Diagnostics.ENABLED);
}

代码示例来源:origin: hazelcast/hazelcast-jet

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);
}

代码示例来源:origin: hazelcast/hazelcast-jet

@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();
}

相关文章

微信公众号

最新文章

更多