public void run() {
   int partitionId = getPartitionId();
   recordStore = mapService.getMapServiceContext().getRecordStore(partitionId, name);
   for (int i = 0; i < entries.size(); i++) {
     final RecordInfo recordInfo = recordInfos.get(i);
     final Map.Entry<Data, Data> entry = entries.get(i);
     final Record record = recordStore.putBackup(entry.getKey(), entry.getValue());
     Records.applyRecordInfo(record, recordInfo);
   }
 }
Example #2
0
  @Override
  public void run() throws Exception {
    Indexes indexes = mapContainer.getIndexes();
    Index index = indexes.addOrGetIndex(attributeName, ordered);

    final long now = getNow();
    final Iterator<Record> iterator = recordStore.iterator(now, false);
    SerializationService serializationService = getNodeEngine().getSerializationService();
    while (iterator.hasNext()) {
      final Record record = iterator.next();
      Data key = record.getKey();
      Object value = Records.getValueOrCachedValue(record, serializationService);
      QueryableEntry queryEntry = mapContainer.newQueryEntry(key, value);
      index.saveEntryIndex(queryEntry, null);
    }
  }