use of org.apache.samza.storage.kv.KeyValueStore in project samza by apache.
the class WindowOperatorImpl method handleInit.
@Override
protected void handleInit(Context context) {
KeyValueStore<TimeSeriesKey<K>, Object> store = (KeyValueStore<TimeSeriesKey<K>, Object>) context.getTaskContext().getStore(windowOpSpec.getOpId());
if (initializer != null) {
initializer.init(context);
}
if (keyFn != null) {
keyFn.init(context);
}
// value. Else, we use the store in append-mode.
if (foldLeftFn != null) {
foldLeftFn.init(context);
timeSeriesStore = new TimeSeriesStoreImpl(store, false);
} else {
timeSeriesStore = new TimeSeriesStoreImpl(store, true);
}
}
Aggregations