DATA - The type of the incoming data points which are processed by this
policy.public class TimeEvictionPolicy<DATA> extends Object implements ActiveEvictionPolicy<DATA>, CloneableEvictionPolicy<DATA>
Timestamp implementation. A
point in time is always represented as long. Therefore, the granularity can
be set as long value as well.| Constructor and Description |
|---|
TimeEvictionPolicy(long granularity,
TimestampWrapper<DATA> timestampWrapper)
This eviction policy evicts all elements which are older than a specified
time.
|
| Modifier and Type | Method and Description |
|---|---|
TimeEvictionPolicy<DATA> |
clone()
This method should return an exact copy of the object it belongs to
including the current object state.
|
boolean |
equals(Object other) |
TimestampWrapper<DATA> |
getTimeStampWrapper() |
long |
getWindowSize() |
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.
|
String |
toString() |
public TimeEvictionPolicy(long granularity,
TimestampWrapper<DATA> timestampWrapper)
Timestamp
implementation. A point in time is always represented as long. Therefore,
the granularity can be set as long value as well. If this value is set to
2 the policy will evict all elements which are older as 2.
while (time(firstInBuffer)granularity - The granularity of the eviction. If this value is set to 2 the
policy will evict all elements which are older as 2(if
(time(X)timestampWrapper - The TimestampWrapper to measure the time with. This
can be either user defined of provided by the API.public 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)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 TimeEvictionPolicy<DATA> clone()
CloneableEvictionPolicyclone in interface CloneableEvictionPolicy<DATA>clone in class Objectpublic long getWindowSize()
public TimestampWrapper<DATA> getTimeStampWrapper()
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.