/** * Sets how indexes on this region are kept current. * * @param synchronous whether indexes are maintained in a synchronized fashion * @return a reference to this RegionFactory object */ public RegionFactory<K, V> setIndexMaintenanceSynchronous(boolean synchronous) { this.attrsFactory.setIndexMaintenanceSynchronous(synchronous); return this; }
public static Region createRegion(String regionName, Class valueConstraint, boolean indexMaintenanceSynchronous) { try { AttributesFactory attributesFactory = new AttributesFactory(); attributesFactory.setValueConstraint(valueConstraint); attributesFactory.setIndexMaintenanceSynchronous(indexMaintenanceSynchronous); RegionAttributes regionAttributes = attributesFactory.create(); return cache.createRegion(regionName, regionAttributes); } catch (Exception e) { throw new AssertionError(e); } }
protected void createCache() throws CacheException { Properties p = new Properties(); p.setProperty(MCAST_PORT, "0"); // loner this.cache = (GemFireCacheImpl) CacheFactory.create(DistributedSystem.connect(p)); AttributesFactory<String, String> af = new AttributesFactory<>(); af.setScope(Scope.DISTRIBUTED_NO_ACK); af.setIndexMaintenanceSynchronous(true); this.region = this.cache.createRegion("TXTest", af.create()); this.txMgr = this.cache.getCacheTransactionManager(); }
/** * Sets the Pivotal GemFire AttributesFactory's 'indexMaintenanceSynchronous' property appropriately based on * this IndexMaintenancePolicyType. * * @param attributesFactory the AttributesFactory instance on which to set the indexMaintenanceProperty. * @throws java.lang.NullPointerException if the AttributesFactory reference is null. * @see #setIndexMaintenance(org.apache.geode.cache.RegionFactory) */ @SuppressWarnings("deprecation") public void setIndexMaintenance(final AttributesFactory attributesFactory) { attributesFactory.setIndexMaintenanceSynchronous(equals(SYNCHRONOUS)); }
/** * Sets the GemFire AttributesFactory's 'indexMaintenanceSynchronous' property appropriately based on * this IndexMaintenancePolicyType. * * @param attributesFactory the AttributesFactory instance on which to set the indexMaintenanceProperty. * @throws java.lang.NullPointerException if the AttributesFactory reference is null. * @see #setIndexMaintenance(org.apache.geode.cache.RegionFactory) */ @SuppressWarnings("deprecation") public void setIndexMaintenance(final AttributesFactory attributesFactory) { attributesFactory.setIndexMaintenanceSynchronous(equals(SYNCHRONOUS)); }