public MapPartitionDestroyOperation(PartitionContainer container, MapContainer mapContainer) { this.partitionContainer = container; this.mapContainer = mapContainer; setPartitionId(partitionContainer.getPartitionId()); }
public MapPartitionDestroyOperation(PartitionContainer container, MapContainer mapContainer) { this.partitionContainer = container; this.mapContainer = mapContainer; setPartitionId(partitionContainer.getPartitionId()); }
void prepare(PartitionContainer container, Collection<ServiceNamespace> namespaces, int replicaIndex) { MapService mapService = container.getMapService(); MetaDataGenerator metaData = getPartitionMetaDataGenerator(mapService); int partitionId = container.getPartitionId(); partitionUuid = metaData.getOrCreateUuid(partitionId); for (ServiceNamespace namespace : namespaces) { if (mapNameSequencePairs == emptyList()) { mapNameSequencePairs = new ArrayList(namespaces.size()); } ObjectNamespace mapNamespace = (ObjectNamespace) namespace; String mapName = mapNamespace.getObjectName(); mapNameSequencePairs.add(mapName); mapNameSequencePairs.add(metaData.currentSequence(mapName, partitionId)); } }
void prepare(PartitionContainer container, Collection<ServiceNamespace> namespaces, int replicaIndex) { MapService mapService = container.getMapService(); MetaDataGenerator metaData = getPartitionMetaDataGenerator(mapService); int partitionId = container.getPartitionId(); partitionUuid = metaData.getOrCreateUuid(partitionId); for (ServiceNamespace namespace : namespaces) { if (mapNameSequencePairs == emptyList()) { mapNameSequencePairs = new ArrayList(namespaces.size()); } ObjectNamespace mapNamespace = (ObjectNamespace) namespace; String mapName = mapNamespace.getObjectName(); mapNameSequencePairs.add(mapName); mapNameSequencePairs.add(metaData.currentSequence(mapName, partitionId)); } }
/** * Removes all record stores from all partitions. * * Calls {@link #removeRecordStoresFromPartitionMatchingWith} internally and * * @param onShutdown {@code true} if this method is called during map service shutdown, * otherwise set {@code false} * @param onRecordStoreDestroy {@code true} if this method is called during to destroy record store, * otherwise set {@code false} */ protected void removeAllRecordStoresOfAllMaps(boolean onShutdown, boolean onRecordStoreDestroy) { for (PartitionContainer partitionContainer : partitionContainers) { if (partitionContainer != null) { removeRecordStoresFromPartitionMatchingWith(allRecordStores(), partitionContainer.getPartitionId(), onShutdown, onRecordStoreDestroy); } } }
/** * Removes all record stores from all partitions. * * Calls {@link #removeRecordStoresFromPartitionMatchingWith} internally and * * @param onShutdown {@code true} if this method is called during map service shutdown, * otherwise set {@code false} * @param onRecordStoreDestroy {@code true} if this method is called during to destroy record store, * otherwise set {@code false} */ protected void removeAllRecordStoresOfAllMaps(boolean onShutdown, boolean onRecordStoreDestroy) { for (PartitionContainer partitionContainer : partitionContainers) { if (partitionContainer != null) { removeRecordStoresFromPartitionMatchingWith(allRecordStores(), partitionContainer.getPartitionId(), onShutdown, onRecordStoreDestroy); } } }
final Indexes indexes = mapContainer.getIndexes(container.getPartitionId()); if (indexes != null && indexes.hasIndex()) { for (Index index : indexes.getIndexes()) {
final Indexes indexes = mapContainer.getIndexes(container.getPartitionId()); if (indexes != null && indexes.haveAtLeastOneIndex()) { for (Index index : indexes.getIndexes()) {
continue; IPartition partition = partitionService.getPartition(partitionContainer.getPartitionId(), false); if (partition.isLocal()) { addPrimaryStatsOf(recordStore, getOrCreateOnDemandStats(statsPerMap, recordStore));
private void updateMapOnDemandStats(String mapName, LocalMapOnDemandCalculatedStats onDemandStats) { PartitionContainer[] partitionContainers = mapServiceContext.getPartitionContainers(); for (PartitionContainer partitionContainer : partitionContainers) { IPartition partition = partitionService.getPartition(partitionContainer.getPartitionId()); if (partition.isLocal()) { addPrimaryStatsOf(partitionContainer.getExistingRecordStore(mapName), onDemandStats); } else { addReplicaStatsOf(partitionContainer.getExistingRecordStore(mapName), onDemandStats); } } addStructureStats(mapName, onDemandStats); }
continue; IPartition partition = partitionService.getPartition(partitionContainer.getPartitionId(), false); if (partition.isLocal()) { addPrimaryStatsOf(recordStore, getOrCreateOnDemandStats(statsPerMap, recordStore));
private void updateMapOnDemandStats(String mapName, LocalMapOnDemandCalculatedStats onDemandStats) { PartitionContainer[] partitionContainers = mapServiceContext.getPartitionContainers(); for (PartitionContainer partitionContainer : partitionContainers) { IPartition partition = partitionService.getPartition(partitionContainer.getPartitionId()); if (partition.isLocal()) { addPrimaryStatsOf(partitionContainer.getExistingRecordStore(mapName), onDemandStats); } else { addReplicaStatsOf(partitionContainer.getExistingRecordStore(mapName), onDemandStats); } } addStructureStats(mapName, onDemandStats); }
@Override protected Operation newPrimaryExpiryOp(int expirationPercentage, PartitionContainer container) { int partitionId = container.getPartitionId(); return new ClearExpiredOperation(expirationPercentage) .setNodeEngine(nodeEngine) .setCallerUuid(nodeEngine.getLocalMember().getUuid()) .setPartitionId(partitionId) .setValidateTarget(false) .setServiceName(SERVICE_NAME); }
@Override protected Operation newPrimaryExpiryOp(int expirationPercentage, PartitionContainer container) { int partitionId = container.getPartitionId(); return new ClearExpiredOperation(expirationPercentage) .setNodeEngine(nodeEngine) .setCallerUuid(nodeEngine.getLocalMember().getUuid()) .setPartitionId(partitionId) .setValidateTarget(false) .setServiceName(SERVICE_NAME); }
public void addMapIndex(MapServiceContext mapServiceContext, MapContainer mapContainer) { // RU_COMPAT_3_9 can be removed in 3.11 if (mapContainer.isGlobalIndexEnabled()) { // GLOBAL-INDEX MapIndexInfo mapIndexInfo = new MapIndexInfo(mapContainer.getName()); for (Index index : mapContainer.getIndexes().getIndexes()) { mapIndexInfo.addIndexInfo(index.getAttributeName(), index.isOrdered()); } indexInfoList.add(mapIndexInfo); } else { // PARTITIONED-INDEX // in case of partitioned-index we gather all index infos in a set, since all partition should have the // same set of partitions. In theory it would be sufficient to gather data from only one partition, but // gathering data from all of them does no harm. Set<IndexInfo> indexInfos = new HashSet<IndexInfo>(); for (PartitionContainer partitionContainer : mapServiceContext.getPartitionContainers()) { final Indexes indexes = mapContainer.getIndexes(partitionContainer.getPartitionId()); if (indexes != null && indexes.hasIndex()) { for (Index index : indexes.getIndexes()) { indexInfos.add(new IndexInfo(index.getAttributeName(), index.isOrdered())); } } } indexInfos.addAll(mapContainer.getPartitionIndexesToAdd()); MapIndexInfo mapIndexInfo = new MapIndexInfo(mapContainer.getName()); mapIndexInfo.addIndexInfos(indexInfos); indexInfoList.add(mapIndexInfo); } }
.getPartitionContainer(operation.getPartitionId()); for (Map.Entry<String, Boolean> indexDefinition : mapContainer.getIndexDefinitions().entrySet()) { Indexes indexes = mapContainer.getIndexes(partitionContainer.getPartitionId()); indexes.addOrGetIndex(indexDefinition.getKey(), indexDefinition.getValue()); final Indexes indexes = mapContainer.getIndexes(partitionContainer.getPartitionId()); final SerializationService serializationService = mapContainer.getMapServiceContext().getNodeEngine() .getSerializationService(); Indexes.markPartitionAsIndexed(partitionContainer.getPartitionId(), indexesSnapshot);
.getPartitionContainer(operation.getPartitionId()); for (Map.Entry<String, Boolean> indexDefinition : mapContainer.getIndexDefinitions().entrySet()) { Indexes indexes = mapContainer.getIndexes(partitionContainer.getPartitionId()); indexes.addOrGetIndex(indexDefinition.getKey(), indexDefinition.getValue()); final Indexes indexes = mapContainer.getIndexes(partitionContainer.getPartitionId()); final SerializationService serializationService = mapContainer.getMapServiceContext().getNodeEngine() .getSerializationService();
PartitionContainer[] partitionContainers = mapServiceContext.getPartitionContainers(); for (PartitionContainer partitionContainer : partitionContainers) { IPartition partition = partitionService.getPartition(partitionContainer.getPartitionId()); if (!partition.isLocal()) { continue;
PartitionContainer[] partitionContainers = mapServiceContext.getPartitionContainers(); for (PartitionContainer partitionContainer : partitionContainers) { IPartition partition = partitionService.getPartition(partitionContainer.getPartitionId()); if (!partition.isLocal()) { continue;