/** * Set the minimum number of connections to keep available at all times. When the pool is created, * it will create this many connections. If <code>0</code> then connections will not be made until * an actual operation is done that requires client-to-server communication. * * @param minConnections the initial number of connections this pool will create. * @return a reference to <code>this</code> * @throws IllegalArgumentException if <code>minConnections</code> is less than <code>0</code>. */ public ClientCacheFactory setPoolMinConnections(int minConnections) { getPoolFactory().setMinConnections(minConnections); return this; }
f.setMinConnections(parseInt(v));
PoolFactory poolFactory = PoolManager.createFactory(); addServers(poolFactory, h, ports).setSubscriptionEnabled(true).setThreadLocalConnections(true) .setReadTimeout(5000).setSocketBufferSize(32768).setMinConnections(3) .setSubscriptionRedundancy(1).setPingInterval(2000);
void createClientCacheAndVerifyPingIntervalIsSet(String host, int port) throws Exception { PoolImpl pool = null; try { Properties props = new Properties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, ""); createCache(props); pool = (PoolImpl) PoolManager.createFactory().addServer(host, port) .setSubscriptionEnabled(true).setThreadLocalConnections(false).setReadTimeout(1000) .setSocketBufferSize(32768).setMinConnections(1).setSubscriptionRedundancy(-1) .setPingInterval(2000).create("test pool"); Region<Object, Object> region = cache.createRegionFactory(RegionShortcut.LOCAL) .setPoolName("test pool").create(REGION_NAME1); region.registerInterest(".*"); /** get the subscription connection and verify that it has the correct timeout setting */ QueueConnectionImpl primaryConnection = (QueueConnectionImpl) pool.getPrimaryConnection(); int pingInterval = ((CacheClientUpdater) primaryConnection.getUpdater()) .getServerQueueStatus().getPingInterval(); assertNotEquals(0, pingInterval); assertEquals(CacheClientNotifier.getClientPingInterval(), pingInterval); } finally { cache.close(); } }
(PoolImpl) PoolManager.createFactory().addServer(host, PORT1).setSubscriptionEnabled(true) .setThreadLocalConnections(true).setReadTimeout(1000).setSocketBufferSize(32768) .setMinConnections(3).setSubscriptionRedundancy(-1).setPingInterval(2000)
pf.setMinConnections(connectionsPerServer * ports.length);
.thenAnswer(newSetter(maxConnections, mockPoolFactory)); when(mockPoolFactory.setMinConnections(anyInt())) .thenAnswer(newSetter(minConnections, mockPoolFactory));
mockPoolFactory.setMinConnections(invocation.getArgument(0)); return clientCacheFactorySpy; }).when(clientCacheFactorySpy).setPoolMinConnections(anyInt());
it.setLoadConditioningInterval(this.loadConditioningInterval); it.setMaxConnections(this.maxConnections); it.setMinConnections(this.minConnections); it.setMultiuserAuthentication(this.multiUserAuthentication); it.setPingInterval(this.pingInterval);
it.setLoadConditioningInterval(this.loadConditioningInterval); it.setMaxConnections(this.maxConnections); it.setMinConnections(this.minConnections); it.setMultiuserAuthentication(this.multiUserAuthentication); it.setPingInterval(this.pingInterval);