@Override public String toString() { StringBuilder sb = new StringBuilder(100); sb.append(this.getClass().getSimpleName()).append('@').append(System.identityHashCode(this)) .append(" name=").append(getName()); return sb.toString(); }
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; }
public static void createCacheClient(Pool poolAttr, String regionName, Properties dsProperties, Boolean addControlListener, Properties javaSystemProperties) throws Exception { new CacheServerTestUtil().createCache(dsProperties); IgnoredException.addIgnoredException("java.net.ConnectException||java.net.SocketException"); if (javaSystemProperties != null && javaSystemProperties.size() > 0) { Enumeration e = javaSystemProperties.propertyNames(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); System.setProperty(key, javaSystemProperties.getProperty(key)); } } 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()); if (addControlListener.booleanValue()) { factory.addCacheListener(new ControlListener()); } RegionAttributes attrs = factory.create(); cache.createRegion(regionName, attrs); pool = p; }
final String timerName = "poolTimer-" + getName() + "-"; backgroundProcessor = LoggingExecutors.newScheduledThreadPool(timerName, BACKGROUND_TASK_POOL_SIZE, BACKGROUND_TASK_POOL_KEEP_ALIVE, threadMonitoring);
poolImpl.sameAs(m2.get(poolImpl.getName()));
factory.setDataPolicy(DataPolicy.EMPTY); factory.setPoolName(p.getName());
stats.setCpus(cpus); String poolName = pool.getName(); try { Map<String, String> newPoolStats = stats.getPoolStats();
public static void createCacheClient(Pool poolAttr, String regionName1, String regionName2) throws Exception { new CacheServerTestUtil().createCache(getClientProperties()); 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(); cache.createRegion(regionName1, attrs); cache.createRegion(regionName2, attrs); pool = p; }
: new PoolStats(statFactory, getName() + "->" + (isEmpty(serverGroup) ? "[any servers]" : "[" + getServerGroup() + "]"));