/** * access the getHelper method on the eviction controller to initialize * the ccHelper field. * * @param ec The governing eviction controller. * @return the helper instance from the eviction controller. */ private static EnableLRU getHelper( LRUAlgorithm ec ) { return ec.getLRUHelper(); } @Override
/** * Used to hook up a bucketRegion late during disk recover. */ public void setBucketRegion(Region r) { if (r instanceof BucketRegion) { this.bucketRegion = (BucketRegion)r; this.bucketRegion.setLimit(getLimit()); } } /**
@Override public void close() { super.close(); }
/** * Creates a new <code>LRUAlgorithm</code> with the given * {@linkplain EvictionAction eviction action}. */ protected LRUAlgorithm(EvictionAction evictionAction,Region region) { bucketRegion=(BucketRegion)(region instanceof BucketRegion ? region :null); setEvictionAction(evictionAction); this.helper = createLRUHelper(); }
@Override public int hashCode() { int result = super.hashCode(); return result; }
@Override public boolean equals(Object cc) { if (!super.equals(cc)) return false; MemLRUCapacityController other = (MemLRUCapacityController)cc; if (this.limit != other.limit) return false; return true; }
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { synchronized (this) { // See bug 31047 this.evictionAction = (EvictionAction) in.readObject(); this.helper = createLRUHelper(); } }
public void setMaximum(int maximum) { this.maximum = maximum; if (this.evictionController != null) { this.evictionController.setLimit(this.maximum); } }
@Override public void changeOwner(LocalRegion r, InternalRegionArguments args) { super.changeOwner(r, args); _getLruList().setBucketRegion(r); this.evictionController.setBucketRegion(r); }
/** * Creates a new <code>LRUAlgorithm</code> with the given * {@linkplain EvictionAction eviction action}. */ protected LRUAlgorithm(EvictionAction evictionAction,Region region) { bucketRegion=(BucketRegion)(region instanceof BucketRegion ? region :null); setEvictionAction(evictionAction); this.helper = createLRUHelper(); }
@Override public int hashCode() { int result = super.hashCode(); result += this.maximumEntries; return result; }
@Override public boolean equals(Object cc) { if (!super.equals(cc)) return false; return true; }
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { synchronized (this) { // See bug 31047 this.evictionAction = (EvictionAction) in.readObject(); this.helper = createLRUHelper(); } }
public void setMaximum(int maximum) { this.maximum = maximum; if (this.evictionController != null) { this.evictionController.setLimit(this.maximum); } }
@Override public void changeOwner(LocalRegion r) { super.changeOwner(r); _getLruList().setBucketRegion(r); this.evictionController.setBucketRegion(r); }
/** * access the getHelper method on the eviction controller to initialize * the ccHelper field. * * @param ec The governing eviction controller. * @return the helper instance from the eviction controller. */ private static EnableLRU getHelper( LRUAlgorithm ec ) { return ec.getLRUHelper(); } @Override
/** * Used to hook up a bucketRegion late during disk recover. */ public void setBucketRegion(Region r) { if (r instanceof BucketRegion) { this.bucketRegion = (BucketRegion)r; this.bucketRegion.setLimit(getLimit()); } } /**
@Override public int hashCode() { int result = super.hashCode(); return result; }
@Override public boolean equals(Object cc) { if (!super.equals(cc)) return false; if (!(cc instanceof LRUCapacityController)) return false; LRUCapacityController other = (LRUCapacityController)cc; if (this.maximumEntries != other.maximumEntries) return false; return true; }
/** * Returns a copy of this LRU-based eviction controller. * This method is a artifact when capacity controllers * were used on a <code>Region</code> */ @Override public Object clone() throws CloneNotSupportedException { synchronized (this) { LRUAlgorithm clone = (LRUAlgorithm) super.clone(); clone.stats = null; synchronized (clone) { clone.helper = clone.createLRUHelper(); } return clone; } }