You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by sj...@apache.org on 2020/05/18 17:39:30 UTC
[flink] 01/02: [hotfix][state-processor-api] Remove
BoundedStreamConfig
This is an automated email from the ASF dual-hosted git repository.
sjwiesman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit a9340096769f793ebbd8def6494dc57b4b5abc63
Author: Seth Wiesman <sj...@gmail.com>
AuthorDate: Mon May 4 20:08:48 2020 -0500
[hotfix][state-processor-api] Remove BoundedStreamConfig
---
.../flink/state/api/BootstrapTransformation.java | 17 +++++---
.../state/api/runtime/BoundedStreamConfig.java | 51 ----------------------
2 files changed, 11 insertions(+), 57 deletions(-)
diff --git a/flink-libraries/flink-state-processing-api/src/main/java/org/apache/flink/state/api/BootstrapTransformation.java b/flink-libraries/flink-state-processing-api/src/main/java/org/apache/flink/state/api/BootstrapTransformation.java
index 5e2a7c2..1c6127b 100644
--- a/flink-libraries/flink-state-processing-api/src/main/java/org/apache/flink/state/api/BootstrapTransformation.java
+++ b/flink-libraries/flink-state-processing-api/src/main/java/org/apache/flink/state/api/BootstrapTransformation.java
@@ -26,6 +26,7 @@ import org.apache.flink.api.common.typeutils.TypeSerializer;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.api.java.operators.MapPartitionOperator;
+import org.apache.flink.configuration.Configuration;
import org.apache.flink.core.fs.Path;
import org.apache.flink.runtime.checkpoint.OperatorState;
import org.apache.flink.runtime.jobgraph.OperatorID;
@@ -36,7 +37,7 @@ import org.apache.flink.state.api.output.TaggedOperatorSubtaskState;
import org.apache.flink.state.api.output.operators.BroadcastStateBootstrapOperator;
import org.apache.flink.state.api.output.partitioner.HashSelector;
import org.apache.flink.state.api.output.partitioner.KeyGroupRangePartitioner;
-import org.apache.flink.state.api.runtime.BoundedStreamConfig;
+import org.apache.flink.streaming.api.CheckpointingMode;
import org.apache.flink.streaming.api.graph.StreamConfig;
import org.apache.flink.streaming.api.operators.StreamOperator;
@@ -175,12 +176,16 @@ public class BootstrapTransformation<T> {
@VisibleForTesting
StreamConfig getConfig(OperatorID operatorID, StateBackend stateBackend, StreamOperator<TaggedOperatorSubtaskState> operator) {
- final StreamConfig config;
- if (keyType == null) {
- config = new BoundedStreamConfig();
- } else {
+ final StreamConfig config = new StreamConfig(new Configuration());
+ config.setChainStart();
+ config.setCheckpointingEnabled(true);
+ config.setCheckpointMode(CheckpointingMode.EXACTLY_ONCE);
+
+ if (keyType != null) {
TypeSerializer<?> keySerializer = keyType.createSerializer(dataSet.getExecutionEnvironment().getConfig());
- config = new BoundedStreamConfig(keySerializer, originalKeySelector);
+
+ config.setStateKeySerializer(keySerializer);
+ config.setStatePartitioner(0, originalKeySelector);
}
config.setStreamOperator(operator);
diff --git a/flink-libraries/flink-state-processing-api/src/main/java/org/apache/flink/state/api/runtime/BoundedStreamConfig.java b/flink-libraries/flink-state-processing-api/src/main/java/org/apache/flink/state/api/runtime/BoundedStreamConfig.java
deleted file mode 100644
index 5f3b38b..0000000
--- a/flink-libraries/flink-state-processing-api/src/main/java/org/apache/flink/state/api/runtime/BoundedStreamConfig.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.state.api.runtime;
-
-import org.apache.flink.annotation.Internal;
-import org.apache.flink.api.common.typeutils.TypeSerializer;
-import org.apache.flink.api.java.functions.KeySelector;
-import org.apache.flink.configuration.Configuration;
-import org.apache.flink.streaming.api.CheckpointingMode;
-import org.apache.flink.streaming.api.graph.StreamConfig;
-
-/**
- * A {@link StreamConfig} with default settings.
- */
-@Internal
-public class BoundedStreamConfig extends StreamConfig {
-
- private static final long serialVersionUID = 1L;
-
- public BoundedStreamConfig() {
- super(new Configuration());
-
- setChainStart();
- setCheckpointingEnabled(true);
- setCheckpointMode(CheckpointingMode.EXACTLY_ONCE);
- }
-
- public <IN> BoundedStreamConfig(TypeSerializer<?> keySerializer, KeySelector<IN, ?> keySelector) {
- this();
-
- setStateKeySerializer(keySerializer);
- setStatePartitioner(0, keySelector);
- }
-}
-