Пример #1
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);
     }
   }
 }
Пример #2
0
  public void applyRecordInfo(Record record, String mapName, RecordInfo replicationInfo) {
    record.setStatistics(replicationInfo.getStatistics());
    record.setVersion(replicationInfo.getVersion());

    if (replicationInfo.getIdleDelayMillis() >= 0) {
      scheduleIdleEviction(mapName, record.getKey(), replicationInfo.getIdleDelayMillis());
    }
    if (replicationInfo.getTtlDelayMillis() >= 0) {
      scheduleTtlEviction(mapName, record, replicationInfo.getTtlDelayMillis());
    }
    if (replicationInfo.getMapStoreWriteDelayMillis() >= 0) {
      scheduleMapStoreWrite(
          mapName,
          record.getKey(),
          record.getValue(),
          replicationInfo.getMapStoreWriteDelayMillis());
    }
    if (replicationInfo.getMapStoreDeleteDelayMillis() >= 0) {
      scheduleMapStoreDelete(
          mapName, record.getKey(), replicationInfo.getMapStoreDeleteDelayMillis());
    }
  }