public static void createReplicatedRegionWithSenderAndAsyncEventQueue( String regionName, String senderIds, String asyncChannelId, Boolean offHeap) { ExpectedException exp = addExpectedException(ForceReattemptException.class .getName()); try { AttributesFactory fact = new AttributesFactory(); if (senderIds != null) { StringTokenizer tokenizer = new StringTokenizer(senderIds, ","); while (tokenizer.hasMoreTokens()) { String senderId = tokenizer.nextToken(); fact.addGatewaySenderId(senderId); } } fact.setDataPolicy(DataPolicy.REPLICATE); fact.setScope(Scope.DISTRIBUTED_ACK); fact.setEnableOffHeapMemory(offHeap); RegionFactory regionFactory = cache.createRegionFactory(fact.create()); regionFactory.addAsyncEventQueueId(asyncChannelId); Region r = regionFactory.create(regionName); assertNotNull(r); } finally { exp.remove(); } }
public void setUp() throws Exception { super.setUp(); wan = new WanListener(); cache.createAsyncEventQueueFactory().setBatchSize(1).create("wanqueue", wan); region = cache.<Integer, MyObject>createRegionFactory(RegionShortcut.REPLICATE) .addAsyncEventQueueId("wanqueue").create("test"); }
public static void createPartitionedRegionWithAsyncEventQueue( String regionName, String asyncEventQueueId, Boolean offHeap) { ExpectedException exp = addExpectedException(ForceReattemptException.class .getName()); ExpectedException exp1 = addExpectedException(PartitionOfflineException.class .getName()); try { AttributesFactory fact = new AttributesFactory(); PartitionAttributesFactory pfact = new PartitionAttributesFactory(); pfact.setTotalNumBuckets(16); fact.setPartitionAttributes(pfact.create()); fact.setEnableOffHeapMemory(offHeap); Region r = cache.createRegionFactory(fact.create()) .addAsyncEventQueueId(asyncEventQueueId).create(regionName); assertNotNull(r); } finally { exp.remove(); exp1.remove(); } }
public static void createPartitionedRegionAccessorWithAsyncEventQueue( String regionName, String asyncEventQueueId) { AttributesFactory fact = new AttributesFactory(); PartitionAttributesFactory pfact = new PartitionAttributesFactory(); pfact.setTotalNumBuckets(16); pfact.setLocalMaxMemory(0); fact.setPartitionAttributes(pfact.create()); Region r = cache.createRegionFactory( fact.create()).addAsyncEventQueueId( asyncEventQueueId).create(regionName); //fact.create()).create(regionName); assertNotNull(r); }
public static void createColocatedPartitionedRegionWithAsyncEventQueue( String regionName, String asyncEventQueueId, Integer totalNumBuckets, String colocatedWith, Boolean offHeap) { ExpectedException exp = addExpectedException(ForceReattemptException.class .getName()); ExpectedException exp1 = addExpectedException(PartitionOfflineException.class .getName()); try { AttributesFactory fact = new AttributesFactory(); PartitionAttributesFactory pfact = new PartitionAttributesFactory(); pfact.setTotalNumBuckets(totalNumBuckets); pfact.setColocatedWith(colocatedWith); fact.setPartitionAttributes(pfact.create()); fact.setEnableOffHeapMemory(offHeap); Region r = cache.createRegionFactory(fact.create()) .addAsyncEventQueueId(asyncEventQueueId).create(regionName); assertNotNull(r); } finally { exp.remove(); exp1.remove(); } }
/** * Create PartitionedRegion with 1 redundant copy */ public static void createPRWithRedundantCopyWithAsyncEventQueue( String regionName, String asyncEventQueueId, Boolean offHeap) { ExpectedException exp = addExpectedException(ForceReattemptException.class .getName()); try { AttributesFactory fact = new AttributesFactory(); PartitionAttributesFactory pfact = new PartitionAttributesFactory(); pfact.setTotalNumBuckets(16); pfact.setRedundantCopies(1); fact.setPartitionAttributes(pfact.create()); fact.setEnableOffHeapMemory(offHeap); Region r = cache.createRegionFactory(fact.create()) .addAsyncEventQueueId(asyncEventQueueId).create(regionName); assertNotNull(r); } finally { exp.remove(); } }
if (asyncEventQueueIds != null && !asyncEventQueueIds.isEmpty()) { for (String asyncEventQueueId : asyncEventQueueIds) { factory.addAsyncEventQueueId(asyncEventQueueId);
if (asyncEventQueueIds != null && !asyncEventQueueIds.isEmpty()) { for (String asyncEventQueueId : asyncEventQueueIds) { factory.addAsyncEventQueueId(asyncEventQueueId);