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/01/19 09:15:12 UTC

[GitHub] [flink-table-store] JingsongLi commented on a change in pull request #10: [FLINK-25680] Introduce Table Store Flink Sink

JingsongLi commented on a change in pull request #10:
URL: https://github.com/apache/flink-table-store/pull/10#discussion_r787516809



##########
File path: flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/sink/SinkRecord.java
##########
@@ -0,0 +1,71 @@
+/*
+ * 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.table.data.RowData;
+import org.apache.flink.table.data.binary.BinaryRowData;
+import org.apache.flink.types.RowKind;
+
+import static org.apache.flink.util.Preconditions.checkArgument;
+
+/** A sink records contains key, value and partition, bucket, row kind information. */
+public class SinkRecord {
+
+    private final BinaryRowData partition;
+
+    private final int bucket;
+
+    private final RowKind rowKind;
+
+    private final BinaryRowData key;
+
+    private final RowData row;
+
+    public SinkRecord(
+            BinaryRowData partition, int bucket, RowKind rowKind, BinaryRowData key, RowData row) {
+        checkArgument(partition.getRowKind() == RowKind.INSERT);
+        checkArgument(key.getRowKind() == RowKind.INSERT);
+        checkArgument(row.getRowKind() == RowKind.INSERT);

Review comment:
       We should avoid the caller to determine by this kind, the caller should use member variables.
   LogStore also use 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