use of org.apache.geode.cache.client.internal.PoolImpl in project geode by apache.
the class UnregisterInterestDUnitTest method timedWaitForInvalidates.
public static void timedWaitForInvalidates(Integer invalidates) {
final int inv = invalidates;
final PoolImpl pool = (PoolImpl) PoolManager.find(cache.getRegion(regionname));
WaitCriterion wc = new WaitCriterion() {
@Override
public boolean done() {
// Client region listeners are not invoked for invalidates that create entries.
return pool.getInvalidateCount() == inv;
}
@Override
public String description() {
return "Expected to receive " + inv + " invalidates but received " + pool.getInvalidateCount();
}
};
Wait.waitForCriterion(wc, 10000, 100, true);
}
use of org.apache.geode.cache.client.internal.PoolImpl in project geode by apache.
the class RedundancyLevelTestBase method createClientCache.
public static void createClientCache(String host, int port1, int port2, int port3, int port4, int redundancy, int socketReadTimeout, int retryInterval) throws Exception {
if (!FailOverDetectionByCCU) {
oldBo = ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
public void beforeFailoverByCacheClientUpdater(ServerLocation epFailed) {
try {
Thread.sleep(300000);
} catch (InterruptedException ie) {
// expected - test will shut down the cache which will interrupt
// the CacheClientUpdater thread that invoked this method
Thread.currentThread().interrupt();
}
}
});
}
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
new RedundancyLevelTestBase().createCache(props);
PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(host, PORT1).addServer(host, PORT2).addServer(host, PORT3).addServer(host, PORT4).setSubscriptionEnabled(true).setReadTimeout(socketReadTimeout).setSocketBufferSize(32768).setMinConnections(8).setSubscriptionRedundancy(redundancy).setRetryAttempts(5).setPingInterval(retryInterval).create("DurableClientReconnectDUnitTestPool");
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setPoolName(p.getName());
RegionAttributes attrs = factory.createRegionAttributes();
cache.createRegion(REGION_NAME, attrs);
pool = p;
createEntriesK1andK2();
registerK1AndK2();
}
use of org.apache.geode.cache.client.internal.PoolImpl in project geode by apache.
the class CacheServerTestUtil method createPool.
public static void createPool(PoolAttributes poolAttr) throws Exception {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
DistributedSystem ds = new CacheServerTestUtil().getSystem(props);
;
PoolFactoryImpl pf = (PoolFactoryImpl) PoolManager.createFactory();
pf.init(poolAttr);
PoolImpl p = (PoolImpl) pf.create("CacheServerTestUtil");
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
factory.setPoolName(p.getName());
RegionAttributes attrs = factory.create();
pool = p;
}
use of org.apache.geode.cache.client.internal.PoolImpl in project geode by apache.
the class Bug36805DUnitTest method createClientCache.
public static void createClientCache(String host, Integer port1, Integer port2) throws Exception {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
new Bug36805DUnitTest().createCache(props);
PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(host, port1.intValue()).addServer(host, port2.intValue()).setSubscriptionEnabled(true).setMinConnections(4).create("Bug36805UnitTestPool");
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setPoolName(p.getName());
RegionAttributes attrs = factory.create();
cache.createRegion(regionName, attrs);
pool = p;
}
use of org.apache.geode.cache.client.internal.PoolImpl in project geode by apache.
the class Bug36995DUnitTest method createClientCache.
public static void createClientCache(String host, int port1, int port2, int port3) {
try {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
new Bug36995DUnitTest().createCache(props);
PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(host, port1).addServer(host, port2).addServer(host, port3).setSubscriptionEnabled(true).setSubscriptionRedundancy(-1).setSubscriptionMessageTrackingTimeout(54321).setIdleTimeout(-1).setPingInterval(200).create("Bug36995UnitTestPool1");
AttributesFactory factory = new AttributesFactory();
factory.setPoolName(p.getName());
RegionAttributes attrs = factory.create();
cache.createRegion(regionName, attrs);
pool = p;
} catch (Exception e) {
fail("Test failed due to ", e);
}
}
Aggregations