public static long getCounterForBuckets(String prRegionName) { long bucketSize = 0; final PartitionedRegion pr = (PartitionedRegion)cache .getRegion(prRegionName); for (final Iterator i = pr.getDataStore().getAllLocalBuckets().iterator(); i .hasNext();) { final Map.Entry entry = (Map.Entry)i.next(); final BucketRegion bucketRegion = (BucketRegion)entry.getValue(); if (bucketRegion == null) { continue; } getLogWriter().info( "Size of bucket " + bucketRegion.getName() + "of Pr " + prRegionName + " = " + bucketRegion.getCounter() / (1000000)); bucketSize = bucketSize + bucketRegion.getCounter(); } return bucketSize; }
/** * return the current size of all the entries. * * @return The current size of all the entries. */ protected final long getTotalEntrySize() { if (_getOwnerObject() instanceof BucketRegion) { BucketRegion bucketRegion = (BucketRegion)_getOwner(); return bucketRegion.getCounter(); } return _getLruList().stats().getCounter(); }
/** * return the current size of all the entries. * * @return The current size of all the entries. */ protected final long getTotalEntrySize() { if (_getOwnerObject() instanceof BucketRegion) { BucketRegion bucketRegion = (BucketRegion)_getOwner(); return bucketRegion.getCounter(); } return _getLruList().stats().getCounter(); }
/** * Releases resources obtained by this <code>LRUAlgorithm</code> */ public void close() { if (this.stats != null) { if (bucketRegion != null) { this.stats.incEvictions(bucketRegion.getEvictions() * -1); this.stats.decrementCounter(bucketRegion.getCounter()); bucketRegion.close(); } else { this.stats.close(); } } }
} /** * called when an LRU map is cleared... resets stats and releases prev and next. */ public void clear(RegionVersionVector rvv) { if (rvv != null) { return; // when concurrency checks are enabled the clear operation removes entries iteratively } synchronized (this.lock ) { if (bucketRegion!=null) { this.stats.decrementCounter(bucketRegion.getCounter()); bucketRegion.resetCounter(); } else { this.stats.resetCounter(); } initHeadAndTail(); // LRUClockNode node = this.tail; // node.setEvicted(); // // // NYI need to walk the list and call unsetInList for each one. // // // tail's next should already be null. // setHead( node ); } }
/** * Releases resources obtained by this <code>LRUAlgorithm</code> */ public void close() { if (this.stats != null) { if (bucketRegion != null) { this.stats.incEvictions(bucketRegion.getEvictions() * -1); this.stats.decrementCounter(bucketRegion.getCounter()); bucketRegion.close(); } else { this.stats.close(); } } }
} /** * called when an LRU map is cleared... resets stats and releases prev and next. */ public void clear(RegionVersionVector rvv) { if (rvv != null) { return; // when concurrency checks are enabled the clear operation removes entries iteratively } synchronized (this.lock ) { if (bucketRegion!=null) { this.stats.decrementCounter(bucketRegion.getCounter()); bucketRegion.resetCounter(); } else { this.stats.resetCounter(); } initHeadAndTail(); // LRUClockNode node = this.tail; // node.setEvicted(); // // // NYI need to walk the list and call unsetInList for each one. // // // tail's next should already be null. // setHead( node ); } }
continue; assertEquals(bucketRegion.getCounter(), 10); bucketSize = bucketSize + (bucketRegion.getCounter()); continue; assertEquals(bucketRegion.getCounter(), 10); bucketSize = bucketSize + (bucketRegion.getCounter()); region.destroy(key); assertEquals(bucketRegion.getCounter(), 0); break;
public NewLRUClockHand( Region region, EnableLRU ccHelper, NewLRUClockHand oldList) { setBucketRegion(region); this.lock = new HeadLock(); // behavior relies on a single evicted node in the pipe when the pipe is empty. initHeadAndTail(); if (oldList.stats == null) { // see bug 41388 StatisticsFactory sf = region.getCache().getDistributedSystem(); this.stats = ccHelper.initStats(region, sf); } else { this.stats = oldList.stats; if (this.bucketRegion != null) { this.stats.decrementCounter(this.bucketRegion.getCounter()); this.bucketRegion.resetCounter(); } else { this.stats.resetCounter(); } } }
public NewLRUClockHand( Region region, EnableLRU ccHelper ,NewLRUClockHand oldList) { setBucketRegion(region); this.lock = new HeadLock(); // behavior relies on a single evicted node in the pipe when the pipe is empty. if ( NewLRUClockHand.debug ) { NewLRUClockHand.logWriter = region.getCache().getDistributedSystem().getLogWriter().convertToLogWriterI18n(); } initHeadAndTail(); if (oldList.stats == null) { // see bug 41388 StatisticsFactory sf = region.getCache().getDistributedSystem(); this.stats = ccHelper.initStats(region, sf); } else { this.stats = oldList.stats; if (this.bucketRegion != null) { this.stats.decrementCounter(this.bucketRegion.getCounter()); this.bucketRegion.resetCounter(); } else { this.stats.resetCounter(); } } }
count = count + localBucket.getCounter();