use of com.hazelcast.map.impl.querycache.publisher.PublisherContext in project hazelcast by hazelcast.
the class AccumulatorConsumerOperation method removeAccumulator.
private void removeAccumulator(QueryCacheContext context, Accumulator accumulator) {
PublisherContext publisherContext = context.getPublisherContext();
MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
AccumulatorInfo info = accumulator.getInfo();
String mapName = info.getMapName();
String cacheName = info.getCacheName();
PublisherRegistry publisherRegistry = mapPublisherRegistry.getOrNull(mapName);
if (publisherRegistry == null) {
return;
}
PartitionAccumulatorRegistry partitionAccumulatorRegistry = publisherRegistry.getOrNull(cacheName);
if (partitionAccumulatorRegistry == null) {
return;
}
partitionAccumulatorRegistry.remove(getPartitionId());
}
use of com.hazelcast.map.impl.querycache.publisher.PublisherContext in project hazelcast by hazelcast.
the class MapMigrationAwareService method commitMigration.
@Override
public void commitMigration(PartitionMigrationEvent event) {
migrateIndex(event);
if (SOURCE == event.getMigrationEndpoint()) {
clearMapsHavingLesserBackupCountThan(event.getPartitionId(), event.getNewReplicaIndex());
getMetaDataGenerator().removeUuidAndSequence(event.getPartitionId());
} else if (DESTINATION == event.getMigrationEndpoint()) {
if (event.getNewReplicaIndex() != 0) {
getMetaDataGenerator().regenerateUuid(event.getPartitionId());
}
}
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();
QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
PublisherContext publisherContext = queryCacheContext.getPublisherContext();
if (event.getMigrationEndpoint() == MigrationEndpoint.SOURCE) {
int partitionId = event.getPartitionId();
flushAccumulator(publisherContext, partitionId);
removeAccumulator(publisherContext, partitionId);
}
}
Aggregations