if (generateDefaults() || cp.getMinConnections() != PoolFactory.DEFAULT_MIN_CONNECTIONS) atts.addAttribute("", "", MIN_CONNECTIONS, "", String.valueOf(cp.getMinConnections())); if (generateDefaults() || cp.getMaxConnections() != PoolFactory.DEFAULT_MAX_CONNECTIONS) atts.addAttribute("", "", MAX_CONNECTIONS, "", String.valueOf(cp.getMaxConnections())); if (generateDefaults() || cp.getRetryAttempts() != PoolFactory.DEFAULT_RETRY_ATTEMPTS) atts.addAttribute("", "", RETRY_ATTEMPTS, "", String.valueOf(cp.getRetryAttempts()));
/** * Initializes the state of this factory for the given pool's state. */ public void init(Pool cp) { setSocketConnectTimeout(cp.getSocketConnectTimeout()); setFreeConnectionTimeout(cp.getFreeConnectionTimeout()); setLoadConditioningInterval(cp.getLoadConditioningInterval()); setSocketBufferSize(cp.getSocketBufferSize()); setReadTimeout(cp.getReadTimeout()); setMinConnections(cp.getMinConnections()); setMaxConnections(cp.getMaxConnections()); setRetryAttempts(cp.getRetryAttempts()); setIdleTimeout(cp.getIdleTimeout()); setPingInterval(cp.getPingInterval()); setStatisticInterval(cp.getStatisticInterval()); setThreadLocalConnections(cp.getThreadLocalConnections()); setSubscriptionEnabled(cp.getSubscriptionEnabled()); setPRSingleHopEnabled(cp.getPRSingleHopEnabled()); setSubscriptionRedundancy(cp.getSubscriptionRedundancy()); setSubscriptionMessageTrackingTimeout(cp.getSubscriptionMessageTrackingTimeout()); setSubscriptionAckInterval(cp.getSubscriptionAckInterval()); setServerGroup(cp.getServerGroup()); setMultiuserAuthentication(cp.getMultiuserAuthentication()); for (InetSocketAddress inetSocketAddress : cp.getLocators()) { addLocator(inetSocketAddress.getHostName(), inetSocketAddress.getPort()); } this.attributes.servers.addAll(cp.getServers()); }
this.readTimeout = attributes.getReadTimeout(); this.minConnections = attributes.getMinConnections(); this.maxConnections = attributes.getMaxConnections(); this.retryAttempts = attributes.getRetryAttempts(); this.idleTimeout = attributes.getIdleTimeout();
/** * 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()); }
.setPoolSocketBufferSize(poolAttr.getSocketBufferSize()) .setPoolMinConnections(poolAttr.getMinConnections()) .setPoolMaxConnections(poolAttr.getMaxConnections()) .setPoolIdleTimeout(poolAttr.getIdleTimeout()) .setPoolPingInterval(poolAttr.getPingInterval())
public int getMaxConnections(Integer defaultMaxConnections) { return defaultIfNull(defaultMaxConnections, () -> getDelegate().getMaxConnections()); }
public int getMaxConnections(Integer defaultMaxConnections) { return defaultIfNull(defaultMaxConnections, () -> getDelegate().getMaxConnections()); }
when(mockPool.getLoadConditioningInterval()).thenReturn(loadConditioningInterval.get()); when(mockPool.getLocators()).thenReturn(locators); when(mockPool.getMaxConnections()).thenReturn(maxConnections.get()); when(mockPool.getMinConnections()).thenReturn(minConnections.get()); when(mockPool.getMultiuserAuthentication()).thenReturn(multiuserAuthentication.get());
.withDetail(poolKey(poolName, "load-conditioning-interval"), pool.getLoadConditioningInterval()) .withDetail(poolKey(poolName, "locators"), toCommaDelimitedHostAndPortsString(pool.getLocators())) .withDetail(poolKey(poolName, "max-connections"), pool.getMaxConnections()) .withDetail(poolKey(poolName, "min-connections"), pool.getMinConnections()) .withDetail(poolKey(poolName, "multi-user-authentication"), toYesNoString(pool.getMultiuserAuthentication()))