public ClientRegionFactory<K,V> setInitialCapacity(int initialCapacity) { this.attrsFactory.setInitialCapacity(initialCapacity); return this; }
public ClientRegionFactory<K,V> setInitialCapacity(int initialCapacity) { this.attrsFactory.setInitialCapacity(initialCapacity); return this; }
/** * Sets the entry initial capacity for the next <code>RegionAttributes</code> * created. This value is used in initializing the map that holds the entries. * * @param initialCapacity * the initial capacity of the entry map * @return a reference to this RegionFactory object * @throws IllegalArgumentException if initialCapacity is negative. * @see java.util.HashMap * @see AttributesFactory#setInitialCapacity */ public RegionFactory<K,V> setInitialCapacity(int initialCapacity) { this.attrsFactory.setInitialCapacity(initialCapacity); return this; }
/** * Sets the entry initial capacity for the next <code>RegionAttributes</code> * created. This value is used in initializing the map that holds the entries. * * @param initialCapacity * the initial capacity of the entry map * @return a reference to this RegionFactory object * @throws IllegalArgumentException if initialCapacity is negative. * @see java.util.HashMap * @see AttributesFactory#setInitialCapacity */ public RegionFactory<K,V> setInitialCapacity(int initialCapacity) { this.attrsFactory.setInitialCapacity(initialCapacity); return this; }
private RegionAttributes getAttributesFromFactory( AttributesFactory afact) throws StandardException { try { // set the default capacity for GemFireXD to avoid too many rehashes // during initialization afact.setInitialCapacity(GemFireXDUtils.getDefaultInitialCapacity()); //afact.setConcurrencyChecksEnabled(GfxdConstants // .TABLE_DEFAULT_CONCURRENCY_CHECKS_ENABLED); return afact.create(); } catch (IllegalStateException ex) { String msg; if(ex.getMessage().contains(LocalizedStrings.HDFSSTORE_IS_USED_IN_NONHDFS_REGION.toLocalizedString())){ msg = ex.getClass().getName() + ": " + LocalizedStrings.HDFSSTORE_IS_USED_IN_REPLICATED_TABLE.toLocalizedString(); throw StandardException.newException( SQLState.HDFS_STORE_NOT_SUPPORTED_FOR_REPLICATE_TABLE, new UnsupportedOperationException(ex), msg); } throw StandardException.newException( SQLState.LANG_UNEXPECTED_USER_EXCEPTION, ex, ex.toString()); } }
private RegionAttributes getAttributesFromFactory( AttributesFactory afact) throws StandardException { try { // set the default capacity for GemFireXD to avoid too many rehashes // during initialization afact.setInitialCapacity(GemFireXDUtils.getDefaultInitialCapacity()); //afact.setConcurrencyChecksEnabled(GfxdConstants // .TABLE_DEFAULT_CONCURRENCY_CHECKS_ENABLED); return afact.create(); } catch (IllegalStateException ex) { String msg; if(ex.getMessage().contains(LocalizedStrings.HDFSSTORE_IS_USED_IN_NONHDFS_REGION.toLocalizedString())){ msg = ex.getClass().getName() + ": " + LocalizedStrings.HDFSSTORE_IS_USED_IN_REPLICATED_TABLE.toLocalizedString(); throw StandardException.newException( SQLState.HDFS_STORE_NOT_SUPPORTED_FOR_REPLICATE_TABLE, new UnsupportedOperationException(ex), msg); } throw StandardException.newException( SQLState.LANG_UNEXPECTED_USER_EXCEPTION, ex, ex.toString()); } }
private RegionAttributes getAttributesFromFactory( AttributesFactory afact) throws StandardException { try { // set the default capacity for GemFireXD to avoid too many rehashes // during initialization afact.setInitialCapacity(GemFireXDUtils.getDefaultInitialCapacity()); //afact.setConcurrencyChecksEnabled(GfxdConstants // .TABLE_DEFAULT_CONCURRENCY_CHECKS_ENABLED); return afact.create(); } catch (IllegalStateException ex) { String msg; if(ex.getMessage().contains(LocalizedStrings.HDFSSTORE_IS_USED_IN_NONHDFS_REGION.toLocalizedString())){ msg = ex.getClass().getName() + ": " + LocalizedStrings.HDFSSTORE_IS_USED_IN_REPLICATED_TABLE.toLocalizedString(); throw StandardException.newException( SQLState.HDFS_STORE_NOT_SUPPORTED_FOR_REPLICATE_TABLE, new UnsupportedOperationException(ex), msg); } throw StandardException.newException( SQLState.LANG_UNEXPECTED_USER_EXCEPTION, ex, ex.toString()); } }
af = new AttributesFactory<Object, Object>(); af.setScope(Scope.LOCAL); af.setInitialCapacity(GemFireXDUtils.getDefaultInitialCapacity()); af.setConcurrencyChecksEnabled(false); rattrs = af.create(); af.setScope(Scope.LOCAL); af.setDataPolicy(DataPolicy.NORMAL); af.setInitialCapacity(GemFireXDUtils.getDefaultInitialCapacity()); af.setConcurrencyChecksEnabled(false); rattrs = af.create();
af = new AttributesFactory<Object, Object>(); af.setScope(Scope.LOCAL); af.setInitialCapacity(GemFireXDUtils.getDefaultInitialCapacity()); af.setConcurrencyChecksEnabled(false); rattrs = af.create(); af.setScope(Scope.LOCAL); af.setDataPolicy(DataPolicy.NORMAL); af.setInitialCapacity(GemFireXDUtils.getDefaultInitialCapacity()); af.setConcurrencyChecksEnabled(false); rattrs = af.create();
af = new AttributesFactory<Object, Object>(); af.setScope(Scope.LOCAL); af.setInitialCapacity(GemFireXDUtils.getDefaultInitialCapacity()); af.setConcurrencyChecksEnabled(false); rattrs = af.create(); af.setScope(Scope.LOCAL); af.setDataPolicy(DataPolicy.NORMAL); af.setInitialCapacity(GemFireXDUtils.getDefaultInitialCapacity()); af.setConcurrencyChecksEnabled(false); rattrs = af.create();
private Region createSnappySpecificGlobalCmdRegion(boolean isLead) throws IOException, ClassNotFoundException { GemFireCacheImpl cache = Misc.getGemFireCache(); final com.gemstone.gemfire.cache.AttributesFactory<?, ?> afact = new com.gemstone.gemfire.cache.AttributesFactory<>(); afact.setScope(Scope.DISTRIBUTED_ACK); if (!isLead) { afact.setInitialCapacity(1000); afact.setConcurrencyChecksEnabled(false); afact.setDiskSynchronous(true); afact.setDiskStoreName(GfxdConstants.GFXD_DD_DISKSTORE_NAME); afact.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); // overflow this region to disk as much as possible since we don't // need it to be in memory afact.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes( 1, EvictionAction.OVERFLOW_TO_DISK)); } else { afact.setDataPolicy(DataPolicy.REPLICATE); } InternalRegionArguments internalRegionArgs = new InternalRegionArguments(); return cache.createVMRegion("__snappyglobalcmds__", afact.create(), internalRegionArgs); }
= new com.gemstone.gemfire.cache.AttributesFactory<Long, RegionValue>(); afact.setScope(Scope.DISTRIBUTED_ACK); afact.setInitialCapacity(1000);
= new com.gemstone.gemfire.cache.AttributesFactory<Long, RegionValue>(); afact.setScope(Scope.DISTRIBUTED_ACK); afact.setInitialCapacity(1000);
afact.setInitialCapacity(1000);
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); } });
= new com.gemstone.gemfire.cache.AttributesFactory<Long, RegionValue>(); afact.setScope(Scope.DISTRIBUTED_ACK); afact.setInitialCapacity(1000);
afact.setPartitionAttributes(pafact.create()); afact.setConcurrencyLevel(ra.getConcurrencyLevel()); afact.setInitialCapacity(ra.getInitialCapacity()); afact.setConcurrencyChecksEnabled(ra.getConcurrencyChecksEnabled()); properties.put(GfxdConstants.REGION_ATTRIBUTES_KEY, afact.create());
afact.setPartitionAttributes(pafact.create()); afact.setConcurrencyLevel(ra.getConcurrencyLevel()); afact.setInitialCapacity(ra.getInitialCapacity()); afact.setConcurrencyChecksEnabled(ra.getConcurrencyChecksEnabled()); properties.put(GfxdConstants.REGION_ATTRIBUTES_KEY, afact.create());