Esempio n. 1
0
 public Object getFromNearCache(String mapName, Data key) {
   if (!isNearCacheEnabled(mapName)) {
     return null;
   }
   NearCache nearCache = getNearCache(mapName);
   return nearCache.get(key);
 }
Esempio n. 2
0
 public void invalidateNearCache(String mapName, Set<Data> keys) {
   if (!isNearCacheEnabled(mapName)) {
     return;
   }
   NearCache nearCache = getNearCache(mapName);
   nearCache.invalidate(keys);
 }
Esempio n. 3
0
 public void putNearCache(String mapName, Data key, Data value) {
   if (!isNearCacheEnabled(mapName)) {
     return;
   }
   NearCache nearCache = getNearCache(mapName);
   nearCache.put(key, value);
 }
Esempio n. 4
0
 public void clearNearCache(String mapName) {
   if (!isNearCacheEnabled(mapName)) {
     return;
   }
   final NearCache nearCache = nearCacheMap.get(mapName);
   if (nearCache != null) {
     nearCache.clear();
   }
 }
Esempio n. 5
0
 public void reset() {
   final PartitionContainer[] containers = partitionContainers;
   for (PartitionContainer container : containers) {
     if (container != null) {
       container.clear();
     }
   }
   for (NearCache nearCache : nearCacheMap.values()) {
     nearCache.clear();
   }
 }
Esempio n. 6
0
 public void shutdown(boolean terminate) {
   if (!terminate) {
     flushMapsBeforeShutdown();
     destroyMapStores();
     final PartitionContainer[] containers = partitionContainers;
     for (PartitionContainer container : containers) {
       if (container != null) {
         container.clear();
       }
     }
     for (NearCache nearCache : nearCacheMap.values()) {
       nearCache.clear();
     }
     nearCacheMap.clear();
     mapContainers.clear();
   }
 }
Esempio n. 7
0
 public void destroyDistributedObject(String name) {
   MapContainer mapContainer = mapContainers.remove(name);
   if (mapContainer != null) {
     if (mapContainer.isNearCacheEnabled()) {
       NearCache nearCache = nearCacheMap.remove(name);
       if (nearCache != null) {
         nearCache.clear();
       }
     }
     mapContainer.shutDownMapStoreScheduledExecutor();
   }
   final PartitionContainer[] containers = partitionContainers;
   for (PartitionContainer container : containers) {
     if (container != null) {
       container.destroyMap(name);
     }
   }
   nodeEngine.getEventService().deregisterAllListeners(SERVICE_NAME, name);
 }