public float getLoadFactor() { return this.ra.getLoadFactor(); }
public float getLoadFactor() { return this.ra.getLoadFactor(); }
CompactMapRangeIndex(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(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()); }
CompactMapRangeIndex(String indexName, Region region, String fromClause, String indexedExpression, String projectionAttributes, String origFromClause, String origIndxExpr, String[] defintions, boolean isAllKeys, String[] multiIndexingKeysPattern, Object[] mapKeys) { super(indexName, region, fromClause, indexedExpression, projectionAttributes, origFromClause, origIndxExpr, defintions, null); this.mapKeyToValueIndex = new ConcurrentHashMap<Object, CompactRangeIndex>(2, 0.75f, 1); 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*/); this.isAllKeys = isAllKeys; this.mapKeys = mapKeys; if (this.isAllKeys) { this.patternStr = new String[] { new StringBuilder(indexedExpression) .deleteCharAt(indexedExpression.length() - 2).toString() }; } else { this.patternStr = multiIndexingKeysPattern; } }
MapRangeIndex(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(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*/); }
MapRangeIndex(String indexName, Region region, String fromClause, String indexedExpression, String projectionAttributes, String origFromClause, String origIndxExpr, String[] defintions, boolean isAllKeys, String[] multiIndexingKeysPattern, Object[] mapKeys) { super(indexName, region, fromClause, indexedExpression, projectionAttributes, origFromClause, origIndxExpr, defintions, null); this.mapKeyToValueIndex = new ConcurrentHashMap<Object, RangeIndex>(2, 0.75f, 1); 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*/); this.isAllKeys = isAllKeys; this.mapKeys = mapKeys; if (this.isAllKeys) { this.patternStr = new String[] { new StringBuilder(indexedExpression) .deleteCharAt(indexedExpression.length() - 2).toString() }; } else { this.patternStr = multiIndexingKeysPattern; } }
public MemoryIndexStore(Region region, InternalIndexStatistics internalIndexStats) { 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; }
public MemoryIndexStore(Region region, InternalIndexStatistics internalIndexStats) { 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; }
/** * 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(String indexName, Region region, String fromClause, String indexedExpression, String projectionAttributes, String origFromClause, String origIndexExpr, String[] definitions, IndexStatistics stats) { super(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*/); }
/** * 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(String indexName, Region region, String fromClause, String indexedExpression, String projectionAttributes, String origFromClause, String origIndexExpr, String[] definitions, IndexStatistics stats) { super(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*/); }
ra.getLoadFactor(), ra.getConcurrencyLevel());
buf.append("\n interestPolicy: " + r.getSubscriptionAttributes()); buf.append("\n keyConstraint: " + r.getKeyConstraint()); buf.append("\n loadFactor: " + r.getLoadFactor()); buf.append("\n lockGrantor: " + r.isLockGrantor()); buf.append("\n membershipAttributes: " + r.getMembershipAttributes());
buf.append("\n interestPolicy: " + r.getSubscriptionAttributes()); buf.append("\n keyConstraint: " + r.getKeyConstraint()); buf.append("\n loadFactor: " + r.getLoadFactor()); buf.append("\n lockGrantor: " + r.isLockGrantor()); buf.append("\n membershipAttributes: " + r.getMembershipAttributes());
public void testSetLoadFactor() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setLoadFactor(77.7f).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(77.7f, ra.getLoadFactor()); } finally { cleanUpRegion(r1); } }
public void testSetLoadFactor() throws CacheException, IOException { ClientCache c = new ClientCacheFactory().create(); Region r1 = null; try { ClientRegionFactory factory = c.createClientRegionFactory(CACHING_PROXY); r1 = factory.setLoadFactor(77.7f).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(77.7f, ra.getLoadFactor()); } finally { cleanUpRegion(r1); } }
rd.setInterestPolicy(ra.getSubscriptionAttributes()); rd.setKeyConstraint(ra.getKeyConstraint()); rd.setLoadFactor(Float.valueOf(ra.getLoadFactor())); rd.setLockGrantor(Boolean.valueOf(ra.isLockGrantor())); rd.setMembershipAttributes(ra.getMembershipAttributes());
public static void assertEquals(RegionAttributes ra1, RegionAttributes ra2) { assertEquals(ra1.getScope(), ra2.getScope()); assertEquals(ra1.getKeyConstraint(), ra2.getKeyConstraint()); assertEquals(ra1.getValueConstraint(), ra2.getValueConstraint()); assertEquals(ra1.getCacheListener(), ra2.getCacheListener()); assertEquals(ra1.getCacheWriter(), ra2.getCacheWriter()); assertEquals(ra1.getCacheLoader(), ra2.getCacheLoader()); assertEquals(ra1.getStatisticsEnabled(), ra2.getStatisticsEnabled()); assertEquals(ra1.getConcurrencyLevel(), ra2.getConcurrencyLevel()); assertEquals(ra1.getInitialCapacity(), ra2.getInitialCapacity()); assertTrue(ra1.getLoadFactor() == ra2.getLoadFactor()); assertEquals(ra1.getEarlyAck(), ra2.getEarlyAck()); assertEquals(ra1.isDiskSynchronous(), ra2.isDiskSynchronous()); assertEquals(ra1.getDiskStoreName(), ra2.getDiskStoreName()); }
public static void assertEquals(RegionAttributes ra1, RegionAttributes ra2) { assertEquals(ra1.getScope(), ra2.getScope()); assertEquals(ra1.getKeyConstraint(), ra2.getKeyConstraint()); assertEquals(ra1.getValueConstraint(), ra2.getValueConstraint()); assertEquals(ra1.getCacheListener(), ra2.getCacheListener()); assertEquals(ra1.getCacheWriter(), ra2.getCacheWriter()); assertEquals(ra1.getCacheLoader(), ra2.getCacheLoader()); assertEquals(ra1.getStatisticsEnabled(), ra2.getStatisticsEnabled()); assertEquals(ra1.getConcurrencyLevel(), ra2.getConcurrencyLevel()); assertEquals(ra1.getInitialCapacity(), ra2.getInitialCapacity()); assertTrue(ra1.getLoadFactor() == ra2.getLoadFactor()); assertEquals(ra1.getEarlyAck(), ra2.getEarlyAck()); assertEquals(ra1.isDiskSynchronous(), ra2.isDiskSynchronous()); assertEquals(ra1.getDiskStoreName(), ra2.getDiskStoreName()); }
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());