Search in sources :

Example 1 with TtlUpdateContext

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);
    });
}
Also used : ListState(org.apache.flink.api.common.state.ListState) State(org.apache.flink.api.common.state.State) TtlUpdateContext(org.apache.flink.streaming.tests.verify.TtlUpdateContext)

Aggregations

ListState (org.apache.flink.api.common.state.ListState)1 State (org.apache.flink.api.common.state.State)1 TtlUpdateContext (org.apache.flink.streaming.tests.verify.TtlUpdateContext)1