use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberMapTest method create_failsWithDuplicateAddress.
@Test(expected = IllegalArgumentException.class)
public void create_failsWithDuplicateAddress() {
MemberImpl member1 = newMember(5000);
MemberImpl member2 = newMember(5000);
MemberMap.createNew(member1, member2);
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberMapTest method cloneAdding_failsWithDuplicateUuid.
@Test(expected = IllegalArgumentException.class)
public void cloneAdding_failsWithDuplicateUuid() {
MemberImpl[] members = new MemberImpl[3];
for (int i = 0; i < members.length; i++) {
members[i] = newMember(5000 + i);
}
MemberImpl member = new MemberImpl(newAddress(6000), VERSION, false, members[1].getUuid(), null);
MemberMap.cloneAdding(MemberMap.createNew(members), member);
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberLeftException method readObject.
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
String uuid = in.readUTF();
String host = in.readUTF();
int port = in.readInt();
boolean liteMember = in.readBoolean();
MemberVersion version = (MemberVersion) in.readObject();
member = new MemberImpl(new Address(host, port), version, false, uuid, null, null, liteMember);
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class PartitionStateManager method removeUnknownAddresses.
void removeUnknownAddresses() {
ClusterServiceImpl clusterService = node.getClusterService();
for (InternalPartitionImpl partition : partitions) {
for (int i = 0; i < InternalPartition.MAX_REPLICA_COUNT; i++) {
Address address = partition.getReplicaAddress(i);
if (address == null) {
continue;
}
MemberImpl member = clusterService.getMember(address);
if (member == null) {
partition.setReplicaAddress(i, null);
if (logger.isFinestEnabled()) {
logger.finest("PartitionId=" + partition.getPartitionId() + " " + address + " is removed from replica index: " + i + ", partition: " + partition);
}
}
}
}
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class PartitionEventManager method sendMigrationEvent.
void sendMigrationEvent(final MigrationInfo migrationInfo, final MigrationEvent.MigrationStatus status) {
if (migrationInfo.getSourceCurrentReplicaIndex() != 0 && migrationInfo.getDestinationNewReplicaIndex() != 0) {
// only fire events for 0th replica migrations
return;
}
ClusterServiceImpl clusterService = node.getClusterService();
MemberImpl current = clusterService.getMember(migrationInfo.getSource());
MemberImpl newOwner = clusterService.getMember(migrationInfo.getDestination());
MigrationEvent event = new MigrationEvent(migrationInfo.getPartitionId(), current, newOwner, status);
EventService eventService = nodeEngine.getEventService();
Collection<EventRegistration> registrations = eventService.getRegistrations(SERVICE_NAME, MIGRATION_EVENT_TOPIC);
eventService.publishEvent(SERVICE_NAME, registrations, event, event.getPartitionId());
}
Aggregations