@Override public float getLoadFactor() { return this.ra.getLoadFactor(); }
CompactMapRangeIndex(InternalCache cache, String indexName, Region region, String fromClause, String indexedExpression, String projectionAttributes, String origFromClause, String origIndxExpr, String[] defintions, boolean isAllKeys, String[] multiIndexingKeysPattern, Object[] mapKeys, IndexStatistics stats) { super(cache, indexName, region, fromClause, indexedExpression, projectionAttributes, origFromClause, origIndxExpr, defintions, isAllKeys, multiIndexingKeysPattern, mapKeys, stats); RegionAttributes ra = region.getAttributes(); this.entryToMapKeyIndexKeyMap = new java.util.concurrent.ConcurrentHashMap( ra.getInitialCapacity(), ra.getLoadFactor(), ra.getConcurrencyLevel()); }
MapRangeIndex(InternalCache cache, String indexName, Region region, String fromClause, String indexedExpression, String projectionAttributes, String origFromClause, String origIndxExpr, String[] defintions, boolean isAllKeys, String[] multiIndexingKeysPattern, Object[] mapKeys, IndexStatistics stats) { super(cache, indexName, region, fromClause, indexedExpression, projectionAttributes, origFromClause, origIndxExpr, defintions, isAllKeys, multiIndexingKeysPattern, mapKeys, stats); RegionAttributes ra = region.getAttributes(); this.entryToMapKeysMap = new RegionEntryToValuesMap( new java.util.concurrent.ConcurrentHashMap(ra.getInitialCapacity(), ra.getLoadFactor(), ra.getConcurrencyLevel()), true /* user target list as the map keys will be unique */); }
MemoryIndexStore(Region region, InternalIndexStatistics internalIndexStats, InternalCache cache) { this.region = region; RegionAttributes ra = region.getAttributes(); // Initialize the reverse-map if in-place modification is set by the // application. if (IndexManager.isObjectModificationInplace()) { this.entryToValuesMap = new ConcurrentHashMap(ra.getInitialCapacity(), ra.getLoadFactor(), ra.getConcurrencyLevel()); } this.internalIndexStats = internalIndexStats; this.cache = cache; }
@Override protected Region createRegion() { Region region = mock(LocalRegion.class); RegionAttributes ra = mock(RegionAttributes.class); when(region.getAttributes()).thenReturn(ra); when(ra.getInitialCapacity()).thenReturn(16); when(ra.getLoadFactor()).thenReturn(.75f); when(ra.getConcurrencyLevel()).thenReturn(16); return region; }
/** * Create a HashIndex that can be used when executing queries. * * @param indexName the name of this index, used for statistics collection * @param indexedExpression the expression to index on, a function dependent on region entries * individually, limited to a path expression. * @param fromClause expression that evaluates to the collection(s) that will be queried over, * must contain one and only one region path, and only one iterator. * @param projectionAttributes not used * @param definitions the canonicalized definitions */ public HashIndex(InternalCache cache, String indexName, Region region, String fromClause, String indexedExpression, String projectionAttributes, String origFromClause, String origIndexExpr, String[] definitions, IndexStatistics stats) { super(cache, indexName, region, fromClause, indexedExpression, projectionAttributes, origFromClause, origIndexExpr, definitions, stats); RegionAttributes ra = region.getAttributes(); if (IndexManager.isObjectModificationInplace()) { entryToValuesMap = new ConcurrentHashMap(ra.getInitialCapacity(), ra.getLoadFactor(), ra.getConcurrencyLevel()); } else { if (entryToOldKeysMap == null) { entryToOldKeysMap = new ThreadLocal<Object2ObjectOpenHashMap>(); } } entriesSet = new HashIndexSet(); }
/** * Create an Range Index that can be used when executing queries. * * @param indexName the name of this index, used for statistics collection * @param indexedExpression the expression to index on, a function dependent on region entries * individually. * @param fromClause expression that evaluates to the collection(s) that will be queried over, * must contain one and only one region path. * @param projectionAttributes expression that transforms each element in the result set of a * query Return the newly created Index */ public RangeIndex(InternalCache cache, String indexName, Region region, String fromClause, String indexedExpression, String projectionAttributes, String origFromClause, String origIndexExpr, String[] definitions, IndexStatistics stats) { super(cache, indexName, region, fromClause, indexedExpression, projectionAttributes, origFromClause, origIndexExpr, definitions, stats); RegionAttributes ra = region.getAttributes(); this.entryToValuesMap = new RegionEntryToValuesMap( new java.util.concurrent.ConcurrentHashMap(ra.getInitialCapacity(), ra.getLoadFactor(), ra.getConcurrencyLevel()), false /* use set */); nullMappedEntries = new RegionEntryToValuesMap(true /* use list */); undefinedMappedEntries = new RegionEntryToValuesMap(true /* use list */); }
allCustomIdle.add(ra.getCustomEntryIdleTimeout().toString()); allScopes.add(ra.getScope()); allLoadFactors.add(new Float(ra.getLoadFactor())); allInitialCaps.add(Integer.valueOf(ra.getInitialCapacity())); allConcLevels.add(Integer.valueOf(ra.getConcurrencyLevel()));
when(regionAttributes.getDiskStoreName()).thenReturn("store"); when(regionAttributes.getConcurrencyLevel()).thenReturn(16); when(regionAttributes.getLoadFactor()).thenReturn(0.75f); when(regionAttributes.getMembershipAttributes()).thenReturn(membershipAttributes); when(regionAttributes.getScope()).thenReturn(scope);
"Value Constraints are not the same"); if (this.loadFactor != other.getLoadFactor()) { throw new RuntimeException( "Load Factors are not the same");
indexMaintenanceSynchronous = ra.getIndexMaintenanceSynchronous(); initialCapacity = ra.getInitialCapacity(); loadFactor = ra.getLoadFactor(); multicastEnabled = ra.getMulticastEnabled(); poolName = ra.getPoolName();
String scope = regAttrs.getScope().toString(); int initialCapacity = regAttrs.getInitialCapacity(); float loadFactor = regAttrs.getLoadFactor(); boolean lockGrantor = regAttrs.isLockGrantor(); boolean multicastEnabled = regAttrs.getMulticastEnabled();
if (generateDefaults() || attrs.getLoadFactor() != 0.75f) atts.addAttribute("", "", LOAD_FACTOR, "", String.valueOf(attrs.getLoadFactor()));
|| raLruLimit != getLruLimit() || ra.getConcurrencyLevel() != getConcurrencyLevel() || ra.getInitialCapacity() != getInitialCapacity() || ra.getLoadFactor() != getLoadFactor() || ra.getStatisticsEnabled() != getStatisticsEnabled() || offHeap != getOffHeap() || !hasSameCompressor(ra)) { ra.getInitialCapacity(), ra.getLoadFactor(), ra.getStatisticsEnabled(), isBucket, flags, partitionName, startingBucketId, compressorClassName, offHeap);
this.keyConstraint = attrs.getKeyConstraint(); this.valueConstraint = attrs.getValueConstraint(); this.loadFactor = attrs.getLoadFactor(); this.regionIdleTimeout = attrs.getRegionIdleTimeout(); this.regionTimeToLive = attrs.getRegionTimeToLive();
this.valueConstraint = attrs.getValueConstraint(); this.initialCapacity = attrs.getInitialCapacity(); this.loadFactor = attrs.getLoadFactor(); this.concurrencyLevel = attrs.getConcurrencyLevel(); this.setConcurrencyChecksEnabled(
this.regionAttributes.valueConstraint = regionAttributes.getValueConstraint(); this.regionAttributes.initialCapacity = regionAttributes.getInitialCapacity(); this.regionAttributes.loadFactor = regionAttributes.getLoadFactor(); this.regionAttributes.concurrencyLevel = regionAttributes.getConcurrencyLevel(); this.regionAttributes.concurrencyChecksEnabled = regionAttributes.getConcurrencyChecksEnabled();
this.concurrencyLevel = attr.getConcurrencyLevel(); this.concurrencyChecksEnabled = attr.getConcurrencyChecksEnabled(); this.loadFactor = attr.getLoadFactor(); this.initialCapacity = attr.getInitialCapacity(); this.earlyAck = attr.getEarlyAck();
assertNull(attrs.getKeyConstraint()); assertEquals(16, attrs.getInitialCapacity()); assertEquals(0.75, attrs.getLoadFactor(), 0.0); assertFalse(attrs.getStatisticsEnabled()); assertFalse(attrs.getPersistBackup());
if (parentIsUserSpecified) { if (parentWithHas.hasLoadFactor()) { setLoadFactor(parent.getLoadFactor()); setLoadFactor(parent.getLoadFactor());