示例#1
0
 private void saveIndex(Record record) {
   Data dataKey = record.getKey();
   final IndexService indexService = mapContainer.getIndexService();
   if (indexService.hasIndex()) {
     SerializationService ss = mapService.getSerializationService();
     QueryableEntry queryableEntry = new QueryEntry(ss, dataKey, dataKey, record.getValue());
     indexService.saveEntryIndex(queryableEntry);
   }
 }
示例#2
0
 public void clearPartition() {
   final LockService lockService =
       mapService.getNodeEngine().getSharedService(LockService.SERVICE_NAME);
   if (lockService != null) {
     lockService.clearLockStore(
         partitionId, new DefaultObjectNamespace(MapService.SERVICE_NAME, name));
   }
   final IndexService indexService = mapContainer.getIndexService();
   if (indexService.hasIndex()) {
     for (Data key : records.keySet()) {
       indexService.removeEntryIndex(key);
     }
   }
   cancelAssociatedSchedulers(records.keySet());
   clearRecordsMap(Collections.<Data, Record>emptyMap());
   resetSizeEstimator();
   resetAccessSequenceNumber();
 }
示例#3
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));
           }
         }
       }
     }
   }
 }
示例#4
0
 private void removeIndex(Data key) {
   final IndexService indexService = mapContainer.getIndexService();
   if (indexService.hasIndex()) {
     indexService.removeEntryIndex(key);
   }
 }