@Override public MemberImpl getLocalMember() { return node.getLocalMember(); }
@Override public MemberImpl getLocalMember() { return node.getLocalMember(); }
@Override public Member getLocalEndpoint() { return node.getLocalMember(); }
@Override public MemberImpl getLocalMember() { return node.getLocalMember(); }
@Override public Member getLocalEndpoint() { return node.getLocalMember(); }
@Override public MemberImpl getLocalMember() { return node.getLocalMember(); }
public boolean isLiteMember() { return getLocalMember().isLiteMember(); }
public boolean isLiteMember() { return getLocalMember().isLiteMember(); }
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); } }
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); } } }
public void reset() { Throwable cause = new LocalMemberResetException(node.getLocalMember() + " has reset."); invocationRegistry.reset(cause); }
public void reset() { Throwable cause = new LocalMemberResetException(node.getLocalMember() + " has reset."); invocationRegistry.reset(cause); }
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); } }
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(); }
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()); } }
/** * 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; }
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); }
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); }
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); }
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); }