Example #1
0
 private void clearPartitionData(final int partitionId) {
   final PartitionContainer container = partitionContainers[partitionId];
   if (container != null) {
     for (RecordStore mapPartition : container.getMaps().values()) {
       mapPartition.clearPartition();
     }
     container.getMaps().clear();
   }
 }
Example #2
0
 private void migrateIndex(PartitionMigrationEvent event) {
   final PartitionContainer container = partitionContainers[event.getPartitionId()];
   for (RecordStore recordStore : container.getMaps().values()) {
     final MapContainer mapContainer = getMapContainer(recordStore.getName());
     final IndexService indexService = mapContainer.getIndexService();
     if (indexService.hasIndex()) {
       for (Record record : recordStore.getReadonlyRecordMap().values()) {
         if (event.getMigrationEndpoint() == MigrationEndpoint.SOURCE) {
           indexService.removeEntryIndex(record.getKey());
         } else {
           Object value = record.getValue();
           if (value != null) {
             indexService.saveEntryIndex(
                 new QueryEntry(
                     getSerializationService(), record.getKey(), record.getKey(), value));
           }
         }
       }
     }
   }
 }