Exemplo n.º 1
0
 private Object writeMapStore(Data dataKey, Object recordValue, Record record) {
   final MapStoreWrapper store = mapContainer.getStore();
   if (store != null) {
     if (mapContainer.getWriteDelayMillis() <= 0) {
       Object objectValue = mapService.toObject(recordValue);
       store.store(mapService.toObject(dataKey), objectValue);
       if (record != null) {
         record.onStore();
       }
       // if store is not a post-processing map-store, then avoid extra de-serialization phase.
       return store.isPostProcessingMapStore() ? objectValue : recordValue;
     } else {
       mapService.scheduleMapStoreWrite(
           name, dataKey, recordValue, mapContainer.getWriteDelayMillis());
     }
   }
   return recordValue;
 }
Exemplo n.º 2
0
 private void mapStoreDelete(Record record, Data key) {
   final MapStoreWrapper store = mapContainer.getStore();
   if (store != null) {
     long writeDelayMillis = mapContainer.getWriteDelayMillis();
     if (writeDelayMillis == 0) {
       store.delete(mapService.toObject(key));
       // todo ea record will be deleted then why calling onStore
       if (record != null) {
         record.onStore();
       }
     } else {
       mapService.scheduleMapStoreDelete(name, key, writeDelayMillis);
       toBeRemovedKeys.add(key);
     }
   }
 }