com.hazelcast.instance.Node类的使用及代码示例

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

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

Node介绍

暂无

代码示例

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

JetInstanceImpl(HazelcastInstanceImpl hazelcastInstance, JetConfig config) {
  super(hazelcastInstance);
  this.nodeEngine = hazelcastInstance.node.getNodeEngine();
  this.config = config;
}

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

@Override
public void shouldConnectTo(Address address) {
  if (node.getThisAddress().equals(address)) {
    throw new RuntimeException("Connecting to self! " + address);
  }
}

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

@Override
public Config getConfig() {
  return node.getConfig();
}

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

private void changeNodeState(ClusterState newState) {
  if (newState == ClusterState.PASSIVE) {
    node.changeNodeStateToPassive();
  } else {
    node.changeNodeStateToActive();
  }
}

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

public NodeMulticastListener(Node node) {
  this.node = node;
  this.logger = node.getLogger(NodeMulticastListener.class.getName());
  this.ourConfig = node.createConfigCheck();
}

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

public NodeIOService(Node node, NodeEngineImpl nodeEngine) {
  this.node = node;
  this.nodeEngine = nodeEngine;
  restApiConfig = initRestApiConfig(node.getProperties(), node.getConfig());
  memcacheProtocolConfig = initMemcacheProtocolConfig(node.getProperties(), node.getConfig());
}

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

private MulticastService(Node node, MulticastSocket multicastSocket)
    throws Exception {
  this.logger = node.getLogger(MulticastService.class.getName());
  this.node = node;
  this.multicastSocket = multicastSocket;
  NodeIOService nodeIOService = new NodeIOService(node, node.nodeEngine);
  this.inputProcessor = node.getNodeExtension().createMulticastInputProcessor(nodeIOService);
  this.outputProcessor = node.getNodeExtension().createMulticastOutputProcessor(nodeIOService);
  this.sendOutput = node.getSerializationService().createObjectDataOutput(SEND_OUTPUT_SIZE);
  Config config = node.getConfig();
  MulticastConfig multicastConfig = config.getNetworkConfig().getJoin().getMulticastConfig();
  this.datagramPacketSend = new DatagramPacket(new byte[0], 0, InetAddress.getByName(multicastConfig.getMulticastGroup()),
      multicastConfig.getMulticastPort());
  this.datagramPacketReceive = new DatagramPacket(new byte[DATAGRAM_BUFFER_SIZE], DATAGRAM_BUFFER_SIZE);
  Set<String> trustedInterfaces = multicastConfig.getTrustedInterfaces();
  ILogger logger = node.getLogger(JoinMessageTrustChecker.class);
  joinMessageTrustChecker = new JoinMessageTrustChecker(trustedInterfaces, logger);
}

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

MembershipManager(Node node, ClusterServiceImpl clusterService, Lock clusterServiceLock) {
  this.node = node;
  this.clusterService = clusterService;
  this.clusterServiceLock = clusterServiceLock;
  this.nodeEngine = node.getNodeEngine();
  this.logger = node.getLogger(getClass());
  mastershipClaimTimeoutSeconds = node.getProperties().getInteger(MASTERSHIP_CLAIM_TIMEOUT_SECONDS);
  registerThisMember();
}

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

public PartitionStateManager(Node node, InternalPartitionServiceImpl partitionService, PartitionListener listener) {
  this.node = node;
  this.logger = node.getLogger(getClass());
  this.partitionService = partitionService;
  this.partitionCount = partitionService.getPartitionCount();
  this.partitions = new InternalPartitionImpl[partitionCount];
  PartitionReplica localReplica = PartitionReplica.from(node.getLocalMember());
  for (int i = 0; i < partitionCount; i++) {
    this.partitions[i] = new InternalPartitionImpl(i, listener, localReplica);
  }
  memberGroupFactory = MemberGroupFactoryFactory.newMemberGroupFactory(node.getConfig().getPartitionGroupConfig(),
      node.getDiscoveryService());
  partitionStateGenerator = new PartitionStateGeneratorImpl();
}

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

