use of org.apache.flink.streaming.tests.verify.TtlUpdateContext in project flink by apache.
the class TtlVerifyUpdateFunction method performUpdate.
private TtlUpdateContext<?, ?> performUpdate(TtlStateVerifier<?, ?> verifier, Object update) throws Exception {
return MonotonicTTLTimeProvider.doWithFrozenTime(frozenTimestamp -> {
State state = states.get(verifier.getId());
Object valueBeforeUpdate = verifier.get(state);
verifier.update(state, update);
Object updatedValue = verifier.get(state);
return new TtlUpdateContext<>(valueBeforeUpdate, update, updatedValue, frozenTimestamp);
});
}
Aggregations