private boolean updateMapContainer(String mapName, MapConfig config) { final MapContainer container = getMapContainer(mapName); if (container == null) { return false; } container.setMapConfig(config); container.initEvictor(); return true; }
private boolean updateMapContainerIfAbsent(String mapName, MapConfig config) { final MapContainer container = getMapContainer(mapName); if (container == null || container.getMapConfig().getName().equals(config.getName())) { // container does not exist or is already configured return false; } container.setMapConfig(config); container.initEvictor(); return true; }
@Override public void run() throws Exception { MapService service = getService(); MapConfig oldConfig = service.getMapServiceContext().getMapContainer(mapName).getMapConfig(); MapConfig newConfig = new MapConfig(oldConfig); newConfig.setTimeToLiveSeconds(mapConfig.getTimeToLiveSeconds()); newConfig.setMaxIdleSeconds(mapConfig.getMaxIdleSeconds()); newConfig.setEvictionPolicy(mapConfig.getEvictionPolicy()); newConfig.setEvictionPercentage(mapConfig.getEvictionPercentage()); newConfig.setMinEvictionCheckMillis(mapConfig.getMinEvictionCheckMillis()); newConfig.setReadBackupData(mapConfig.isReadBackupData()); newConfig.setMaxSizeConfig(mapConfig.getMaxSizeConfig()); MapContainer mapContainer = service.getMapServiceContext().getMapContainer(mapName); mapContainer.setMapConfig(newConfig.getAsReadOnly()); mapContainer.initEvictor(); }
@Override public void run() throws Exception { MapService service = getService(); MapConfig oldConfig = service.getMapServiceContext().getMapContainer(mapName).getMapConfig(); MapConfig newConfig = new MapConfig(oldConfig); newConfig.setTimeToLiveSeconds(mapConfig.getTimeToLiveSeconds()); newConfig.setMaxIdleSeconds(mapConfig.getMaxIdleSeconds()); newConfig.setEvictionPolicy(mapConfig.getEvictionPolicy()); newConfig.setEvictionPercentage(mapConfig.getEvictionPercentage()); newConfig.setMinEvictionCheckMillis(mapConfig.getMinEvictionCheckMillis()); newConfig.setReadBackupData(mapConfig.isReadBackupData()); newConfig.setBackupCount(mapConfig.getBackupCount()); newConfig.setAsyncBackupCount(mapConfig.getAsyncBackupCount()); newConfig.setMaxSizeConfig(mapConfig.getMaxSizeConfig()); MapContainer mapContainer = service.getMapServiceContext().getMapContainer(mapName); mapContainer.setMapConfig(newConfig.getAsReadOnly()); mapContainer.initEvictor(); }
this.mapStoreContext = createMapStoreContext(this); this.mapStoreContext.start(); initEvictor();
this.mapStoreContext = createMapStoreContext(this); this.mapStoreContext.start(); initEvictor();