Search in sources :

Example 1 with ManagedTimeUnifiedStateImpl

use of org.apache.apex.malhar.lib.state.managed.ManagedTimeUnifiedStateImpl in project apex-malhar by apache.

the class SpillableWindowedKeyedStorage method purge.

@Override
public void purge(long horizonMillis) {
    SpillableStateStore store = scc.getStore();
    if (store instanceof ManagedTimeUnifiedStateImpl) {
        ManagedTimeUnifiedStateImpl timeState = (ManagedTimeUnifiedStateImpl) store;
        long purgeTimeBucket = horizonMillis - timeState.getTimeBucketAssigner().getBucketSpan().getMillis();
        LOG.debug("Purging state less than equal to {}", purgeTimeBucket);
        timeState.purgeTimeBucketsLessThanEqualTo(purgeTimeBucket);
    }
}
Also used : ManagedTimeUnifiedStateImpl(org.apache.apex.malhar.lib.state.managed.ManagedTimeUnifiedStateImpl) SpillableStateStore(org.apache.apex.malhar.lib.state.spillable.SpillableStateStore)

Example 2 with ManagedTimeUnifiedStateImpl

use of org.apache.apex.malhar.lib.state.managed.ManagedTimeUnifiedStateImpl in project apex-malhar by apache.

the class ManagedStateBenchmarkApp method createStore.

public ManagedTimeUnifiedStateImpl createStore(Configuration conf) {
    String basePath = getStoreBasePath(conf);
    ManagedTimeUnifiedStateImpl store = new ManagedTimeUnifiedStateImpl();
    ((TFileImpl.DTFileImpl) store.getFileAccess()).setBasePath(basePath);
    store.getTimeBucketAssigner().setBucketSpan(Duration.millis(10000));
    return store;
}
Also used : ManagedTimeUnifiedStateImpl(org.apache.apex.malhar.lib.state.managed.ManagedTimeUnifiedStateImpl)

Example 3 with ManagedTimeUnifiedStateImpl

use of org.apache.apex.malhar.lib.state.managed.ManagedTimeUnifiedStateImpl in project apex-malhar by apache.

the class SpillableWindowedPlainStorage method purge.

@Override
public void purge(long horizonMillis) {
    SpillableStateStore store = scc.getStore();
    if (store instanceof ManagedTimeUnifiedStateImpl) {
        ManagedTimeUnifiedStateImpl timeState = (ManagedTimeUnifiedStateImpl) store;
        long purgeTimeBucket = horizonMillis - timeState.getTimeBucketAssigner().getBucketSpan().getMillis();
        LOG.debug("Purging state less than equal to {}", purgeTimeBucket);
        timeState.purgeTimeBucketsLessThanEqualTo(purgeTimeBucket);
    }
}
Also used : ManagedTimeUnifiedStateImpl(org.apache.apex.malhar.lib.state.managed.ManagedTimeUnifiedStateImpl) SpillableStateStore(org.apache.apex.malhar.lib.state.spillable.SpillableStateStore)

Aggregations

ManagedTimeUnifiedStateImpl (org.apache.apex.malhar.lib.state.managed.ManagedTimeUnifiedStateImpl)3 SpillableStateStore (org.apache.apex.malhar.lib.state.spillable.SpillableStateStore)2