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

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

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

Node.getJoiner介绍

暂无

代码示例

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

  1. private void searchForOtherClusters() {
  2. Joiner joiner = node.getJoiner();
  3. if (joiner != null) {
  4. joiner.searchForOtherClusters();
  5. }
  6. }
  7. }

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

  1. private void searchForOtherClusters() {
  2. Joiner joiner = node.getJoiner();
  3. if (joiner != null) {
  4. joiner.searchForOtherClusters();
  5. }
  6. }
  7. }

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

  1. @Override
  2. public void onSuccessfulConnection(Address address) {
  3. if (!node.getClusterService().isJoined()) {
  4. node.getJoiner().unblacklist(address);
  5. }
  6. }

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

  1. @Override
  2. public void onSuccessfulConnection(Address address) {
  3. if (!node.getClusterService().isJoined()) {
  4. node.getJoiner().unblacklist(address);
  5. }
  6. }

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

  1. public void merge(Address newTargetAddress) {
  2. node.getJoiner().setTargetAddress(newTargetAddress);
  3. LifecycleServiceImpl lifecycleService = node.hazelcastInstance.getLifecycleService();
  4. lifecycleService.runUnderLifecycleLock(new ClusterMergeTask(node));
  5. }

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

  1. public void merge(Address newTargetAddress) {
  2. node.getJoiner().setTargetAddress(newTargetAddress);
  3. LifecycleServiceImpl lifecycleService = node.hazelcastInstance.getLifecycleService();
  4. lifecycleService.runUnderLifecycleLock(new ClusterMergeTask(node));
  5. }

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

  1. @Override
  2. public void onFailedConnection(final Address address) {
  3. ClusterService clusterService = node.clusterService;
  4. if (!clusterService.isJoined()) {
  5. node.getJoiner().blacklist(address, false);
  6. } else {
  7. if (clusterService.getMember(address) != null) {
  8. nodeEngine.getExecutionService().schedule(ExecutionService.IO_EXECUTOR, new ReconnectionTask(address),
  9. getConnectionMonitorInterval(), TimeUnit.MILLISECONDS);
  10. }
  11. }
  12. }

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

  1. @Override
  2. public void onFailedConnection(final Address address) {
  3. ClusterService clusterService = node.clusterService;
  4. if (!clusterService.isJoined()) {
  5. node.getJoiner().blacklist(address, false);
  6. } else {
  7. if (clusterService.getMember(address) != null) {
  8. nodeEngine.getExecutionService().schedule(ExecutionService.IO_EXECUTOR, new ReconnectionTask(address),
  9. getConnectionMonitorInterval(), TimeUnit.MILLISECONDS);
  10. }
  11. }
  12. }

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

  1. private void handleNotActiveOrNotJoined(JoinMessage joinMessage) {
  2. if (isJoinRequest(joinMessage)) {
  3. Joiner joiner = node.getJoiner();
  4. if (joiner instanceof MulticastJoiner) {
  5. MulticastJoiner multicastJoiner = (MulticastJoiner) joiner;
  6. multicastJoiner.onReceivedJoinRequest((JoinRequest) joinMessage);
  7. } else {
  8. logDroppedMessage(joinMessage);
  9. }
  10. } else {
  11. Address address = joinMessage.getAddress();
  12. if (node.getJoiner().isBlacklisted(address)) {
  13. logDroppedMessage(joinMessage);
  14. return;
  15. }
  16. ClusterServiceImpl clusterService = node.getClusterService();
  17. if (!clusterService.isJoined() && clusterService.getMasterAddress() == null) {
  18. clusterService.setMasterAddressToJoin(joinMessage.getAddress());
  19. } else {
  20. logDroppedMessage(joinMessage);
  21. }
  22. }
  23. }

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

  1. private void handleNotActiveOrNotJoined(JoinMessage joinMessage) {
  2. if (isJoinRequest(joinMessage)) {
  3. Joiner joiner = node.getJoiner();
  4. if (joiner instanceof MulticastJoiner) {
  5. MulticastJoiner multicastJoiner = (MulticastJoiner) joiner;
  6. multicastJoiner.onReceivedJoinRequest((JoinRequest) joinMessage);
  7. } else {
  8. logDroppedMessage(joinMessage);
  9. }
  10. } else {
  11. Address address = joinMessage.getAddress();
  12. if (node.getJoiner().isBlacklisted(address)) {
  13. logDroppedMessage(joinMessage);
  14. return;
  15. }
  16. ClusterServiceImpl clusterService = node.getClusterService();
  17. if (!clusterService.isJoined() && clusterService.getMasterAddress() == null) {
  18. clusterService.setMasterAddressToJoin(joinMessage.getAddress());
  19. } else {
  20. logDroppedMessage(joinMessage);
  21. }
  22. }
  23. }

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

  1. @Override
  2. public void run() {
  3. final NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
  4. Node node = nodeEngine.getNode();
  5. Joiner joiner = node.getJoiner();
  6. ClusterServiceImpl clusterService = node.getClusterService();
  7. final ILogger logger = node.getLogger(getClass().getName());
  8. if (joiner instanceof TcpIpJoiner) {
  9. TcpIpJoiner tcpIpJoiner = (TcpIpJoiner) joiner;
  10. final Address endpoint = getCallerAddress();
  11. final Address masterAddress = clusterService.getMasterAddress();
  12. approvedAsMaster = !tcpIpJoiner.isClaimingMaster() && !clusterService.isMaster()
  13. && (masterAddress == null || masterAddress.equals(endpoint));
  14. } else {
  15. approvedAsMaster = false;
  16. logger.warning("This node requires MulticastJoin strategy!");
  17. }
  18. if (logger.isFineEnabled()) {
  19. logger.fine("Sending '" + approvedAsMaster + "' for master claim of node: " + getCallerAddress());
  20. }
  21. }

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

  1. @Override
  2. public void run() {
  3. NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
  4. Connection connection = getConnection();
  5. String message = "Node could not join cluster at node: " + connection.getEndPoint()
  6. + " Cause: the target cluster has a different group-name";
  7. connection.close(message, null);
  8. ILogger logger = nodeEngine.getLogger("com.hazelcast.cluster");
  9. logger.warning(message);
  10. Node node = nodeEngine.getNode();
  11. node.getJoiner().blacklist(getCallerAddress(), true);
  12. }

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

  1. @Override
  2. public void run() {
  3. final NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
  4. Node node = nodeEngine.getNode();
  5. Joiner joiner = node.getJoiner();
  6. ClusterServiceImpl clusterService = node.getClusterService();
  7. final ILogger logger = node.getLogger(getClass().getName());
  8. if (joiner instanceof TcpIpJoiner) {
  9. TcpIpJoiner tcpIpJoiner = (TcpIpJoiner) joiner;
  10. final Address endpoint = getCallerAddress();
  11. final Address masterAddress = clusterService.getMasterAddress();
  12. approvedAsMaster = !tcpIpJoiner.isClaimingMastership() && !clusterService.isMaster()
  13. && (masterAddress == null || masterAddress.equals(endpoint));
  14. } else {
  15. approvedAsMaster = false;
  16. logger.warning("This node requires MulticastJoin strategy!");
  17. }
  18. if (logger.isFineEnabled()) {
  19. logger.fine("Sending '" + approvedAsMaster + "' for master claim of node: " + getCallerAddress());
  20. }
  21. }

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

  1. @Override
  2. public void run() {
  3. NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
  4. Connection connection = getConnection();
  5. String message = "Node could not join cluster at node: " + connection.getEndPoint()
  6. + " Cause: the target cluster has a different group-name";
  7. connection.close(message, null);
  8. ILogger logger = nodeEngine.getLogger("com.hazelcast.cluster");
  9. logger.warning(message);
  10. Node node = nodeEngine.getNode();
  11. node.getJoiner().blacklist(getCallerAddress(), true);
  12. }

相关文章