IN - The type of the data points which are handled by this policypublic class CountTriggerPolicy<IN> extends Object implements CloneableTriggerPolicy<IN>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_START_VALUE |
| Constructor and Description |
|---|
CountTriggerPolicy(int max)
This constructor will set up a count based trigger, which triggers after
max elements have arrived.
|
CountTriggerPolicy(int max,
int startValue)
In addition to
CountTriggerPolicy(int) this
constructor allows to set a custom start value for the element counter. |
| Modifier and Type | Method and Description |
|---|---|
CountTriggerPolicy<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 |
getSlideSize() |
int |
getStart() |
boolean |
notifyTrigger(IN datapoint)
Proves and returns if a new window should be started.
|
String |
toString() |
public static final int DEFAULT_START_VALUE
public CountTriggerPolicy(int max)
max - The number of arriving elements before the trigger occurs.public CountTriggerPolicy(int max,
int startValue)
CountTriggerPolicy(int) this
constructor allows to set a custom start value for the element counter.
This can be used to delay the first trigger by setting a negative start
value. Often the first trigger should be delayed in case of sliding
windows. For example if the size of a window should be 4 and a trigger
should happen every 2, a start value of -2 would allow to also have the
first window of size 4.max - The number of arriving elements before the trigger occurs.startValue - The start value for the counter of arriving elements.CountTriggerPolicy(int)public boolean notifyTrigger(IN datapoint)
TriggerPolicynotifyTrigger in interface TriggerPolicy<IN>datapoint - the data point which arrivedpublic CountTriggerPolicy<IN> clone()
CloneableTriggerPolicyclone in interface CloneableTriggerPolicy<IN>clone in class Objectpublic int getSlideSize()
public int getStart()
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.