IN - the type of the incoming data pointspublic class CountEvictionPolicy<IN> extends Object implements CloneableEvictionPolicy<IN>
ActiveEvictionPolicyWrapper to make it count even fake elements.| Constructor and Description |
|---|
CountEvictionPolicy(int maxElements)
This constructor allows the setup of the simplest possible count based
eviction.
|
CountEvictionPolicy(int maxElements,
int deleteOnEviction)
This constructor allows to set up both, the maximum number of elements
and the number of elements to be deleted in case of an eviction.
|
CountEvictionPolicy(int maxElements,
int deleteOnEviction,
int startValue)
The same as
CountEvictionPolicy(int, int). |
| Modifier and Type | Method and Description |
|---|---|
CountEvictionPolicy<IN> |
clone()
This method should return an exact copy of the object it belongs to
including the current object state.
|
boolean |
equals(Object other) |
int |
getDeleteOnEviction() |
int |
getStart() |
int |
getWindowSize() |
int |
notifyEviction(IN datapoint,
boolean triggered,
int bufferSize)
Proves if and how many elements should be deleted from the element
buffer.
|
String |
toString() |
public CountEvictionPolicy(int maxElements)
maxElements - The maximum number of elements before eviction. As soon as one
more element arrives, the oldest element will be deletedpublic CountEvictionPolicy(int maxElements,
int deleteOnEviction)
maxElements - maxElements The maximum number of elements before eviction.deleteOnEviction - The number of elements to be deleted on eviction. The counter
will be adjusted respectively but never below zero.public CountEvictionPolicy(int maxElements,
int deleteOnEviction,
int startValue)
CountEvictionPolicy(int, int).
Additionally a custom start value for the counter of arriving elements
can be set. By setting a negative start value the first eviction can be
delayed.maxElements - maxElements The maximum number of elements before eviction.deleteOnEviction - The number of elements to be deleted on eviction. The counter
will be adjusted respectively but never below zero.startValue - A custom start value for the counter of arriving elements.CountEvictionPolicy(int, int)public int notifyEviction(IN datapoint, boolean triggered, int bufferSize)
EvictionPolicynotifyEviction in interface EvictionPolicy<IN>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 CountEvictionPolicy<IN> clone()
CloneableEvictionPolicyclone in interface CloneableEvictionPolicy<IN>clone in class Objectpublic int getWindowSize()
public int getStart()
public int getDeleteOnEviction()
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.