Github user davidyan74 commented on a diff in the pull request: https://github.com/apache/apex-malhar/pull/319#discussion_r67760438 --- Diff: stream/src/main/java/org/apache/apex/malhar/stream/window/impl/WindowedOperatorImpl.java --- @@ -0,0 +1,436 @@ +package org.apache.apex.malhar.stream.window.impl; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import com.datatorrent.api.Context; +import com.datatorrent.api.DefaultInputPort; +import com.datatorrent.api.DefaultOutputPort; +import com.datatorrent.common.util.BaseOperator; +import com.datatorrent.stram.engine.WindowGenerator; +import com.datatorrent.stram.plan.logical.LogicalPlan; +import org.apache.apex.malhar.stream.api.function.Function; +import org.apache.apex.malhar.stream.window.Accumulation; +import org.apache.apex.malhar.stream.window.SessionWindowedStorage; +import org.apache.apex.malhar.stream.window.WindowedStorage; +import org.apache.apex.malhar.stream.window.TriggerOption; +import org.apache.apex.malhar.stream.window.Watermark; +import org.apache.apex.malhar.stream.window.Window; +import org.apache.apex.malhar.stream.window.WindowOption; +import org.apache.apex.malhar.stream.window.WindowState; +import org.apache.apex.malhar.stream.window.WindowedOperator; +import org.joda.time.Duration; + + +/** + * Created by david on 6/13/16. + */ +public class WindowedOperatorImpl<InputT, KeyT, AccumT, OutputT> + extends BaseOperator implements WindowedOperator<InputT, KeyT, AccumT, OutputT> +{ + // TODO: Need further discussion on the type parameters. InputT and OuputT may be a watermark, a KV pair, a WindowedValue, or a plain data object + + private WindowOption windowOption; + private Accumulation<InputT, AccumT, OutputT> accumulation; + private WindowedStorage<KeyT, AccumT> dataStorage; + private WindowedStorage<KeyT, AccumT> retractionStorage; + + private TreeMap<Window, WindowState> windowStateMap = new TreeMap<>(); --- End diff -- I have abstracted out the storage for the window state
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---