/** Creates a <code>RegionAttributes</code> with the current settings. * @return the newly created <code>RegionAttributes</code> * @throws IllegalStateException if the current settings violate the * <a href="#compatibility">compatibility rules</a> * @deprecated as of GemFire 5.0, use {@link #create} instead */ @Deprecated public RegionAttributes<K,V> createRegionAttributes() { return create(); } /** Creates a <code>RegionAttributes</code> with the current settings.
/** * Returns region attributes with a distributed-ack scope */ protected RegionAttributes getNonPRRegionAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEarlyAck(false); return factory.create(); }
/** * Returns the attributes of a region to be tested. */ protected RegionAttributes getRegionAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setConcurrencyChecksEnabled(false); return factory.create(); }
public void run2() throws CacheException { AttributesFactory fac = new AttributesFactory(); fac.setScope(Scope.DISTRIBUTED_ACK); RegionAttributes attr = fac.create(); createRootRegion(name, attr); } };
public static void createMirroredRegion(){ try{ AttributesFactory factory = new AttributesFactory(); factory.setDataPolicy(DataPolicy.REPLICATE); factory.setScope(Scope.DISTRIBUTED_ACK); RegionAttributes attr = factory.create(); mirroredRegion = cache.createRegion("mirrored", attr); } catch (Exception ex){ ex.printStackTrace(); } }//end of createCache
public static String createClientMessagesRegionForTesting(GemFireCacheImpl cache, String ePolicy, int capacity, int port, int expiryTime, String overFlowDir, boolean isDiskStore) { AttributesFactory factory = getAttribFactoryForClientMessagesRegion(cache, ePolicy, capacity, overFlowDir, isDiskStore); ExpirationAttributes ea = new ExpirationAttributes(expiryTime, ExpirationAction.LOCAL_INVALIDATE); factory.setEntryTimeToLive(ea); RegionAttributes attr = factory.create(); return createClientMessagesRegion(attr, cache, capacity, port); }
/** * Returns region attributes for a <code>GLOBAL</code> region */ protected RegionAttributes getRegionAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); factory.setConcurrencyChecksEnabled(true); return factory.create(); }
public void run2() throws CacheException { AttributesFactory fac = new AttributesFactory(); fac.setScope(Scope.DISTRIBUTED_ACK); fac.setDataPolicy(DataPolicy.REPLICATE); RegionAttributes attr = fac.create(); createRootRegion(name, attr); } });
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override protected RegionAttributes getRegionAttributes(String type) { RegionAttributes ra = super.getRegionAttributes(type); AttributesFactory factory = new AttributesFactory(ra); if(!ra.getDataPolicy().isEmpty()) { factory.setEnableOffHeapMemory(true); } return factory.create(); } }
public void run() { Cache cache = getCache(); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_ACK); af.setDataPolicy(DataPolicy.REPLICATE); Region region = cache.createRegion("region", af.create()); } };
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override protected RegionAttributes getRegionAttributes(String type) { RegionAttributes ra = super.getRegionAttributes(type); AttributesFactory factory = new AttributesFactory(ra); if(!ra.getDataPolicy().isEmpty()) { factory.setEnableOffHeapMemory(true); } return factory.create(); } }
public void run2() throws CacheException { getCache(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); BridgeTestCase.configureConnectionPool(factory, hostName, port, -1, false, -1, -1, null); createRegion(regionName, factory.create()); } });
public void run2() throws CacheException { createConnection(new String[] {roleA}); AttributesFactory fac = new AttributesFactory(); fac.setScope(getRegionScope()); RegionAttributes attr = fac.create(); createRootRegion(name, attr); } });
public void run2() throws CacheException { Cache cache = getCache(); AttributesFactory attr = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setTotalNumBuckets(totalNumBuckets); PartitionAttributes prAttr = paf.create(); attr.setPartitionAttributes(prAttr); RegionAttributes regionAttribs = attr.create(); cache.createRegion("PR1", regionAttribs); } };
public static void createDistRegionWithMemEvictionAttr() { final AttributesFactory factory = new AttributesFactory(); factory.setDataPolicy(DataPolicy.NORMAL); factory.setEvictionAttributes(EvictionAttributes.createLRUMemoryAttributes( new ObjectSizerImpl(), EvictionAction.LOCAL_DESTROY)); DistributedRegion distRegion = (DistributedRegion)cache.createRegion("DR1", factory.create()); assertNotNull(distRegion); }
public void run2() throws CacheException { createConnection(new String[] {}); AttributesFactory fac = new AttributesFactory(); fac.setScope(getRegionScope()); fac.setDataPolicy(DataPolicy.REPLICATE); RegionAttributes attr = fac.create(); Region region = createRootRegion(name, attr); region.put(key, val); } });
public void run() { try { AttributesFactory factory2 = new AttributesFactory(); factory2.setScope(Scope.DISTRIBUTED_ACK); factory2.setEarlyAck(false); factory2.setDataPolicy(DataPolicy.REPLICATE); getCache().createRegion(rgnName, factory2.create()); } catch (CacheException e) { fail("While creating region", e); } } });
public void run2() throws CacheException { getSystem(p); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_NO_ACK); af.setDataPolicy(DataPolicy.REPLICATE); doTestPartialMessage_Listener = new ControlListener(); af.setCacheListener(doTestPartialMessage_Listener); createRootRegion("slowrec", af.create()); } });
public void run2() throws CacheException { getLonerSystem(); getCache(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setConcurrencyChecksEnabled(false); BridgeTestCase.configureConnectionPool(factory,host0,port,-1,true,-1,-1, null); Region rgn = createRegion(name, factory.create()); rgn.registerInterestRegex(".*", false, false); } };
protected Region createParentRegionOnClient(String name, boolean wanEnable, PoolImpl pool) throws CacheException { final AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setEnableGateway(wanEnable); factory.setPoolName(pool.getName()); factory.addCacheListener(new AtlanticTestCacheListener()); final Region r = createRootRegion(name, factory.create()); return r; } protected Region createParentRegion(String name, boolean wanEnable) throws CacheException {