@Override public int getInitialCapacity() { return this.ra.getInitialCapacity(); }
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 */); }
allScopes.add(ra.getScope()); allLoadFactors.add(new Float(ra.getLoadFactor())); allInitialCaps.add(Integer.valueOf(ra.getInitialCapacity())); allConcLevels.add(Integer.valueOf(ra.getConcurrencyLevel())); allStatsEnabled.add(Boolean.valueOf(ra.getStatisticsEnabled()));
"Enable Async Conflation is not the same"); if (this.initialCapacity != other.getInitialCapacity()) { throw new RuntimeException( "initial Capacity is not the same");
ignoreJTA = ra.getIgnoreJTA(); indexMaintenanceSynchronous = ra.getIndexMaintenanceSynchronous(); initialCapacity = ra.getInitialCapacity(); loadFactor = ra.getLoadFactor(); multicastEnabled = ra.getMulticastEnabled();
String dataPolicy = regAttrs.getDataPolicy().toString(); String scope = regAttrs.getScope().toString(); int initialCapacity = regAttrs.getInitialCapacity(); float loadFactor = regAttrs.getLoadFactor(); boolean lockGrantor = regAttrs.isLockGrantor();
if (generateDefaults() || attrs.getInitialCapacity() != 16) atts.addAttribute("", "", INITIAL_CAPACITY, "", String.valueOf(attrs.getInitialCapacity()));
|| ra.getInitialCapacity() != getInitialCapacity() || ra.getLoadFactor() != getLoadFactor() || ra.getStatisticsEnabled() != getStatisticsEnabled() || offHeap != getOffHeap() ra.getInitialCapacity(), ra.getLoadFactor(), ra.getStatisticsEnabled(), isBucket, flags, partitionName, startingBucketId, compressorClassName, offHeap);
this.entryTimeToLive = attrs.getEntryTimeToLive(); this.customEntryTimeToLive = attrs.getCustomEntryTimeToLive(); this.initialCapacity = attrs.getInitialCapacity(); this.keyConstraint = attrs.getKeyConstraint(); this.valueConstraint = attrs.getValueConstraint();
this.keyConstraint = attrs.getKeyConstraint(); this.valueConstraint = attrs.getValueConstraint(); this.initialCapacity = attrs.getInitialCapacity(); this.loadFactor = attrs.getLoadFactor(); this.concurrencyLevel = attrs.getConcurrencyLevel();
this.regionAttributes.keyConstraint = regionAttributes.getKeyConstraint(); this.regionAttributes.valueConstraint = regionAttributes.getValueConstraint(); this.regionAttributes.initialCapacity = regionAttributes.getInitialCapacity(); this.regionAttributes.loadFactor = regionAttributes.getLoadFactor(); this.regionAttributes.concurrencyLevel = regionAttributes.getConcurrencyLevel();
this.concurrencyChecksEnabled = attr.getConcurrencyChecksEnabled(); this.loadFactor = attr.getLoadFactor(); this.initialCapacity = attr.getInitialCapacity(); this.earlyAck = attr.getEarlyAck(); this.multicastEnabled = attr.getMulticastEnabled();
assertEquals(AttributesFactory.DEFAULT_DISK_SYNCHRONOUS, attrs.isDiskSynchronous()); assertNull(attrs.getKeyConstraint()); assertEquals(16, attrs.getInitialCapacity()); assertEquals(0.75, attrs.getLoadFactor(), 0.0); assertFalse(attrs.getStatisticsEnabled());
if (parentIsUserSpecified) { if (parentWithHas.hasInitialCapacity()) { setInitialCapacity(parent.getInitialCapacity()); setInitialCapacity(parent.getInitialCapacity());
private BiConsumer<Region<?, ?>, Health.Builder> withRegionDetails() { return (region, builder) -> { String regionName = region.getName(); builder.withDetail(cacheRegionKey(regionName, "full-path"), region.getFullPath()); Optional.ofNullable(region.getAttributes()) .ifPresent(regionAttributes -> builder .withDetail(cacheRegionKey(regionName, "cloning-enabled"), toYesNoString(regionAttributes.getCloningEnabled())) .withDetail(cacheRegionKey(regionName, "data-policy"), String.valueOf(regionAttributes.getDataPolicy())) .withDetail(cacheRegionKey(regionName, "initial-capacity"), regionAttributes.getInitialCapacity()) .withDetail(cacheRegionKey(regionName, "load-factor"), regionAttributes.getLoadFactor()) .withDetail(cacheRegionKey(regionName, "key-constraint"), nullSafeClassName(regionAttributes.getKeyConstraint())) .withDetail(cacheRegionKey(regionName, "off-heap"), toYesNoString(regionAttributes.getOffHeap())) .withDetail(cacheRegionKey(regionName, "pool-name"), Optional.ofNullable(regionAttributes.getPoolName()) .filter(StringUtils::hasText) .orElse("")) .withDetail(cacheRegionKey(regionName, "scope"), String.valueOf(regionAttributes.getScope())) .withDetail(cacheRegionKey(regionName, "statistics-enabled"), toYesNoString(regionAttributes.getStatisticsEnabled())) .withDetail(cacheRegionKey(regionName, "value-constraint"), nullSafeClassName(regionAttributes.getValueConstraint()))); }; }