Hisoka-X commented on code in PR #4235:
URL: 
https://github.com/apache/incubator-seatunnel/pull/4235#discussion_r1169530922


##########
seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/sink/writer/DorisSinkStateSerializer.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.seatunnel.connectors.doris.sink.writer;
+
+import org.apache.seatunnel.api.serialization.Serializer;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+/** Serializer for DorisWriterState. */
+public class DorisSinkStateSerializer implements Serializer<DorisSinkState> {
+    @Override
+    public byte[] serialize(DorisSinkState dorisSinkState) throws IOException {
+        try (final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                final DataOutputStream out = new DataOutputStream(baos)) {
+            out.writeUTF(dorisSinkState.getLabelPrefix());
+            out.flush();
+            return baos.toByteArray();
+        }
+    }
+
+    @Override
+    public DorisSinkState deserialize(byte[] serialized) throws IOException {
+        try (final ByteArrayInputStream bais = new 
ByteArrayInputStream(serialized);
+                final DataInputStream in = new DataInputStream(bais)) {
+            final String labelPrefix = in.readUTF();
+            final long checkpointId = in.readLong();
+            return new DorisSinkState(labelPrefix, checkpointId);
+        }
+    }

Review Comment:
   ``` java
   out.writeUTF(dorisSinkState.getLabelPrefix());
   ```
   
    but 
   
   ``` java
   final String labelPrefix = in.readUTF();
   final long checkpointId = in.readLong();
   ```
   Not match.



##########
docs/en/connector-v2/sink/Doris.md:
##########
@@ -9,29 +9,24 @@ The internal implementation of Doris sink connector is cached 
and imported by st
 
 ## Key features
 
-- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [exactly-once](../../concept/connector-v2-features.md)
 
 ## Options
 
-|            name             |  type  | required |  default value  |
-|-----------------------------|--------|----------|-----------------|
-| node_urls                   | list   | yes      | -               |
-| username                    | string | yes      | -               |
-| password                    | string | yes      | -               |
-| database                    | string | yes      | -               |
-| table                       | string | yes      | -               |
-| labelPrefix                 | string | no       | -               |
-| batch_max_rows              | long   | no       | 1024            |
-| batch_max_bytes             | int    | no       | 5 * 1024 * 1024 |
-| batch_interval_ms           | int    | no       | 1000            |
-| max_retries                 | int    | no       | 1               |
-| retry_backoff_multiplier_ms | int    | no       | -               |
-| max_retry_backoff_ms        | int    | no       | -               |
-| doris.config                | map    | no       | -               |
-
-### node_urls [list]
-
-`Doris` cluster address, the format is `["fe_ip:fe_http_port", ...]`
+|        name        |  type  | required | default value |
+|--------------------|--------|----------|---------------|
+| fenodes            | string | yes      | -             |
+| username           | string | yes      | -             |
+| password           | string | yes      | -             |
+| table.identifier   | string | yes      | -             |
+| sink.label-prefix  | string | yes      | -             |
+| sink.enable-2pc    | bool   | no       | true          |
+| sink.enable-delete | bool   | no       | false         |
+| doris.config       | map    | yes      | -             |
+
+### node_urls [string]

Review Comment:
   ```suggestion
   ### fenodes [string]
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to