/** * @since GemFire 6.5 */ @Override public QueryService getQueryService(String poolName) { Pool pool = PoolManager.find(poolName); if (pool == null) { throw new IllegalStateException("Could not find a pool named " + poolName); } else { return pool.getQueryService(); } }
@Override public RegionService createAuthenticatedView(Properties userSecurityProperties, String poolName) { Pool pool = PoolManager.find(poolName); if (pool == null) { throw new IllegalStateException("Pool " + poolName + " does not exist"); } return createAuthenticatedCacheView(pool, userSecurityProperties); }
private static InternalPool calcPool(Region r) { String poolName = r.getAttributes().getPoolName(); if (poolName == null || "".equals(poolName)) { throw new IllegalStateException( "The region " + r.getFullPath() + " did not have a client pool configured."); } else { InternalPool pool = (InternalPool) PoolManager.find(poolName); if (pool == null) { throw new IllegalStateException("The pool " + poolName + " does not exist."); } return pool; } }
/** * Returns the pool this region is using or null if it does not have one or the pool does not * exist. * * @since GemFire 5.7 */ private PoolImpl getPool() { PoolImpl result = null; if (getPoolName() != null) { result = (PoolImpl) PoolManager.find(getPoolName()); } return result; }
public static void dumpPoolIdentifiers() throws Exception { // duplicate events were received, so let's look at the thread identifiers we have PoolImpl pool = (PoolImpl) PoolManager.find("ClientServerMiscDUnitTestPool"); Map seqMap = pool.getThreadIdToSequenceIdMap(); for (Object o : seqMap.keySet()) { ThreadIdentifier tid = (ThreadIdentifier) o; byte[] memberBytes = tid.getMembershipID(); dumpMemberId(tid, memberBytes); } }
public static void createCacheClientFromXml(URL url, String poolName, String durableClientId, int timeout, Boolean addControlListener) { ClientCacheFactory ccf = new ClientCacheFactory(); try { File cacheXmlFile = new File(url.toURI().getPath()); ccf.set(CACHE_XML_FILE, cacheXmlFile.toURI().getPath()); } catch (URISyntaxException e) { throw new ExceptionInInitializerError(e); } ccf.set(MCAST_PORT, "0"); ccf.set(DURABLE_CLIENT_ID, durableClientId); ccf.set(DURABLE_CLIENT_TIMEOUT, String.valueOf(timeout)); cache = (Cache) ccf.create(); expected = IgnoredException .addIgnoredException("java.net.ConnectionException||java.net.SocketException"); pool = (PoolImpl) PoolManager.find(poolName); }
public static void createCacheClientFromXmlN(URL url, String poolName, String durableClientId, int timeout, Boolean addControlListener) { ClientCacheFactory ccf = new ClientCacheFactory(); try { File cacheXmlFile = new File(url.toURI().getPath()); ccf.set(CACHE_XML_FILE, cacheXmlFile.toURI().getPath()); } catch (URISyntaxException e) { throw new ExceptionInInitializerError(e); } ccf.set(MCAST_PORT, "0"); ccf.set(DURABLE_CLIENT_ID, durableClientId); ccf.set(DURABLE_CLIENT_TIMEOUT, String.valueOf(timeout)); ccf.set(LOG_FILE, "abs_client_system.log"); ccf.set(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel()); cache = (Cache) ccf.create(); expected = IgnoredException .addIgnoredException("java.net.ConnectionException||java.net.SocketException"); pool = (PoolImpl) PoolManager.find(poolName); }
@Override public boolean isBackingCacheAvailable() { if (getSessionManager().isCommitValveFailfastEnabled()) { PoolImpl pool = (PoolImpl) PoolManager.find(getOperatingRegionName()); return pool.isPrimaryUpdaterAlive(); } return true; }
private synchronized ConnectionStats getStats(ServerLocation location) { ConnectionStats stats = statMap.get(location); if (stats == null) { String statName = poolName + "-" + location.toString(); PoolImpl pool = (PoolImpl) PoolManager.find(this.poolName); if (pool != null) { if (pool.getGatewaySender() != null) { stats = new ConnectionStats(new DummyStatisticsFactory(), statName, this.poolStats/* , this.gatewayStats */); } } if (stats == null) { stats = new ConnectionStats(ds, statName, this.poolStats/* * , this.gatewayStats */); } statMap.put(location, stats); } return stats; }
PoolImpl pool = (PoolImpl) PoolManager.find(this.poolName); if (pool != null && pool.getMultiuserAuthentication()) { int size = 0;
protected void executeQueryWithCheckForAccessPermissions(VM vm, String query, String regionName, String regexForExpectedExceptions) { vm.invoke(() -> { Region region = getClientCache().getRegion(regionName); assertExceptionOccurred(getClientCache().getQueryService(), query, regexForExpectedExceptions); Pool pool = PoolManager.find(region); assertExceptionOccurred(pool.getQueryService(), query, regexForExpectedExceptions); }); } }
@Override public Execution onRegion(Region region) { if (region == null) { throw new FunctionException( String.format("%s passed is null", "Region instance ")); } ProxyCache proxyCache = null; String poolName = region.getAttributes().getPoolName(); if (poolName != null) { Pool pool = PoolManager.find(poolName); if (pool.getMultiuserAuthentication()) { if (region instanceof ProxyRegion) { ProxyRegion proxyRegion = (ProxyRegion) region; region = proxyRegion.getRealRegion(); proxyCache = proxyRegion.getAuthenticatedCache(); } else { throw new UnsupportedOperationException(); } } } if (isClientRegion(region)) { return new ServerRegionFunctionExecutor(region, proxyCache); } if (PartitionRegionHelper.isPartitionedRegion(region)) { return new PartitionedRegionFunctionExecutor(region); } return new DistributedRegionFunctionExecutor(region); }
static <K, V> Exporter<K, V> createExporter(InternalCache cache, Region<?, ?> region, SnapshotOptions<K, V> options) { String pool = region.getAttributes().getPoolName(); if (pool != null) { return new ClientExporter<>(PoolManager.find(pool)); } else if (cache.getInternalDistributedSystem().isLoner() || region.getAttributes().getDataPolicy().equals(DataPolicy.NORMAL) || region.getAttributes().getDataPolicy().equals(DataPolicy.PRELOADED) || region instanceof LocalDataSet || (options.isParallelMode() && region.getAttributes().getDataPolicy().withPartitioning())) { // Avoid function execution: // for loner systems to avoid inlining fn execution // for NORMAL/PRELOAD since they don't support fn execution // for LocalDataSet since we're already running a fn // for parallel ops since we're already running a fn return new LocalExporter<>(); } return new WindowedExporter<>(); }
/** * Release the client connection pool if we have one * * @since GemFire 5.7 */ private void detachPool() { ServerRegionProxy serverRegionProxy = getServerProxy(); if (serverRegionProxy != null) { InternalCache internalCache = getCache(); String poolName = this.getPoolName(); PoolImpl pool = (PoolImpl) PoolManager.find(this.getPoolName()); if (poolName != null && pool != null) { serverRegionProxy .detach(internalCache.keepDurableSubscriptionsAlive() || pool.getKeepAlive()); } else { serverRegionProxy.detach(internalCache.keepDurableSubscriptionsAlive()); } } }
String cpName = this.config.getPoolName(); if (cpName != null) { Pool cp = PoolManager.find(cpName); if (cp == null) { throw new IllegalStateException(
protected Pool resolveNamedPool() { if (StringUtils.hasText(this.poolName)) { this.pool = Optional.ofNullable(PoolManager.find(this.poolName)) .orElseThrow(() -> newIllegalStateException("No Pool with name [%s] exists", this.poolName)); } return this.pool; }
protected Pool resolveNamedPool() { if (StringUtils.hasText(this.poolName)) { this.pool = Optional.ofNullable(PoolManager.find(this.poolName)) .orElseThrow(() -> newIllegalStateException("No Pool with name [%s] exists", this.poolName)); } return this.pool; }
protected Pool resolveNamedPool() { if (StringUtils.hasText(this.poolName)) { this.pool = Optional.ofNullable(PoolManager.find(this.poolName)) .orElseThrow(() -> newIllegalStateException("No Pool with name [%s] exists", this.poolName)); } return this.pool; }
protected Pool resolveNamedPool() { if (StringUtils.hasText(this.poolName)) { this.pool = Optional.ofNullable(PoolManager.find(this.poolName)) .orElseThrow(() -> newIllegalStateException("No Pool with name [%s] exists", this.poolName)); } return this.pool; }
@SuppressWarnings("all") private boolean eagerlyInitializePool(String poolName) { return Optional.ofNullable(PoolManager.find(poolName)) .map(it -> true) .orElseGet(() -> SpringUtils.safeGetValue(() -> getBeanFactory().getBean(poolName, Pool.class) != null, false)); }