@Override public void beforeMigration(PartitionMigrationEvent event) { if (isLocalPromotion(event)) { // It's a local partition promotion. We need to populate non-global indexes here since // there is no map replication performed in this case. Global indexes are populated // during promotion finalization phase. // 1. Defensively clear possible stale leftovers from the previous failed promotion attempt. clearNonGlobalIndexes(event); // 2. Populate non-global partitioned indexes. populateIndexes(event, TargetIndexes.NON_GLOBAL); } flushAndRemoveQueryCaches(event); }
@Override public void beforeMigration(PartitionMigrationEvent event) { if (isLocalPromotion(event)) { // It's a local partition promotion. We need to populate non-global indexes here since // there is no map replication performed in this case. Global indexes are populated // during promotion finalization phase. // 1. Defensively clear possible stale leftovers from the previous failed promotion attempt. clearNonGlobalIndexes(event); // 2. Populate non-global partitioned indexes. populateIndexes(event, TargetIndexes.NON_GLOBAL); } flushAndRemoveQueryCaches(event); }
@Override public void commitMigration(PartitionMigrationEvent event) { if (event.getMigrationEndpoint() == DESTINATION) { populateIndexes(event, TargetIndexes.GLOBAL); } else { depopulateIndexes(event); } if (SOURCE == event.getMigrationEndpoint()) { removeRecordStoresHavingLesserBackupCountThan(event.getPartitionId(), event.getNewReplicaIndex()); } PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(event.getPartitionId()); for (RecordStore recordStore : partitionContainer.getAllRecordStores()) { // in case the record store has been created without loading during migration trigger again // if loading has been already started this call will do nothing recordStore.startLoading(); } mapServiceContext.reloadOwnedPartitions(); removeOrRegenerateNearCacheUuid(event); }
@Override public void commitMigration(PartitionMigrationEvent event) { if (event.getMigrationEndpoint() == DESTINATION) { populateIndexes(event, TargetIndexes.GLOBAL); } else { depopulateIndexes(event); } if (SOURCE == event.getMigrationEndpoint()) { removeRecordStoresHavingLesserBackupCountThan(event.getPartitionId(), event.getNewReplicaIndex()); } PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(event.getPartitionId()); for (RecordStore recordStore : partitionContainer.getAllRecordStores()) { // in case the record store has been created without loading during migration trigger again // if loading has been already started this call will do nothing recordStore.startLoading(); } mapServiceContext.reloadOwnedPartitions(); removeOrRegenerateNearCacheUuid(event); }