Java Code Examples for org.apache.flink.api.common.state.StateTtlConfig#equals()
The following examples show how to use
org.apache.flink.api.common.state.StateTtlConfig#equals() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OuterJoinRecordStateViews.java From flink with Apache License 2.0 | 6 votes |
private InputSideHasUniqueKey( RuntimeContext ctx, String stateName, BaseRowTypeInfo recordType, BaseRowTypeInfo uniqueKeyType, KeySelector<BaseRow, BaseRow> uniqueKeySelector, StateTtlConfig ttlConfig) { checkNotNull(uniqueKeyType); checkNotNull(uniqueKeySelector); TupleTypeInfo<Tuple2<BaseRow, Integer>> valueTypeInfo = new TupleTypeInfo<>(recordType, Types.INT); MapStateDescriptor<BaseRow, Tuple2<BaseRow, Integer>> recordStateDesc = new MapStateDescriptor<>( stateName, uniqueKeyType, valueTypeInfo); if (!ttlConfig.equals(StateTtlConfig.DISABLED)) { recordStateDesc.enableTimeToLive(ttlConfig); } this.recordState = ctx.getMapState(recordStateDesc); this.uniqueKeySelector = uniqueKeySelector; }
Example 2
Source File: JoinRecordStateViews.java From flink with Apache License 2.0 | 6 votes |
private InputSideHasUniqueKey( RuntimeContext ctx, String stateName, BaseRowTypeInfo recordType, BaseRowTypeInfo uniqueKeyType, KeySelector<BaseRow, BaseRow> uniqueKeySelector, StateTtlConfig ttlConfig) { checkNotNull(uniqueKeyType); checkNotNull(uniqueKeySelector); MapStateDescriptor<BaseRow, BaseRow> recordStateDesc = new MapStateDescriptor<>( stateName, uniqueKeyType, recordType); if (!ttlConfig.equals(StateTtlConfig.DISABLED)) { recordStateDesc.enableTimeToLive(ttlConfig); } this.recordState = ctx.getMapState(recordStateDesc); this.uniqueKeySelector = uniqueKeySelector; }
Example 3
Source File: OuterJoinRecordStateViews.java From flink with Apache License 2.0 | 5 votes |
private JoinKeyContainsUniqueKey(RuntimeContext ctx, String stateName, BaseRowTypeInfo recordType, StateTtlConfig ttlConfig) { TupleTypeInfo<Tuple2<BaseRow, Integer>> valueTypeInfo = new TupleTypeInfo<>(recordType, Types.INT); ValueStateDescriptor<Tuple2<BaseRow, Integer>> recordStateDesc = new ValueStateDescriptor<>( stateName, valueTypeInfo); if (!ttlConfig.equals(StateTtlConfig.DISABLED)) { recordStateDesc.enableTimeToLive(ttlConfig); } this.recordState = ctx.getState(recordStateDesc); // the result records always not more than 1 this.reusedRecordList = new ArrayList<>(1); this.reusedTupleList = new ArrayList<>(1); }
Example 4
Source File: OuterJoinRecordStateViews.java From flink with Apache License 2.0 | 5 votes |
private InputSideHasNoUniqueKey( RuntimeContext ctx, String stateName, BaseRowTypeInfo recordType, StateTtlConfig ttlConfig) { TupleTypeInfo<Tuple2<Integer, Integer>> tupleTypeInfo = new TupleTypeInfo<>(Types.INT, Types.INT); MapStateDescriptor<BaseRow, Tuple2<Integer, Integer>> recordStateDesc = new MapStateDescriptor<>( stateName, recordType, tupleTypeInfo); if (!ttlConfig.equals(StateTtlConfig.DISABLED)) { recordStateDesc.enableTimeToLive(ttlConfig); } this.recordState = ctx.getMapState(recordStateDesc); }
Example 5
Source File: JoinRecordStateViews.java From flink with Apache License 2.0 | 5 votes |
private JoinKeyContainsUniqueKey( RuntimeContext ctx, String stateName, BaseRowTypeInfo recordType, StateTtlConfig ttlConfig) { ValueStateDescriptor<BaseRow> recordStateDesc = new ValueStateDescriptor<>( stateName, recordType); if (!ttlConfig.equals(StateTtlConfig.DISABLED)) { recordStateDesc.enableTimeToLive(ttlConfig); } this.recordState = ctx.getState(recordStateDesc); // the result records always not more than 1 this.reusedList = new ArrayList<>(1); }
Example 6
Source File: JoinRecordStateViews.java From flink with Apache License 2.0 | 5 votes |
private InputSideHasNoUniqueKey( RuntimeContext ctx, String stateName, BaseRowTypeInfo recordType, StateTtlConfig ttlConfig) { MapStateDescriptor<BaseRow, Integer> recordStateDesc = new MapStateDescriptor<>( stateName, recordType, Types.INT); if (!ttlConfig.equals(StateTtlConfig.DISABLED)) { recordStateDesc.enableTimeToLive(ttlConfig); } this.recordState = ctx.getMapState(recordStateDesc); }