public abstract class BaseWindowedSink<T> extends AbstractSingleWindowDataSink<T> implements IWindowCompute<T>, Closable
Modifier and Type | Field and Description |
---|---|
protected WindowConfig.Duration |
allowedLateness |
protected IWindowMessage<T> |
collectiveEvents |
protected T |
collectiveOutput |
protected static long |
DEFAULT_MAX_LAG |
protected static long |
DEFAULT_WATERMARK_INTERVAL |
protected IEvictionPolicy<T> |
evictionPolicy |
protected ITimestampExtractor<T> |
iTimestampExtractor |
protected IWindow |
iWindow |
protected long |
maxLagMs |
protected WatermarkEventGenerator<T> |
watermarkEventGenerator |
protected WindowConfig.Duration |
watermarkInterval |
protected IWindowingPolicy<T> |
windowingPolicy |
protected WindowLifeCycleListener<T> |
windowLifeCycleListener |
protected WindowManager<T> |
windowManager |
protected WindowParameter |
windowParameter |
Modifier | Constructor and Description |
---|---|
protected |
BaseWindowedSink() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close method for cleaning up the resources
|
boolean |
execute(IMessage<T> message)
Execute with an incoming message
|
abstract boolean |
execute(IWindowMessage<T> windowMessage) |
IEvictionPolicy<T> |
getEvictionPolicy(WindowConfig.Count windowLengthCount,
WindowConfig.Duration windowLengthDuration) |
abstract boolean |
getExpire(IWindowMessage<T> expiredMessages) |
abstract boolean |
getLateMessages(IMessage<T> lateMessages) |
IWindowingPolicy<T> |
getWindowingPolicy(WindowConfig.Count slidingIntervalCount,
WindowConfig.Duration slidingIntervalDuration,
WindowManager<T> manager,
IEvictionPolicy<T> policy) |
void |
initialize(TaskContext context) |
protected boolean |
isTimestamped() |
protected WindowLifeCycleListener<T> |
newWindowLifeCycleListener() |
void |
prepare(Config cfg,
TaskContext ctx)
Prepare the task to be executed
|
void |
reset()
Reset the task
|
void |
setPolicies(IWindowStrategy<T> windowStrategy) |
void |
start() |
BaseWindowedSink<T> |
withAllowedLateness(long lateness,
java.util.concurrent.TimeUnit timeUnit) |
BaseWindowedSink<T> |
withCustomTimestampExtractor(ITimestampExtractor timestampExtractor) |
BaseWindowedSink<T> |
withSlidingCountWindow(long windowCount,
long slidingCount) |
BaseWindowedSink<T> |
withSlidingDurationWindow(long windowDuration,
java.util.concurrent.TimeUnit windowTU,
long slidingDuration,
java.util.concurrent.TimeUnit slidingTU) |
BaseWindowedSink<T> |
withTimestampExtractor() |
BaseWindowedSink<T> |
withTumblingCountWindow(long tumblingCount) |
BaseWindowedSink<T> |
withTumblingDurationWindow(long tumblingDuration,
java.util.concurrent.TimeUnit timeUnit) |
BaseWindowedSink<T> |
withWatermarkInterval(long watermarkInt,
java.util.concurrent.TimeUnit timeUnit) |
BaseWindowedSink<T> |
withWindow(IWindow window) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
endExecute
protected static final long DEFAULT_WATERMARK_INTERVAL
protected static final long DEFAULT_MAX_LAG
protected long maxLagMs
protected WindowConfig.Duration watermarkInterval
protected WindowConfig.Duration allowedLateness
protected WindowManager<T> windowManager
protected IWindowingPolicy<T> windowingPolicy
protected WindowParameter windowParameter
protected WindowLifeCycleListener<T> windowLifeCycleListener
protected IEvictionPolicy<T> evictionPolicy
protected IWindow iWindow
protected T collectiveOutput
protected IWindowMessage<T> collectiveEvents
protected ITimestampExtractor<T> iTimestampExtractor
protected WatermarkEventGenerator<T> watermarkEventGenerator
public abstract boolean execute(IWindowMessage<T> windowMessage)
public abstract boolean getExpire(IWindowMessage<T> expiredMessages)
public void prepare(Config cfg, TaskContext ctx)
INode
public void initialize(TaskContext context)
public boolean execute(IMessage<T> message)
ICompute
execute
in interface ICompute<T>
execute
in interface IWindowedSink<T>
execute
in interface IWindowCompute<T>
public BaseWindowedSink<T> withTumblingCountWindow(long tumblingCount)
public BaseWindowedSink<T> withTumblingDurationWindow(long tumblingDuration, java.util.concurrent.TimeUnit timeUnit)
public BaseWindowedSink<T> withSlidingCountWindow(long windowCount, long slidingCount)
public BaseWindowedSink<T> withSlidingDurationWindow(long windowDuration, java.util.concurrent.TimeUnit windowTU, long slidingDuration, java.util.concurrent.TimeUnit slidingTU)
public BaseWindowedSink<T> withCustomTimestampExtractor(ITimestampExtractor timestampExtractor)
public BaseWindowedSink<T> withTimestampExtractor()
public BaseWindowedSink<T> withAllowedLateness(long lateness, java.util.concurrent.TimeUnit timeUnit)
public BaseWindowedSink<T> withWatermarkInterval(long watermarkInt, java.util.concurrent.TimeUnit timeUnit)
public BaseWindowedSink<T> withWindow(IWindow window)
protected WindowLifeCycleListener<T> newWindowLifeCycleListener()
public IWindowingPolicy<T> getWindowingPolicy(WindowConfig.Count slidingIntervalCount, WindowConfig.Duration slidingIntervalDuration, WindowManager<T> manager, IEvictionPolicy<T> policy)
public IEvictionPolicy<T> getEvictionPolicy(WindowConfig.Count windowLengthCount, WindowConfig.Duration windowLengthDuration)
public void setPolicies(IWindowStrategy<T> windowStrategy)
public void start()
public void close()
Closable
public void reset()
Closable
protected boolean isTimestamped()