类 TimeEvictionPolicy<T>
java.lang.Object
org.apache.pulsar.functions.windowing.evictors.TimeEvictionPolicy<T>
- 所有已实现的接口:
EvictionPolicy<T,EvictionContext>
- 直接已知子类:
WatermarkTimeEvictionPolicy
Eviction policy that evicts events based on time duration.
-
嵌套类概要
从接口继承的嵌套类/接口 org.apache.pulsar.functions.windowing.EvictionPolicy
EvictionPolicy.Action -
字段概要
字段 -
构造器概要
构造器构造器说明TimeEvictionPolicy(long windowLength) Constructs a TimeEvictionPolicy that evicts events older than the given window length in millis. -
方法概要
修饰符和类型方法说明Decides if an event should be expired from the window, processed in the current window or kept for later processing.Returns the current context that is part of this eviction policy.getState()Return runtime state to be checkpointed by the framework for restoring the eviction policy in case of failures.voidreset()Resets the eviction policy.voidrestoreState(EvictionContext state) Restore the eviction policy from the state that was earlier checkpointed by the framework.voidsetContext(EvictionContext context) Sets a context in the eviction policy that can be used while evicting the events.toString()voidTracks the event to later decide whetherEvictionPolicy.evict(Event)should evict it or not.
-
字段详细资料
-
evictionContext
-
-
构造器详细资料
-
TimeEvictionPolicy
public TimeEvictionPolicy(long windowLength) Constructs a TimeEvictionPolicy that evicts events older than the given window length in millis.- 参数:
windowLength- the duration in milliseconds
-
-
方法详细资料
-
evict
Decides if an event should be expired from the window, processed in the current window or kept for later processing.- 指定者:
evict在接口中EvictionPolicy<T,EvictionContext> - 参数:
event- the input event- 返回:
- the
EvictionPolicy.Actionto be taken based on the input event
-
track
从接口复制的说明:EvictionPolicyTracks the event to later decide whetherEvictionPolicy.evict(Event)should evict it or not.- 指定者:
track在接口中EvictionPolicy<T,EvictionContext> - 参数:
event- the input event to be tracked
-
setContext
从接口复制的说明:EvictionPolicySets a context in the eviction policy that can be used while evicting the events. E.g. For TimeEvictionPolicy, this could be used to set the reference timestamp.- 指定者:
setContext在接口中EvictionPolicy<T,EvictionContext> - 参数:
context- the eviction context
-
getContext
从接口复制的说明:EvictionPolicyReturns the current context that is part of this eviction policy.- 指定者:
getContext在接口中EvictionPolicy<T,EvictionContext> - 返回:
- the eviction context
-
reset
public void reset()从接口复制的说明:EvictionPolicyResets the eviction policy.- 指定者:
reset在接口中EvictionPolicy<T,EvictionContext>
-
getState
从接口复制的说明:EvictionPolicyReturn runtime state to be checkpointed by the framework for restoring the eviction policy in case of failures.- 指定者:
getState在接口中EvictionPolicy<T,EvictionContext> - 返回:
- the state
-
restoreState
从接口复制的说明:EvictionPolicyRestore the eviction policy from the state that was earlier checkpointed by the framework.- 指定者:
restoreState在接口中EvictionPolicy<T,EvictionContext> - 参数:
state- the state
-
toString
-