public int getConcurrencyLevel() { return this.ra.getConcurrencyLevel(); }
public int getConcurrencyLevel() { return this.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, 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 compressor: " + compressorFor(r.getCompressor())); buf.append("\n concurrencyChecksEnabled: " + r.getConcurrencyChecksEnabled()); buf.append("\n concurrencyLevel: " + r.getConcurrencyLevel()); buf.append("\n customEntryIdleTimeout: " + customExpiryFor(r.getCustomEntryIdleTimeout())); buf.append("\n customEntryTimeToLive: " + customExpiryFor(r.getCustomEntryTimeToLive()));
buf.append("\n compressor: " + compressorFor(r.getCompressor())); buf.append("\n concurrencyChecksEnabled: " + r.getConcurrencyChecksEnabled()); buf.append("\n concurrencyLevel: " + r.getConcurrencyLevel()); buf.append("\n customEntryIdleTimeout: " + customExpiryFor(r.getCustomEntryIdleTimeout())); buf.append("\n customEntryTimeToLive: " + customExpiryFor(r.getCustomEntryTimeToLive()));
public void testSetConcurrencyLevel() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setConcurrencyLevel(7).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(7, ra.getConcurrencyLevel()); } finally { cleanUpRegion(r1); } }
public void testSetConcurrencyLevel() throws CacheException, IOException { ClientCache c = new ClientCacheFactory().create(); Region r1 = null; try { ClientRegionFactory factory = c.createClientRegionFactory(CACHING_PROXY); r1 = factory.setConcurrencyLevel(7).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(7, ra.getConcurrencyLevel()); } finally { cleanUpRegion(r1); } }
/** Test to make sure region attributes take */ public void testRegionAttributes() throws CacheException { // @todo for now just test concurrencyLevel, add tests for the rest AttributesFactory factory = new AttributesFactory(); factory.setConcurrencyLevel(60); factory.setConcurrencyChecksEnabled(true); factory.setScope(Scope.DISTRIBUTED_ACK); RegionAttributes attrs = factory.create(); String name = getUniqueName(); Region region = createRegion(name, attrs); assertEquals(60, region.getAttributes().getConcurrencyLevel()); assertTrue("expected concurrencyChecksEnabled to be true", region.getAttributes().getConcurrencyChecksEnabled()); }
rd.setConcurrencyLevel(Integer.valueOf(ra.getConcurrencyLevel()));
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.statsEnabled = attr.getStatisticsEnabled(); this.ignoreJTA = attr.getIgnoreJTA(); this.concurrencyLevel = attr.getConcurrencyLevel(); this.concurrencyChecksEnabled = attr.getConcurrencyChecksEnabled(); this.loadFactor = attr.getLoadFactor();