Search in sources :

Example 1 with InMemoryWindowedStorage

use of org.apache.apex.malhar.lib.window.impl.InMemoryWindowedStorage in project apex-malhar by apache.

the class AbstractWindowedOperatorBenchmarkApp method createWindowedOperator.

protected O createWindowedOperator(Configuration conf) {
    SpillableStateStore store = createStore(conf);
    try {
        O windowedOperator = this.windowedOperatorClass.newInstance();
        SpillableComplexComponentImpl sccImpl = new SpillableComplexComponentImpl(store);
        windowedOperator.addComponent("SpillableComplexComponent", sccImpl);
        windowedOperator.setDataStorage(createDataStorage(sccImpl));
        windowedOperator.setRetractionStorage(createRetractionStorage(sccImpl));
        windowedOperator.setWindowStateStorage(new InMemoryWindowedStorage());
        setUpdatedKeyStorage(windowedOperator, conf, sccImpl);
        windowedOperator.setAccumulation(createAccumulation());
        windowedOperator.setAllowedLateness(Duration.millis(ALLOWED_LATENESS));
        windowedOperator.setWindowOption(new WindowOption.TimeWindows(Duration.standardMinutes(1)));
        // accumulating mode
        windowedOperator.setTriggerOption(TriggerOption.AtWatermark().withEarlyFiringsAtEvery(Duration.standardSeconds(1)).accumulatingFiredPanes().firingOnlyUpdatedPanes());
        windowedOperator.setFixedWatermark(30000);
        return windowedOperator;
    } catch (Exception e) {
        throw Throwables.propagate(e);
    }
}
Also used : WindowOption(org.apache.apex.malhar.lib.window.WindowOption) InMemoryWindowedStorage(org.apache.apex.malhar.lib.window.impl.InMemoryWindowedStorage) ManagedTimeUnifiedStateSpillableStateStore(org.apache.apex.malhar.lib.state.spillable.managed.ManagedTimeUnifiedStateSpillableStateStore) SpillableStateStore(org.apache.apex.malhar.lib.state.spillable.SpillableStateStore) IOException(java.io.IOException) SpillableComplexComponentImpl(org.apache.apex.malhar.lib.state.spillable.SpillableComplexComponentImpl)

Aggregations

IOException (java.io.IOException)1 SpillableComplexComponentImpl (org.apache.apex.malhar.lib.state.spillable.SpillableComplexComponentImpl)1 SpillableStateStore (org.apache.apex.malhar.lib.state.spillable.SpillableStateStore)1 ManagedTimeUnifiedStateSpillableStateStore (org.apache.apex.malhar.lib.state.spillable.managed.ManagedTimeUnifiedStateSpillableStateStore)1 WindowOption (org.apache.apex.malhar.lib.window.WindowOption)1 InMemoryWindowedStorage (org.apache.apex.malhar.lib.window.impl.InMemoryWindowedStorage)1