use of edu.iu.dsc.tws.examples.ml.svm.util.WindowArguments in project twister2 by DSC-SPIDAL.
the class SvmSgdOnlineRunner method getWindowSinkInstance.
private BaseWindowedSink getWindowSinkInstance() {
BaseWindowedSink baseWindowedSink = new IterativeStreamingWindowedCompute(new ProcessWindowFunctionImpl(), OperationMode.STREAMING, this.svmJobParameters, this.binaryBatchModel, "online-training-graph");
WindowArguments windowArguments = this.svmJobParameters.getWindowArguments();
TimeUnit timeUnit = TimeUnit.MICROSECONDS;
if (windowArguments != null) {
WindowType windowType = windowArguments.getWindowType();
if (windowArguments.isDuration()) {
if (windowType.equals(WindowType.TUMBLING)) {
baseWindowedSink.withTumblingDurationWindow(windowArguments.getWindowLength(), timeUnit);
}
if (windowType.equals(WindowType.SLIDING)) {
baseWindowedSink.withSlidingDurationWindow(windowArguments.getWindowLength(), timeUnit, windowArguments.getSlidingLength(), timeUnit);
}
} else {
if (windowType.equals(WindowType.TUMBLING)) {
baseWindowedSink.withTumblingCountWindow(windowArguments.getWindowLength());
}
if (windowType.equals(WindowType.SLIDING)) {
baseWindowedSink.withSlidingCountWindow(windowArguments.getWindowLength(), windowArguments.getSlidingLength());
}
}
}
return baseWindowedSink;
}
Aggregations