void applyState() { for (Map.Entry<String, List<DelayedEntry>> entry : delayedEntries.entrySet()) { String mapName = entry.getKey(); RecordStore recordStore = mapReplicationOperation.getRecordStore(mapName); WriteBehindStore mapDataStore = (WriteBehindStore) recordStore.getMapDataStore(); mapDataStore.reset(); mapDataStore.setFlushSequences(flushSequences.get(mapName)); Collection<DelayedEntry> replicatedEntries = entry.getValue(); for (DelayedEntry delayedEntry : replicatedEntries) { mapDataStore.add(delayedEntry); mapDataStore.setSequence(delayedEntry.getSequence()); } } }
void applyState() { for (Map.Entry<String, List<DelayedEntry>> entry : delayedEntries.entrySet()) { String mapName = entry.getKey(); RecordStore recordStore = mapReplicationOperation.getRecordStore(mapName); WriteBehindStore mapDataStore = (WriteBehindStore) recordStore.getMapDataStore(); mapDataStore.reset(); mapDataStore.setFlushSequences(flushSequences.get(mapName)); Collection<DelayedEntry> replicatedEntries = entry.getValue(); for (DelayedEntry delayedEntry : replicatedEntries) { mapDataStore.add(delayedEntry); mapDataStore.setSequence(delayedEntry.getSequence()); } } }
private void applyIndexesState() { if (mapIndexInfos != null) { for (MapIndexInfo mapIndexInfo : mapIndexInfos) { addIndexes(mapIndexInfo.getMapName(), mapIndexInfo.getIndexInfos()); } } // RU_COMPAT_3_9 // Old nodes (3.9-) won't send mapIndexInfos to new nodes (3.9+) in the map-replication operation. // This is the reason why we pick up the mapContainer.getIndexesToAdd() that were added by the PostJoinMapOperation // and we add them to the map, before we add data for (String mapName : data.keySet()) { RecordStore recordStore = operation.getRecordStore(mapName); MapContainer mapContainer = recordStore.getMapContainer(); addIndexes(mapName, mapContainer.getPartitionIndexesToAdd()); } }
Collection<RecordReplicationInfo> recordReplicationInfos = dataEntry.getValue(); final String mapName = dataEntry.getKey(); RecordStore recordStore = operation.getRecordStore(mapName); recordStore.reset(); recordStore.setPreMigrationLoadedStatus(loaded.get(mapName));
Collection<RecordReplicationInfo> recordReplicationInfos = dataEntry.getValue(); final String mapName = dataEntry.getKey(); RecordStore recordStore = operation.getRecordStore(mapName); recordStore.reset(); recordStore.setPreMigrationLoadedStatus(loaded.get(mapName));
private void addIndexes(String mapName, Collection<IndexInfo> indexInfos) { if (indexInfos == null) { return; } RecordStore recordStore = operation.getRecordStore(mapName); MapContainer mapContainer = recordStore.getMapContainer(); if (mapContainer.isGlobalIndexEnabled()) { // creating global indexes on partition thread in case they do not exist for (IndexInfo indexInfo : indexInfos) { Indexes indexes = mapContainer.getIndexes(); // optimisation not to synchronize each partition thread on the addOrGetIndex method if (indexes.getIndex(indexInfo.getAttributeName()) == null) { indexes.addOrGetIndex(indexInfo.getAttributeName(), indexInfo.isOrdered()); } } } else { Indexes indexes = mapContainer.getIndexes(operation.getPartitionId()); for (IndexInfo indexInfo : indexInfos) { indexes.addOrGetIndex(indexInfo.getAttributeName(), indexInfo.isOrdered()); } } }
private void addIndexes(String mapName, Collection<IndexInfo> indexInfos) { if (indexInfos == null) { return; } RecordStore recordStore = operation.getRecordStore(mapName); MapContainer mapContainer = recordStore.getMapContainer(); if (mapContainer.isGlobalIndexEnabled()) { // creating global indexes on partition thread in case they do not exist for (IndexInfo indexInfo : indexInfos) { Indexes indexes = mapContainer.getIndexes(); // optimisation not to synchronize each partition thread on the addOrGetIndex method if (indexes.getIndex(indexInfo.getName()) == null) { indexes.addOrGetIndex(indexInfo.getName(), indexInfo.isOrdered()); } } } else { Indexes indexes = mapContainer.getIndexes(operation.getPartitionId()); for (IndexInfo indexInfo : indexInfos) { indexes.addOrGetIndex(indexInfo.getName(), indexInfo.isOrdered()); } } }