public void run() throws Exception {
MapService mapService = getService();
MapContainer mapContainer = mapService.getMapContainer(name);
RecordStore rs = mapService.getPartitionContainer(getPartitionId()).getRecordStore(name);
Map<Data, Record> records = rs.getReadonlyRecordMap();
IndexService indexService = mapContainer.getIndexService();
SerializationService ss = getNodeEngine().getSerializationService();
Index index = indexService.addOrGetIndex(attributeName, ordered);
for (Record record : records.values()) {
Data key = record.getKey();
Object value = record.getValue();
index.saveEntryIndex(new QueryEntry(ss, key, key, value));
}