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

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

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

Node.getLocalMember介绍

暂无

代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

public boolean isLiteMember() {
  return getLocalMember().isLiteMember();
}

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

public boolean isLiteMember() {
  return getLocalMember().isLiteMember();
}

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

void reset() {
  initialized = false;
  stateVersion.set(0);
  // local member uuid changes during ClusterService reset
  PartitionReplica localReplica = PartitionReplica.from(node.getLocalMember());
  for (InternalPartitionImpl partition : partitions) {
    partition.reset(localReplica);
  }
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

private static void closeConnectionBetween(HazelcastInstance h1, HazelcastInstance h2) {
    if (h1 == null || h2 == null) {
      return;
    }
    Node n1 = getNode(h1);
    Node n2 = getNode(h2);
    if (n1 != null && n2 != null) {
      n1.clusterService.suspectMember(n2.getLocalMember(), null, true);
      n2.clusterService.suspectMember(n1.getLocalMember(), null, true);
    }
  }
}

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

public void reset() {
  Throwable cause = new LocalMemberResetException(node.getLocalMember() + " has reset.");
  invocationRegistry.reset(cause);
}

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

public void reset() {
  Throwable cause = new LocalMemberResetException(node.getLocalMember() + " has reset.");
  invocationRegistry.reset(cause);
}

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

private void logMigrationCommitFailure(MigrationInfo migration, Throwable t) {
  boolean memberLeft = t instanceof MemberLeftException
        || t.getCause() instanceof TargetNotMemberException
        || t.getCause() instanceof HazelcastInstanceNotActiveException;
  PartitionReplica destination = migration.getDestination();
  if (memberLeft) {
    if (destination.isIdentical(node.getLocalMember())) {
      logger.fine("Migration commit failed for " + migration
          + " since this node is shutting down.");
      return;
    }
    logger.warning("Migration commit failed for " + migration
          + " since destination " + destination + " left the cluster");
  } else {
    logger.severe("Migration commit to " + destination + " failed for " + migration, t);
  }
}

代码示例来源: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

private void ensureNoPartitionProblems(Operation op) {
  int partitionId = op.getPartitionId();
  if (partitionId < 0) {
    return;
  }
  if (partitionId != getPartitionId()) {
    throw new IllegalStateException("wrong partition, expected: " + getPartitionId() + " but found:" + partitionId);
  }
  if (internalPartition == null) {
    internalPartition = nodeEngine.getPartitionService().getPartition(partitionId);
  }
  if (!isAllowedToRetryDuringMigration(op) && internalPartition.isMigrating()) {
    throw new PartitionMigratingException(thisAddress, partitionId,
        op.getClass().getName(), op.getServiceName());
  }
  PartitionReplica owner = internalPartition.getReplica(op.getReplicaIndex());
  if (op.validatesTarget() && (owner == null || !owner.isIdentical(node.getLocalMember()))) {
    Member target = owner != null ? node.getClusterService().getMember(owner.address(), owner.uuid()) : null;
    throw new WrongTargetException(node.getLocalMember(), target, partitionId, op.getReplicaIndex(),
        op.getClass().getName(), op.getServiceName());
  }
}

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

/**
 * Sends promotions to the destination and commits the {@code migrations} if successful. Called on the master node.
 *
 * @param destination the promotion destination
 * @param migrations  the promotion migrations
 * @return if the promotions were successful
 */
private boolean commitPromotionMigrations(PartitionReplica destination, Collection<MigrationInfo> migrations) {
  internalMigrationListener.onPromotionStart(MigrationParticipant.MASTER, migrations);
  boolean success = commitPromotionsToDestination(destination, migrations);
  boolean local = destination.isIdentical(node.getLocalMember());
  if (!local) {
    processPromotionCommitResult(destination, migrations, success);
  }
  internalMigrationListener.onPromotionComplete(MigrationParticipant.MASTER, migrations, success);
  partitionService.publishPartitionRuntimeState();
  return success;
}

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

public JoinRequest createJoinRequest(boolean withCredentials) {
  final Credentials credentials = (withCredentials && securityContext != null)
      ? securityContext.getCredentialsFactory().newCredentials() : null;
  final Set<String> excludedMemberUuids = nodeExtension.getInternalHotRestartService().getExcludedMemberUuids();
  MemberImpl localMember = getLocalMember();
  return new JoinRequest(Packet.VERSION, buildInfo.getBuildNumber(), version, address,
      localMember.getUuid(), localMember.isLiteMember(), createConfigCheck(), credentials,
      localMember.getAttributes(), excludedMemberUuids);
}

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

public JoinRequest createJoinRequest(boolean withCredentials) {
  final Credentials credentials = (withCredentials && securityContext != null)
      ? securityContext.getCredentialsFactory().newCredentials() : null;
  final Set<String> excludedMemberUuids = nodeExtension.getInternalHotRestartService().getExcludedMemberUuids();
  MemberImpl localMember = getLocalMember();
  return new JoinRequest(Packet.VERSION, buildInfo.getBuildNumber(), version, address,
      localMember.getUuid(), localMember.isLiteMember(), createConfigCheck(), credentials,
      localMember.getAttributes(), excludedMemberUuids);
}

代码示例来源: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: com.hazelcast/hazelcast-all

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

相关文章

微信公众号

最新文章

更多