private ConnectionSource getSourceImpl(LocatorDiscoveryCallback locatorDiscoveryCallback) { List<InetSocketAddress> locators = getLocators(); if (locators.isEmpty()) { return new ExplicitConnectionSourceImpl(getServers()); } else { AutoConnectionSourceImpl source = new AutoConnectionSourceImpl(locators, locatorAddresses, getServerGroup(), socketConnectTimeout); if (locatorDiscoveryCallback != null) { source.setLocatorDiscoveryCallback(locatorDiscoveryCallback); } return source; } }
String.format("Pool %s is different", "serverGroup")); if (!getLocators().equals(other.getLocators())) { throw new RuntimeException( String.format("Pool %s are different", "locators"));
List locators = getLocators(); if (!locators.isEmpty()) { logger.debug("PoolImpl - starting pool with locators: {}", locators);
/** * Return true if the given Pool is compatible with these attributes. Currently this does what * equals would but in the future we might decide to weaken the compatibility contract. * * @since GemFire 6.5 */ public boolean isCompatible(Pool p) { if (p == null) return false; return getFreeConnectionTimeout() == p.getFreeConnectionTimeout() && getSocketConnectTimeout() == p.getSocketConnectTimeout() && getLoadConditioningInterval() == p.getLoadConditioningInterval() && getSocketBufferSize() == p.getSocketBufferSize() && getMinConnections() == p.getMinConnections() && getMaxConnections() == p.getMaxConnections() && getIdleTimeout() == p.getIdleTimeout() && getPingInterval() == p.getPingInterval() && getStatisticInterval() == p.getStatisticInterval() && getRetryAttempts() == p.getRetryAttempts() && getThreadLocalConnections() == p.getThreadLocalConnections() && getReadTimeout() == p.getReadTimeout() && getSubscriptionEnabled() == p.getSubscriptionEnabled() && getPRSingleHopEnabled() == p.getPRSingleHopEnabled() && getSubscriptionRedundancy() == p.getSubscriptionRedundancy() && getSubscriptionMessageTrackingTimeout() == p.getSubscriptionMessageTrackingTimeout() && getSubscriptionAckInterval() == p.getSubscriptionAckInterval() && getServerGroup().equals(p.getServerGroup()) && getMultiuserAuthentication() == p.getMultiuserAuthentication() && getLocators().equals(p.getLocators()) && getServers().equals(p.getServers()); }
@SuppressWarnings("all") private void verifyClientCacheSubscriptionQueueConnectionsEstablished() { resolvePools().stream() .filter(pool -> pool.getSubscriptionEnabled()) .filter(pool -> pool instanceof PoolImpl) .map(pool -> (PoolImpl) pool) .forEach(pool -> { long timeout = System.currentTimeMillis() + resolveTimeout(); while (System.currentTimeMillis() < timeout && !pool.isPrimaryUpdaterAlive()) { synchronized (pool) { ObjectUtils.doOperationSafely(() -> { TimeUnit.MILLISECONDS.timedWait(pool, 500L); return null; }); } } String errorMessage = String.format("ClientCache subscription queue connection not established;" + " Pool [%s] has configuration [locators = %s, servers = %s]", pool, pool.getLocators(), pool.getServers()); if (isThrowExceptionOnSubscriptionQueueConnectionFailure()) { Assert.state(pool.isPrimaryUpdaterAlive(), errorMessage); } else if (getLogger().isWarnEnabled()){ getLogger().warn(errorMessage); } }); }