/** * Sets the limit on the number of entries allowed. This change takes place on * next region operation that could increase the region size. */ public void setMaximumEntries( int maximumEntries ) { if (maximumEntries <= 0 ) throw new IllegalArgumentException(LocalizedStrings.LRUCapacityController_MAXIMUM_ENTRIES_MUST_BE_POSITIVE.toLocalizedString()); this.maximumEntries = maximumEntries; if (bucketRegion != null) { bucketRegion.setLimit(this.maximumEntries); } else if (this.stats != null) { this.stats.setLimit(this.maximumEntries); } }
/** * Sets the limit on the number of entries allowed. This change takes place on * next region operation that could increase the region size. */ public void setMaximumEntries( int maximumEntries ) { if (maximumEntries <= 0 ) throw new IllegalArgumentException(LocalizedStrings.LRUCapacityController_MAXIMUM_ENTRIES_MUST_BE_POSITIVE.toLocalizedString()); this.maximumEntries = maximumEntries; if (bucketRegion != null) { bucketRegion.setLimit(this.maximumEntries); } else if (this.stats != null) { this.stats.setLimit(this.maximumEntries); } }
/** * Reset the maximum allowed limit on memory to use for this region. This * change takes effect on next region operation that could increase the * region's byte size. If the region is shared, this change is seen by all vms * on using the same GemFire shared memory system. */ public void setMaximumMegabytes( int megabytes ) { if (megabytes <= 0) { throw new IllegalArgumentException(LocalizedStrings.MemLRUCapacityController_MEMLRUCONTROLLER_LIMIT_MUST_BE_POSTIVE_0 .toLocalizedString(Integer.valueOf(megabytes))); } this.limit = (megabytes) * ONE_MEG; if (bucketRegion != null) { bucketRegion.setLimit(this.limit); } else if (this.stats != null) { this.stats.setLimit(this.limit); } }
/** * Reset the maximum allowed limit on memory to use for this region. This * change takes effect on next region operation that could increase the * region's byte size. If the region is shared, this change is seen by all vms * on using the same GemFire shared memory system. */ public void setMaximumMegabytes( int megabytes ) { if (megabytes <= 0) { throw new IllegalArgumentException(LocalizedStrings.MemLRUCapacityController_MEMLRUCONTROLLER_LIMIT_MUST_BE_POSTIVE_0 .toLocalizedString(Integer.valueOf(megabytes))); } this.limit = (megabytes) * ONE_MEG; if (bucketRegion != null) { bucketRegion.setLimit(this.limit); } else if (this.stats != null) { this.stats.setLimit(this.limit); } }
public LRUStatistics initStats(Object region, StatisticsFactory sf) { String regionName; if (region instanceof Region) { regionName = ((Region)region).getName(); } else if (region instanceof PlaceHolderDiskRegion) { regionName = ((PlaceHolderDiskRegion)region).getName(); // @todo make it shorter (I think it is the fullPath } else { throw new IllegalStateException("expected Region or PlaceHolderDiskRegion"); } final LRUStatistics stats = new LRUStatistics(sf, "TestLRUStatistics" + regionName, this); stats.setLimit( limit() ); return stats; } }
public LRUStatistics initStats(Object region, StatisticsFactory sf) { setRegionName(region); final LRUStatistics stats = new LRUStatistics(sf, getRegionName(), this); stats.setLimit( LRUAlgorithm.this.getLimit() ); stats.setDestroysLimit( 1000 ); setStats(stats); return stats; }
public LRUStatistics initStats(Object region, StatisticsFactory sf) { setRegionName(region); final LRUStatistics stats = new LRUStatistics(sf, getRegionName(), this); stats.setLimit( LRUAlgorithm.this.getLimit() ); stats.setDestroysLimit( 1000 ); setStats(stats); return stats; }