public DiscoveryNodeListProvider(ApplicationInfoManager applicationInfoManager, DiscoveryClient discoveryClient, String appName) { this.applicationInfoManager = applicationInfoManager; this._discoveryClient = discoveryClient; this._appName = appName; ignoreHosts = new DynamicStringSetProperty(appName + ".ignore.hosts", ""); }
@Override public boolean onThrottle(final EVCacheEvent e) { if(!enableThrottleOperations.get()) return false; final String appName = e.getAppName(); DynamicStringSetProperty throttleCalls = _ignoreOperationsMap.get(appName); if(throttleCalls == null) { throttleCalls = new DynamicStringSetProperty(appName + ".throttle.calls", ""); _ignoreOperationsMap.put(appName, throttleCalls ); } if(throttleCalls.get().size() > 0 && throttleCalls.get().contains(e.getCall().name())) { if(log.isDebugEnabled()) log.debug("Call : " + e.getCall() + " is throttled"); return true; } return false; }
@Override public boolean onThrottle(final EVCacheEvent e) { if(!enableThrottleHotKeys.get()) return false; final String appName = e.getAppName(); DynamicStringSetProperty throttleKeysSet = throttleKeysMap.get(appName); if(throttleKeysSet == null) { throttleKeysSet = new DynamicStringSetProperty(appName + ".throttle.keys", ""); //keys without the cache prefix } if(throttleKeysSet.get().size() > 0) { if(log.isDebugEnabled()) log.debug("Throttle : " + throttleKeysSet); for(String key : e.getKeys()) { if(throttleKeysSet.get().contains(key)) { if(log.isDebugEnabled()) log.debug("Key : " + key + " is throttled"); return true; } } } final Cache<String, Integer> cache = getCache(appName); if(cache == null) return false; final DynamicIntProperty _throttleVal = EVCacheConfig.getInstance().getDynamicIntProperty("EVCacheThrottler." + appName + ".throttle.value", 3); for(String key : e.getKeys()) { Integer val = cache.getIfPresent(key); if(val.intValue() > _throttleVal.get()) { if(log.isDebugEnabled()) log.debug("Key : " + key + " has exceeded " + _throttleVal.get() + ". Will throttle this request"); return true; } } return false; }
this.logOperationCalls = new DynamicStringSetProperty(appName + ".log.operation.calls", "SET,DELETE,GMISS,TMISS,BMISS_ALL,TOUCH,REPLACE"); this.reconcileInterval = config.getDynamicIntProperty(appName + ".reconcile.interval", 600000); this.cloneWrite = new DynamicStringSetProperty(appName + ".clone.writes.to", ""); this.cloneWrite.addCallback(new Runnable() { public void run() {