private void preOp() { if (this.proxyCache.isClosed()) { throw proxyCache.getCacheClosedException("Cache is closed for this user."); } UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes()); }
private void preOp(boolean setTL) { if (this.proxyCache.isClosed()) { throw proxyCache.getCacheClosedException("Cache is closed for this user."); } if (setTL) { UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes()); } }
private Object executeOnServer(Object[] parameters) { long startTime = CachePerfStats.getStatTime(); Object result = null; try { if (this.proxyCache != null) { if (this.proxyCache.isClosed()) { throw proxyCache.getCacheClosedException("Cache is closed for this user."); } UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes()); } result = this.serverProxy.query(this.queryString, parameters); } finally { UserAttributes.userAttributes.set(null); long endTime = CachePerfStats.getStatTime(); updateStatistics(endTime - startTime); } return result; }
if (regionService != null && regionService instanceof ProxyCache) { ProxyCache proxyCache = (ProxyCache) regionService; UserAttributes.userAttributes.set(proxyCache.getUserAttributes());
throw proxyCache.getCacheClosedException("Cache is closed for this user."); UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
protected ResultCollector executeFunction(final String functionId, boolean result, boolean isHA, boolean optimizeForWrite) { try { if (proxyCache != null) { if (this.proxyCache.isClosed()) { throw proxyCache.getCacheClosedException("Cache is closed for this user."); } UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes()); } byte hasResult = 0; if (result) { // have Results hasResult = 1; if (this.rc == null) { // Default Result Collector ResultCollector defaultCollector = new DefaultResultCollector(); return executeOnServer(functionId, defaultCollector, hasResult, isHA, optimizeForWrite); } else { // Custome Result COllector return executeOnServer(functionId, this.rc, hasResult, isHA, optimizeForWrite); } } else { // No results executeOnServerNoAck(functionId, hasResult, isHA, optimizeForWrite); return new NoResult(); } } finally { UserAttributes.userAttributes.set(null); } }
protected ResultCollector executeFunction(final String functionId, boolean resultReq, boolean isHA, boolean optimizeForWrite) { try { if (proxyCache != null) { if (this.proxyCache.isClosed()) { throw proxyCache.getCacheClosedException("Cache is closed for this user."); } UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes()); } byte hasResult = 0; if (resultReq) { // have Results hasResult = 1; if (this.rc == null) { // Default Result Collector ResultCollector defaultCollector = new DefaultResultCollector(); return executeOnServer(functionId, defaultCollector, hasResult, isHA, optimizeForWrite); } else { // Custome Result COllector return executeOnServer(functionId, this.rc, hasResult, isHA, optimizeForWrite); } } else { // No results executeOnServerNoAck(functionId, hasResult, isHA, optimizeForWrite); return new NoResult(); } } finally { UserAttributes.userAttributes.set(null); } }
try { Long userId = proxyCache.getUserAttributes().getServerToId().remove(endpoint.getLocation()); if (userId != null) { ++size;
@Override protected ResultCollector executeFunction(final Function function) { byte hasResult = 0; try { if (proxyCache != null) { if (this.proxyCache.isClosed()) { throw proxyCache.getCacheClosedException("Cache is closed for this user."); } UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes()); } if (function.hasResult()) { // have Results hasResult = 1; if (this.rc == null) { // Default Result Collector ResultCollector defaultCollector = new DefaultResultCollector(); return executeOnServer(function, defaultCollector, hasResult); } else { // Custome Result COllector return executeOnServer(function, this.rc, hasResult); } } else { // No results executeOnServerNoAck(function, hasResult); return new NoResult(); } } finally { UserAttributes.userAttributes.set(null); } }
@Override protected ResultCollector executeFunction(final Function function) { byte hasResult = 0; try { if (proxyCache != null) { if (this.proxyCache.isClosed()) { throw proxyCache.getCacheClosedException("Cache is closed for this user."); } UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes()); } if (function.hasResult()) { // have Results hasResult = 1; if (this.rc == null) { // Default Result Collector ResultCollector defaultCollector = new DefaultResultCollector(); return executeOnServer(function, defaultCollector, hasResult); } else { // Custome Result COllector return executeOnServer(function, this.rc, hasResult); } } else { // No results executeOnServerNoAck(function, hasResult); return new NoResult(); } } finally { UserAttributes.userAttributes.set(null); } }
@Override public Execution onServers(RegionService regionService, String... groups) { if (regionService == null) { throw new FunctionException(String.format("%s passed is null", "RegionService instance ")); } if (regionService instanceof GemFireCacheImpl) { InternalClientCache internalCache = (InternalClientCache) regionService; if (!internalCache.isClient()) { throw new FunctionException("The cache was not a client cache"); } else if (internalCache.getDefaultPool() != null) { return onServers(internalCache.getDefaultPool(), groups); } else { throw new FunctionException("The client cache does not have a default pool"); } } else { ProxyCache proxyCache = (ProxyCache) regionService; return new ServerFunctionExecutor(proxyCache.getUserAttributes().getPool(), true, proxyCache, groups); } }
throw proxyCache.getCacheClosedException("Cache is closed for this user."); UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
throw proxyCache.getCacheClosedException("Cache is closed for this user."); UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
@Override public Execution onServer(RegionService regionService, String... groups) { if (regionService == null) { throw new FunctionException(String.format("%s passed is null", "RegionService instance ")); } if (regionService instanceof GemFireCacheImpl) { InternalClientCache internalCache = (InternalClientCache) regionService; if (!internalCache.isClient()) { throw new FunctionException("The cache was not a client cache"); } else if (internalCache.getDefaultPool() != null) { return onServer(internalCache.getDefaultPool(), groups); } else { throw new FunctionException("The client cache does not have a default pool"); } } else { ProxyCache proxyCache = (ProxyCache) regionService; return new ServerFunctionExecutor(proxyCache.getUserAttributes().getPool(), false, proxyCache, groups); } }
throw proxyCache.getCacheClosedException("Cache is closed for this user."); UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());
throw proxyCache.getCacheClosedException("Cache is closed for this user."); UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes());