DATA - The data type handled by this policypublic class ActiveEvictionPolicyWrapper<DATA> extends Object implements ActiveEvictionPolicy<DATA>
ActiveEvictionPolicy wraps around a non active
EvictionPolicy. It forwards all calls to
ActiveEvictionPolicy.notifyEvictionWithFakeElement(Object, int) to
EvictionPolicy.notifyEviction(Object, boolean, int) while the
triggered parameter will be set to true.| Constructor and Description |
|---|
ActiveEvictionPolicyWrapper(EvictionPolicy<DATA> nestedPolicy)
Creates a wrapper which activates the eviction policy which is wrapped
in.
|
| Modifier and Type | Method and Description |
|---|---|
int |
notifyEviction(DATA datapoint,
boolean triggered,
int bufferSize)
Proves if and how many elements should be deleted from the element
buffer.
|
int |
notifyEvictionWithFakeElement(Object datapoint,
int bufferSize)
Proves if and how many elements should be deleted from the element
buffer.
|
public ActiveEvictionPolicyWrapper(EvictionPolicy<DATA> nestedPolicy)
nestedPolicy - The policy which should be activated/wrapped in.public int notifyEviction(DATA datapoint, boolean triggered, int bufferSize)
EvictionPolicynotifyEviction in interface EvictionPolicy<DATA>datapoint - data point the data point which arrivedtriggered - Information whether the UDF was triggered or notbufferSize - The current size of the element buffer at the operatorpublic int notifyEvictionWithFakeElement(Object datapoint, int bufferSize)
ActiveEvictionPolicynotifyEvictionWithFakeElement in interface ActiveEvictionPolicy<DATA>datapoint - the current fake data pointbufferSize - the current size of the buffer (only real elements are
counted)Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.