/** * Sets cloning on region * @param cloningEnable * @return a reference to this RegionFactory object * @since 6.1 * @see AttributesFactory#setCloningEnabled */ public RegionFactory<K,V> setCloningEnabled(boolean cloningEnable) { this.attrsFactory.setCloningEnabled(cloningEnable); return this; }
/** * Sets cloning on region * @param cloningEnable * @return a reference to this RegionFactory object * @since 6.1 * @see AttributesFactory#setCloningEnabled */ public RegionFactory<K,V> setCloningEnabled(boolean cloningEnable) { this.attrsFactory.setCloningEnabled(cloningEnable); return this; }
public ClientRegionFactory<K,V> setCloningEnabled(boolean cloningEnable) { this.attrsFactory.setCloningEnabled(cloningEnable); return this; }
public ClientRegionFactory<K,V> setCloningEnabled(boolean cloningEnable) { this.attrsFactory.setCloningEnabled(cloningEnable); return this; }
/** * Sets this region's compressor for compressing entry values. * @since 7.5 * @param compressor a compressor. */ public void setCompressor(Compressor compressor) { this.regionAttributes.compressor = compressor; this.regionAttributes.setHasCompressor(true); // Cloning must be enabled when a compressor is set if (compressor != null) { setCloningEnabled(true); } }
/** * Sets this region's compressor for compressing entry values. * @since 8.0 * @param compressor a compressor. */ public void setCompressor(Compressor compressor) { this.regionAttributes.compressor = compressor; this.regionAttributes.setHasCompressor(true); // Cloning must be enabled when a compressor is set if (compressor != null) { setCloningEnabled(true); } }
public void DISABLED_testTxWithCloning() { AttributesFactory af = new AttributesFactory(); af.setDataPolicy(DataPolicy.REPLICATE); af.setScope(Scope.DISTRIBUTED_ACK); af.setCloningEnabled(true); basicTest(af.create()); }
public Region<Integer, TestDelta> createRegion(Host host, Cache cache, int port1, int port2) { AttributesFactory<Integer, TestDelta> attr = new AttributesFactory<Integer, TestDelta>(); attr.setCloningEnabled(clone); PartitionAttributesFactory<Integer, TestDelta> paf = new PartitionAttributesFactory<Integer, TestDelta>(); paf.setRedundantCopies(1); paf.setLocalMaxMemory(0); PartitionAttributes<Integer, TestDelta> prAttr = paf.create(); attr.setPartitionAttributes(prAttr); attr.setDataPolicy(DataPolicy.PARTITION); Region<Integer, TestDelta> region = cache.createRegion("region1", attr.create()); return region; } };
AttributesFactory factory = impl.getServerCacheAttributesFactory(enableStorage); factory.setEnableGateway(true); factory.setCloningEnabled(false); factory.setCacheListener(new CacheListener() {
factory.setCloningEnabled(false); factory.setConcurrencyChecksEnabled(false); RegionAttributes attrs = factory.create();
public void run() { Cache cache = getCache(); cache.setCopyOnRead(copyOnRead); AttributesFactory<Integer, TestDelta> attr = new AttributesFactory<Integer, TestDelta>(); attr.setCloningEnabled(clone); PartitionAttributesFactory<Integer, TestDelta> paf = new PartitionAttributesFactory<Integer, TestDelta>(); paf.setRedundantCopies(1); paf.setLocalMaxMemory(0); PartitionAttributes<Integer, TestDelta> prAttr = paf.create(); attr.setPartitionAttributes(prAttr); attr.setDataPolicy(DataPolicy.PARTITION); attr.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)); Region<Integer, TestDelta> region = cache.createRegion("region1", attr.create()); //Put an entry region.put(new Integer(0), new TestDelta(false, "initial")); //Put a delta object that is larger region.put(new Integer(0), new TestDelta(true, "initial_plus_some_more_data")); } };
public static void createClientCache3(String host, Integer port, Boolean bool) throws Exception { Properties props = new Properties(); props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); props.setProperty(DistributionConfig.LOCATORS_NAME, ""); new DeltaToRegionRelationDUnitTest("temp").createCache(props); Pool p = PoolManager.createFactory().addServer(host, port.intValue()) .setThreadLocalConnections(true).setMinConnections(3) .setSubscriptionEnabled(true).setSubscriptionRedundancy(0) .setReadTimeout(10000).setSocketBufferSize(32768) // .setRetryInterval(10000) // .setRetryAttempts(5) .create("DeltaToRegionRelationDUnitTestPool"); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.EMPTY); factory.setPoolName(p.getName()); factory.setCloningEnabled(false); // region with empty data policy RegionAttributes attrs = factory.create(); Region r = cache.createRegion(REGION_NAME1, attrs); r.registerInterest("ALL_KEYS"); assertFalse(cache.getRegion(REGION_NAME1).getAttributes() .getCloningEnabled()); }
public static void createClientCache(String host, Integer port) throws Exception { Properties props = new Properties(); props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); props.setProperty(DistributionConfig.LOCATORS_NAME, ""); cache = new DeltaPropagationStatsDUnitTest("temp").createCache(props); pool = PoolManager.createFactory().addServer(host, port) .setThreadLocalConnections(true).setMinConnections(1) .setSubscriptionEnabled(true).setSubscriptionRedundancy(0) .setReadTimeout(10000).setSocketBufferSize(32768).create( "DeltaPropagationStatsDunitTestPool"); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.NORMAL); factory.setPoolName(pool.getName()); factory.setCloningEnabled(false); factory.addCacheListener(new CacheListenerAdapter() { public void afterCreate(EntryEvent event) { if (LAST_KEY.equals(event.getKey())) { lastKeyReceived = true; } } }); RegionAttributes attrs = factory.create(); cache.createRegion(REGION_NAME, attrs).registerInterest("ALL_KEYS"); }
public static void createClientCache(Integer port1, Integer port2) throws Exception { PRDeltaPropagationDUnitTest test = new PRDeltaPropagationDUnitTest("temp"); Properties props = new Properties(); props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); props.setProperty(DistributionConfig.LOCATORS_NAME, ""); test.createCache(props); lastKeyReceived = false; PoolImpl p = (PoolImpl)PoolManager.createFactory().addServer("localhost", port1).addServer("localhost", port2).setSubscriptionEnabled(true) .setSubscriptionRedundancy(1).setThreadLocalConnections(true) .setMinConnections(6).setReadTimeout(20000).setPingInterval(10000) .setRetryAttempts(5).create("PRDeltaPropagationDUnitTestPool"); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setPoolName(p.getName()); factory.setCloningEnabled(false); factory.setConcurrencyChecksEnabled(true); factory.addCacheListener(new CacheListenerAdapter(){ public void afterCreate(EntryEvent event) { if (LAST_KEY.equals(event.getKey())) { lastKeyReceived = true; }}}); RegionAttributes attrs = factory.create(); deltaPR = cache.createRegion(REGION_NAME, attrs); //deltaPR.create(DELTA_KEY, new PRDeltaTestImpl()); deltaPR.registerInterest("ALL_KEYS"); pool = p; }
public Region<Integer, TestDelta> createRegion(Host host, Cache cache, int port1, int port2) { AttributesFactory<Integer, TestDelta> attr = new AttributesFactory<Integer, TestDelta>(); PoolFactory pf = PoolManager.createFactory(); pf.addServer(getServerHostName(host), port1); pf.addServer(getServerHostName(host), port2); pf.create("pool"); attr.setCloningEnabled(clone); attr.setDataPolicy(DataPolicy.EMPTY); attr.setScope(Scope.LOCAL); attr.setPoolName("pool"); Region<Integer, TestDelta> region = cache.createRegion("region1", attr.create()); return region; } };
PartitionAttributes prAttr = paf.create(); attr.setPartitionAttributes(prAttr); attr.setCloningEnabled(clone);
factory.setDataPolicy(DataPolicy.EMPTY); factory.setPoolName(p.getName()); factory.setCloningEnabled(false);
public Object call() throws Exception { Cache cache = getCache(); cache.setCopyOnRead(copyOnRead); cache.createDiskStoreFactory().create("DeltaFaultInDUnitTestData"); AttributesFactory attr = new AttributesFactory(); attr.setDiskStoreName("DeltaFaultInDUnitTestData"); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(1); PartitionAttributes prAttr = paf.create(); attr.setPartitionAttributes(prAttr); attr.setCloningEnabled(clone); attr.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)); Region region = cache.createRegion("region1", attr.create()); return null; } };
factory.setDataPolicy(DataPolicy.EMPTY); factory.setPoolName(p.getName()); factory.setCloningEnabled(false);
private void createRegion(boolean accessor, int redundantCopies, InterestPolicy interestPolicy) { AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_ACK); af.setDataPolicy(DataPolicy.REPLICATE); af.setCloningEnabled(true); getCache().createRegion(D_REFERENCE,af.create()); af = new AttributesFactory(); af.setCloningEnabled(true); if (interestPolicy != null) { af.setSubscriptionAttributes(new SubscriptionAttributes(interestPolicy)); } af.setPartitionAttributes(new PartitionAttributesFactory<CustId, Customer>() .setTotalNumBuckets(4).setLocalMaxMemory(accessor ? 0 : 1) .setPartitionResolver(new CustomerIDPartitionResolver("resolver1")) .setRedundantCopies(redundantCopies).create()); getCache().createRegion(CUSTOMER, af.create()); af.setPartitionAttributes(new PartitionAttributesFactory<OrderId, Order>() .setTotalNumBuckets(4).setLocalMaxMemory(accessor ? 0 : 1) .setPartitionResolver(new CustomerIDPartitionResolver("resolver2")) .setRedundantCopies(redundantCopies).setColocatedWith(CUSTOMER).create()); getCache().createRegion(ORDER, af.create()); } private void createClientRegion(VM vm, final int port, final boolean isEmpty, final boolean ri) {