예제 #1
0
 private long getDelay(EntryTaskScheduler entryTaskScheduler, Data key, int extraDelay) {
   if (entryTaskScheduler != null) {
     final ScheduledEntry entry = entryTaskScheduler.get(key);
     if (entry != null) {
       return extraDelay + findDelayMillis(entry);
     }
   }
   return -1;
 }
예제 #2
0
 private void flush(Data key) {
   checkIfLoaded();
   EntryTaskScheduler writeScheduler = mapContainer.getMapStoreScheduler();
   Set<Data> keys = new HashSet<Data>(1);
   keys.add(key);
   if (writeScheduler != null) {
     Set<Data> processedKeys = writeScheduler.flush(keys);
     for (Data pkey : processedKeys) {
       records.get(pkey).onStore();
     }
   }
   EntryTaskScheduler deleteScheduler = mapContainer.getMapStoreScheduler();
   if (deleteScheduler != null) {
     if (toBeRemovedKeys.contains(key)) {
       deleteScheduler.flush(keys);
       toBeRemovedKeys.remove(key);
     }
   }
 }
예제 #3
0
 public void flush() {
   checkIfLoaded();
   Set<Data> keys = new HashSet<Data>();
   for (Record record : records.values()) {
     keys.add(record.getKey());
   }
   EntryTaskScheduler writeScheduler = mapContainer.getMapStoreScheduler();
   if (writeScheduler != null) {
     Set<Data> processedKeys = writeScheduler.flush(keys);
     for (Data key : processedKeys) {
       records.get(key).onStore();
     }
   }
   EntryTaskScheduler deleteScheduler = mapContainer.getMapStoreScheduler();
   if (deleteScheduler != null) {
     deleteScheduler.flush(toBeRemovedKeys);
     toBeRemovedKeys.clear();
   }
 }
예제 #4
0
 public void clear() {
   locks.clear();
   entryTaskScheduler.cancelAll();
 }
예제 #5
0
 void cancelEviction(Data key) {
   entryTaskScheduler.cancel(key);
 }
예제 #6
0
 void scheduleEviction(Data key, int version, long leaseTime) {
   entryTaskScheduler.schedule(leaseTime, key, version);
 }