void addActiveMigration(MigrationInfo migrationInfo) {
lock.lock();
try {
int partitionId = migrationInfo.getPartitionId();
partitions[partitionId].setMigrating(true);
MigrationInfo currentMigrationInfo = activeMigrations.putIfAbsent(partitionId, migrationInfo);
if (currentMigrationInfo != null) {
boolean oldMaster = false;
MigrationInfo oldMigration;
MigrationInfo newMigration;
MemberImpl masterMember = getMasterMember();
String master = masterMember.getUuid();
if (!master.equals(currentMigrationInfo.getMasterUuid())) {
// master changed
oldMigration = currentMigrationInfo;