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);
}
}
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;
}
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);
}
}
Aggregations