/** * Returns whether or not disk writes are asynchronous. * * @return a reference to this RegionFactory object * @see Region#writeToDisk * @see AttributesFactory#setDiskWriteAttributes * @deprecated as of 6.5 use {@link #setDiskStoreName} instead * */ @Deprecated public RegionFactory<K,V> setDiskWriteAttributes(DiskWriteAttributes attrs) { this.attrsFactory.setDiskWriteAttributes(attrs); return this; }
/** * Returns whether or not disk writes are asynchronous. * * @return a reference to this RegionFactory object * @see Region#writeToDisk * @see AttributesFactory#setDiskWriteAttributes * @deprecated as of 6.5 use {@link #setDiskStoreName} instead * */ @Deprecated public RegionFactory<K,V> setDiskWriteAttributes(DiskWriteAttributes attrs) { this.attrsFactory.setDiskWriteAttributes(attrs); return this; }
public void run2() throws CacheException { AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeapEnabled()); factory.setEvictionAttributes( EvictionAttributes.createLRUEntryAttributes(maxEntries, EvictionAction.OVERFLOW_TO_DISK)); factory.setDataPolicy(DataPolicy.REPLICATE); File[] diskDirs = new File[1]; diskDirs[0] = new File("overflowDir/" + OSProcess.getId()); diskDirs[0].mkdirs(); factory.setDiskDirs(diskDirs); DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory(); dwaf.setSynchronous(true); DiskWriteAttributes dwattrs = dwaf.create(); factory.setDiskWriteAttributes(dwattrs); factory.setDiskDirs(diskDirs); factory.setScope(Scope.DISTRIBUTED_ACK); RegionAttributes a = factory.create(); createRegion(r1, a); createRegion(r2, a); createRegion(r3, a); } };
dwaf.setRollOplogs(false); // fix for bug 40493 DiskWriteAttributes dwa = dwaf.create(); factory.setDiskWriteAttributes(dwa);
factory.setEnableAsyncConflation(asyncConflation.booleanValue()); if (isSynchronous != null) { factory.setDiskWriteAttributes(getDiskWriteAttributes());
AttributesFactory af = new AttributesFactory(); af.setDiskDirsAndSizes(new File[]{f1, f2}, new int[]{1,2}); af.setDiskWriteAttributes(dwf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); Region r = cache.createRegion("r", af.create()); af.setDiskWriteAttributes(dwf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); r = cache.createRegion("r", af.create());
factory.setDiskWriteAttributes(dwaf.create()); RegionAttributes attrs = factory.create(); assertEquals(false, attrs.getDiskWriteAttributes().isSynchronous());
dwaf.setSynchronous(true); AttributesFactory af = new AttributesFactory(); af.setDiskWriteAttributes(dwaf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); Region r = cache.createRegion("r", af.create()); af.setDiskWriteAttributes(dwaf.create()); r = cache.createRegion("r", af.create()); assertEquals(false, r.getAttributes().isDiskSynchronous()); af.setDiskWriteAttributes(dwaf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); r = cache.createRegion("r2", af.create()); af.setDiskWriteAttributes(dwaf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); r = cache.createRegion("r2", af.create()); af.setDiskWriteAttributes(dwaf.create()); af.setDataPolicy(DataPolicy.PARTITION); af.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)); af.setDiskWriteAttributes(dwaf.create()); af.setDataPolicy(DataPolicy.PARTITION); af.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK));
dwaf.setBytesThreshold(0); AttributesFactory af = new AttributesFactory(); af.setDiskWriteAttributes(dwaf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); Region r = cache.createRegion("r", af.create()); af.setDiskWriteAttributes(dwaf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); r = cache.createRegion("r", af.create());
dwaf.setBytesThreshold(666); AttributesFactory af = new AttributesFactory(); af.setDiskWriteAttributes(dwaf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); Region r = cache.createRegion("r", af.create()); af.setDiskWriteAttributes(dwaf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); r = cache.createRegion("r", af.create());
public void run2() throws CacheException { Cache cache = getCache(); AttributesFactory factory = new AttributesFactory(); factory.setCacheListener(new CacheListener2()); factory.setCacheLoader(new CacheLoader2()); factory.setCacheWriter(new CacheWriter2()); factory.setConcurrencyLevel(concurrencyLevel); factory.setDiskDirs(new File[] { diskDir }); factory.setDiskWriteAttributes(dwa); factory.setStatisticsEnabled(statisticsEnabled); factory.setEntryIdleTimeout(entryIdle); factory.setEntryTimeToLive(entryTtl); factory.setInitialCapacity(initialCapacity); factory.setKeyConstraint(String.class); factory.setLoadFactor(loadFactor); factory.setDataPolicy(dataPolicy); factory.setRegionIdleTimeout(regionIdle); factory.setRegionTimeToLive(regionTtl); factory.setScope(scope); factory.setEarlyAck(false); MembershipAttributes membershipAttributes = new MembershipAttributes(new String[] {"A"}, LossAction.LIMITED_ACCESS, ResumptionAction.NONE); factory.setMembershipAttributes(membershipAttributes); RegionAttributes attrs = factory.create(); Region region = cache.createRegion(name, attrs); region.setUserAttribute(userAttribute); } });
if (this.config.getPersistBackup()) { af.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); af.setDiskWriteAttributes(new DiskWriteAttributesFactory().create()); if (this.config.getDiskDir() != null) { af.setDiskDirs(new File[]{this.config.getDiskDir()});
DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory(); try { factory.setDiskWriteAttributes(dwaf.create()); fail("Should have thrown an IllegalStateException"); } catch (Exception ex) { factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); DiskWriteAttributesFactory dwaf2 = new DiskWriteAttributesFactory(); factory.setDiskWriteAttributes(dwaf2.create()); try { factory.setDiskStoreName("ds1");
if (this.config.getPersistBackup()) { af.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); af.setDiskWriteAttributes(new DiskWriteAttributesFactory().create()); if (this.config.getDiskDir() != null) { af.setDiskDirs(new File[]{this.config.getDiskDir()});