boolean setInitialized() { if (!initialized) { initialized = true; node.getNodeExtension().onPartitionStateChange(); return true; } return false; }
boolean setInitialized() { if (!initialized) { initialized = true; node.getNodeExtension().onPartitionStateChange(); return true; } return false; }
int replaceAddress(Address oldAddress, Address newAddress) { if (!initialized) { return 0; } int count = 0; for (InternalPartitionImpl partition : partitions) { if (partition.replaceAddress(oldAddress, newAddress) > -1) { count++; } } if (count > 0) { node.getNodeExtension().onPartitionStateChange(); logger.info("Replaced " + oldAddress + " with " + newAddress + " in partition table in " + count + " partitions."); } return count; }
int replaceMember(Member oldMember, Member newMember) { if (!initialized) { return 0; } PartitionReplica oldReplica = PartitionReplica.from(oldMember); PartitionReplica newReplica = PartitionReplica.from(newMember); int count = 0; for (InternalPartitionImpl partition : partitions) { if (partition.replaceReplica(oldReplica, newReplica) > -1) { count++; } } if (count > 0) { node.getNodeExtension().onPartitionStateChange(); logger.info("Replaced " + oldMember + " with " + newMember + " in partition table in " + count + " partitions."); } return count; }
} else if (partitionStateManager.isInitialized()) { partitionStateManager.incrementVersion(); node.getNodeExtension().onPartitionStateChange();
} else if (partitionStateManager.isInitialized()) { partitionStateManager.incrementVersion(); node.getNodeExtension().onPartitionStateChange();
node.getNodeExtension().onPartitionStateChange();
int delta = PARTITION_STATE_VERSION_INCREMENT_DELTA_ON_MIGRATION_FAILURE; partitionService.getPartitionStateManager().incrementVersion(delta); node.getNodeExtension().onPartitionStateChange(); triggerRepartitioningAfterMigrationFailure(); } finally {
int delta = PARTITION_STATE_VERSION_INCREMENT_DELTA_ON_MIGRATION_FAILURE; partitionService.getPartitionStateManager().incrementVersion(delta); node.getNodeExtension().onPartitionStateChange();
node.getNodeExtension().onPartitionStateChange();
node.getNodeExtension().onPartitionStateChange(); } finally { partitionServiceLock.unlock();
/** * Updates all partitions and version, updates (adds and retains) the completed migrations and finalizes the active * migration if it is equal to any completed. * * @see MigrationManager#scheduleActiveMigrationFinalization(MigrationInfo) */ private void updatePartitionsAndFinalizeMigrations(PartitionRuntimeState partitionState) { final Address[][] partitionTable = partitionState.getPartitionTable(); updateAllPartitions(partitionTable); partitionStateManager.setVersion(partitionState.getVersion()); Collection<MigrationInfo> completedMigrations = partitionState.getCompletedMigrations(); for (MigrationInfo completedMigration : completedMigrations) { assert completedMigration.getStatus() == MigrationStatus.SUCCESS || completedMigration.getStatus() == MigrationStatus.FAILED : "Invalid migration: " + completedMigration; if (migrationManager.addCompletedMigration(completedMigration)) { migrationManager.scheduleActiveMigrationFinalization(completedMigration); } } if (!partitionStateManager.setInitialized()) { node.getNodeExtension().onPartitionStateChange(); } migrationManager.retainCompletedMigrations(completedMigrations); }