void applyState() { MapService mapService = mapReplicationOperation.getService(); MetaDataGenerator metaDataGenerator = getPartitionMetaDataGenerator(mapService); int partitionId = mapReplicationOperation.getPartitionId(); if (partitionUuid != null) { metaDataGenerator.setUuid(partitionId, partitionUuid); } for (int i = 0; i < mapNameSequencePairs.size(); ) { String mapName = (String) mapNameSequencePairs.get(i++); long sequence = (Long) mapNameSequencePairs.get(i++); metaDataGenerator.setCurrentSequence(mapName, partitionId, sequence); } }
void applyState() { MapService mapService = mapReplicationOperation.getService(); MetaDataGenerator metaDataGenerator = getPartitionMetaDataGenerator(mapService); int partitionId = mapReplicationOperation.getPartitionId(); if (partitionUuid != null) { metaDataGenerator.setUuid(partitionId, partitionUuid); } for (int i = 0; i < mapNameSequencePairs.size(); ) { String mapName = (String) mapNameSequencePairs.get(i++); long sequence = (Long) mapNameSequencePairs.get(i++); metaDataGenerator.setCurrentSequence(mapName, partitionId, sequence); } }
RecordStore getRecordStore(String mapName) { final boolean skipLoadingOnRecordStoreCreate = true; MapService mapService = getService(); MapServiceContext mapServiceContext = mapService.getMapServiceContext(); return mapServiceContext.getRecordStore(getPartitionId(), mapName, skipLoadingOnRecordStoreCreate); }
RecordStore getRecordStore(String mapName) { final boolean skipLoadingOnRecordStoreCreate = true; MapService mapService = getService(); MapServiceContext mapServiceContext = mapService.getMapServiceContext(); return mapServiceContext.getRecordStore(getPartitionId(), mapName, skipLoadingOnRecordStoreCreate); }
@Override public void writeData(ObjectDataOutput out) throws IOException { MapService mapService = mapReplicationOperation.getService(); MapServiceContext mapServiceContext = mapService.getMapServiceContext(); out.writeInt(delayedEntries.size()); for (Map.Entry<String, List<DelayedEntry>> entry : delayedEntries.entrySet()) { out.writeUTF(entry.getKey()); List<DelayedEntry> delayedEntryList = entry.getValue(); out.writeInt(delayedEntryList.size()); for (DelayedEntry e : delayedEntryList) { Data key = mapServiceContext.toData(e.getKey()); Data value = mapServiceContext.toData(e.getValue()); out.writeData(key); out.writeData(value); out.writeLong(e.getStoreTime()); out.writeInt(e.getPartitionId()); out.writeLong(e.getSequence()); } } out.writeInt(flushSequences.size()); for (Map.Entry<String, Queue<WriteBehindStore.Sequence>> entry : flushSequences.entrySet()) { out.writeUTF(entry.getKey()); Queue<WriteBehindStore.Sequence> queue = entry.getValue(); out.writeInt(queue.size()); for (WriteBehindStore.Sequence sequence : queue) { out.writeLong(sequence.getSequence()); out.writeBoolean(sequence.isFullFlush()); } } }
@Override public void writeData(ObjectDataOutput out) throws IOException { MapService mapService = mapReplicationOperation.getService(); MapServiceContext mapServiceContext = mapService.getMapServiceContext(); out.writeInt(delayedEntries.size()); for (Map.Entry<String, List<DelayedEntry>> entry : delayedEntries.entrySet()) { out.writeUTF(entry.getKey()); List<DelayedEntry> delayedEntryList = entry.getValue(); out.writeInt(delayedEntryList.size()); for (DelayedEntry e : delayedEntryList) { Data key = mapServiceContext.toData(e.getKey()); Data value = mapServiceContext.toData(e.getValue()); out.writeData(key); out.writeData(value); out.writeLong(e.getStoreTime()); out.writeInt(e.getPartitionId()); out.writeLong(e.getSequence()); } } out.writeInt(flushSequences.size()); for (Map.Entry<String, Queue<WriteBehindStore.Sequence>> entry : flushSequences.entrySet()) { out.writeUTF(entry.getKey()); Queue<WriteBehindStore.Sequence> queue = entry.getValue(); out.writeInt(queue.size()); for (WriteBehindStore.Sequence sequence : queue) { out.writeLong(sequence.getSequence()); out.writeBoolean(sequence.isFullFlush()); } } }