PartitionReplicaStateChecker(Node node, InternalPartitionServiceImpl partitionService) {
  this.node = node;
  this.nodeEngine = node.getNodeEngine();
  this.partitionService = partitionService;
  this.logger = node.getLogger(getClass());
  this.partitionStateManager = partitionService.getPartitionStateManager();
  this.migrationManager = partitionService.getMigrationManager();
}

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

public TcpIpJoinerOverAWS(Node node) {
  super(node);
  logger = node.getLogger(getClass());
  AwsConfig awsConfig = node.getConfig().getNetworkConfig().getJoin().getAwsConfig();
  aws = new AWSClient(awsConfig);
}

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

public ClientEngineImpl(Node node) {
  this.logger = node.getLogger(ClientEngine.class);
  this.node = node;
  this.serializationService = node.getSerializationService();
  this.nodeEngine = node.nodeEngine;
  this.endpointManager = new ClientEndpointManagerImpl(nodeEngine);
  this.executor = newClientExecutor();
  this.queryExecutor = newClientQueryExecutor();
  this.clientManagementExecutor = newClientsManagementExecutor();
  this.messageTaskFactory = new CompositeMessageTaskFactory(nodeEngine);
  this.clientExceptions = initClientExceptionFactory();
  this.endpointRemoveDelaySeconds = node.getProperties().getInteger(GroupProperty.CLIENT_ENDPOINT_REMOVE_DELAY_SECONDS);
  this.partitionListenerService = new ClientPartitionListenerService(nodeEngine);
}

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

private boolean shouldResetHotRestartData() {
  final NodeExtension nodeExtension = node.getNodeExtension();
  return !nodeExtension.isStartCompleted()
      && nodeExtension.getInternalHotRestartService().isMemberExcluded(node.getThisAddress(), node.getThisUuid());
}

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

if (!setShuttingDown()) {
  waitIfAlreadyShuttingDown();
  return;
  boolean success = callGracefulShutdownAwareServices(maxWaitSeconds);
  if (!success) {
    logger.warning("Graceful shutdown could not be completed in " + maxWaitSeconds + " seconds!");
  shutdownServices(terminate);
  state = NodeState.SHUT_DOWN;
  logger.info("Hazelcast Shutdown is completed in " + (Clock.currentTimeMillis() - start) + " ms.");

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

/** Sends a {@link ShutdownResponseOperation} to the {@code address} or takes a shortcut if shutdown is local. */
private void sendShutdownOperation(Address address) {
  if (node.getThisAddress().equals(address)) {
    assert !node.isRunning() : "Node state: " + node.getState();
    partitionService.onShutdownResponse();
  } else {
    nodeEngine.getOperationService().send(new ShutdownResponseOperation(), address);
  }
}

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

@Override
public Member getLocalEndpoint() {
  return node.getLocalMember();
}

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

public SplitBrainJoinMessage createSplitBrainJoinMessage() {
  MemberImpl localMember = getLocalMember();
  boolean liteMember = localMember.isLiteMember();
  Collection<Address> memberAddresses = clusterService.getMemberAddresses();
  int dataMemberCount = clusterService.getSize(DATA_MEMBER_SELECTOR);
  Version clusterVersion = clusterService.getClusterVersion();
  int memberListVersion = clusterService.getMembershipManager().getMemberListVersion();
  return new SplitBrainJoinMessage(Packet.VERSION, buildInfo.getBuildNumber(), version, address, localMember.getUuid(),
      liteMember, createConfigCheck(), memberAddresses, dataMemberCount, clusterVersion, memberListVersion);
}

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

@Override
public InternalSerializationService getSerializationService() {
  return node.getSerializationService();
}

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

protected AbstractMessageTask(ClientMessage clientMessage, Node node, Connection connection) {
  this.clientMessage = clientMessage;
  this.logger = node.getLogger(getClass());
  this.node = node;
  this.nodeEngine = node.nodeEngine;
  this.serializationService = node.getSerializationService();
  this.connection = connection;
  this.clientEngine = node.clientEngine;
  this.endpointManager = clientEngine.getEndpointManager();
  this.endpoint = initEndpoint();
}

代码示例来源: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());
}

相关文章

微信公众号

最新文章

更多