You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/07/27 11:03:54 UTC

[GitHub] [flink-table-store] tsreaper commented on a diff in pull request #244: [FLINK-28700] Table store sink fails to commit for Flink 1.14 batch job

tsreaper commented on code in PR #244:
URL: https://github.com/apache/flink-table-store/pull/244#discussion_r930925463


##########
flink-table-store-connector/src/main/1.14.5/org/apache/flink/table/store/connector/sink/StoreSinkImpl.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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.table.store.connector.sink;
+
+import org.apache.flink.api.common.RuntimeExecutionMode;
+import org.apache.flink.configuration.ExecutionOptions;
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.catalog.ObjectIdentifier;
+import org.apache.flink.table.store.file.catalog.CatalogLock;
+import org.apache.flink.table.store.table.FileStoreTable;
+import org.apache.flink.table.store.table.sink.LogSinkFunction;
+
+import javax.annotation.Nullable;
+import java.lang.reflect.Field;
+import java.util.Map;
+
+/** Flink 1.14 implementation of {@link AbstractStoreSink}. */
+public class StoreSinkImpl extends AbstractStoreSink {
+
+    public StoreSinkImpl(
+            ObjectIdentifier tableIdentifier,
+            FileStoreTable table,
+            boolean compactionTask,
+            @Nullable Map<String, String> compactPartitionSpec,
+            @Nullable CatalogLock.Factory lockFactory,
+            @Nullable Map<String, String> overwritePartition,
+            @Nullable LogSinkFunction logSinkFunction) {
+        super(
+                tableIdentifier,
+                table,
+                compactionTask,
+                compactPartitionSpec,
+                lockFactory,
+                overwritePartition,
+                logSinkFunction);
+    }
+
+    @Override
+    protected boolean isStreamingCheckpointEnabled(StreamExecutionEnvironment env) {
+        // For Flink 1.14 we have to use reflection to get configuration from execution environment.
+        // See FLINK-26709 for more info.
+        if (env.getClass()

Review Comment:
   Although this implementation can also be used in Flink 1.15 I would still like to distinguish them because this implementation use Java reflection. Once we no longer support Flink 1.14 we can get rid of this class.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org