类 WatermarkCountEvictionPolicy<T>

java.lang.Object
org.apache.pulsar.functions.windowing.evictors.WatermarkCountEvictionPolicy<T>
类型参数:
T - the type of event tracked by this policy.
所有已实现的接口:
EvictionPolicy<T,org.apache.commons.lang3.tuple.Pair<Long,Long>>

public class WatermarkCountEvictionPolicy<T> extends Object implements EvictionPolicy<T,org.apache.commons.lang3.tuple.Pair<Long,Long>>
An eviction policy that tracks count based on watermark ts and evicts events up to the watermark based on a threshold count.
  • 字段详细资料

    • threshold

      protected final int threshold
    • currentCount

      protected final AtomicLong currentCount
  • 构造器详细资料

    • WatermarkCountEvictionPolicy

      public WatermarkCountEvictionPolicy(int count)
  • 方法详细资料

    • evict

      public EvictionPolicy.Action evict(Event<T> event)
      从接口复制的说明: EvictionPolicy
      Decides if an event should be expired from the window, processed in the current window or kept for later processing.
      指定者:
      evict 在接口中 EvictionPolicy<T,org.apache.commons.lang3.tuple.Pair<Long,Long>>
      参数:
      event - the input event
      返回:
      the EvictionPolicy.Action to be taken based on the input event
    • track

      public void track(Event<T> event)
      从接口复制的说明: EvictionPolicy
      Tracks the event to later decide whether EvictionPolicy.evict(Event) should evict it or not.
      指定者:
      track 在接口中 EvictionPolicy<T,org.apache.commons.lang3.tuple.Pair<Long,Long>>
      参数:
      event - the input event to be tracked
    • getContext

      public EvictionContext getContext()
      从接口复制的说明: EvictionPolicy
      Returns the current context that is part of this eviction policy.
      指定者:
      getContext 在接口中 EvictionPolicy<T,org.apache.commons.lang3.tuple.Pair<Long,Long>>
      返回:
      the eviction context
    • setContext

      public void setContext(EvictionContext context)
      从接口复制的说明: EvictionPolicy
      Sets 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,org.apache.commons.lang3.tuple.Pair<Long,Long>>
      参数:
      context - the eviction context
    • reset

      public void reset()
      从接口复制的说明: EvictionPolicy
      Resets the eviction policy.
      指定者:
      reset 在接口中 EvictionPolicy<T,org.apache.commons.lang3.tuple.Pair<Long,Long>>
    • getState

      public org.apache.commons.lang3.tuple.Pair<Long,Long> getState()
      从接口复制的说明: EvictionPolicy
      Return runtime state to be checkpointed by the framework for restoring the eviction policy in case of failures.
      指定者:
      getState 在接口中 EvictionPolicy<T,org.apache.commons.lang3.tuple.Pair<Long,Long>>
      返回:
      the state
    • restoreState

      public void restoreState(org.apache.commons.lang3.tuple.Pair<Long,Long> state)
      从接口复制的说明: EvictionPolicy
      Restore the eviction policy from the state that was earlier checkpointed by the framework.
      指定者:
      restoreState 在接口中 EvictionPolicy<T,org.apache.commons.lang3.tuple.Pair<Long,Long>>
      参数:
      state - the state
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object