TaoZex commented on code in PR #3631:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3631#discussion_r1039652433


##########
seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/config/SinkConfig.java:
##########
@@ -0,0 +1,192 @@
+/*
+ * 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.config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+import org.apache.seatunnel.common.config.TypesafeConfigUtils;
+
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Setter
+@Getter
+@ToString
+public class SinkConfig {
+
+    private static final int DEFAULT_BATCH_MAX_SIZE = 1024;
+    private static final long DEFAULT_BATCH_BYTES = 5 * 1024 * 1024;
+
+    private static final String LOAD_FORMAT = "format";
+    private static final StreamLoadFormat DEFAULT_LOAD_FORMAT = 
StreamLoadFormat.CSV;
+    private static final String COLUMN_SEPARATOR = "column_separator";
+
+    public static final Option<List<String>> NODE_URLS = 
Options.key("nodeUrls")
+            .listType()
+            .noDefaultValue()
+            .withDescription("Doris cluster address, the format is 
[\"fe_ip:fe_http_port\", ...]");
+
+    public static final Option<String> USERNAME = Options.key("username")
+            .stringType()
+            .noDefaultValue()
+            .withDescription("Doris user username");
+
+    public static final Option<String> PASSWORD = Options.key("password")
+            .stringType()
+            .noDefaultValue()
+            .withDescription("Doris user password");
+
+    public static final Option<String> LABEL_PREFIX = 
Options.key("labelPrefix")
+            .stringType()
+            .noDefaultValue()
+            .withDescription("The prefix of Doris stream load label");
+
+    public static final Option<String> DATABASE = Options.key("database")
+            .stringType()
+            .noDefaultValue()
+            .withDescription("The name of Doris database");
+
+    public static final Option<String> TABLE = Options.key("table")
+            .stringType()
+            .noDefaultValue()
+            .withDescription("The name of Doris table");
+
+    public static final Option<String> DORIS_SINK_CONFIG_PREFIX = 
Options.key("sink.properties.")
+            .stringType()
+            .noDefaultValue()
+            .withDescription("The parameter of the stream load data_desc. " +
+                    "The way to specify the parameter is to add the prefix 
`sink.properties.` to the original stream load parameter name ");
+
+    public static final Option<Integer> BATCH_MAX_SIZE = 
Options.key("batch_max_rows")
+            .intType()
+            .defaultValue(DEFAULT_BATCH_MAX_SIZE)
+            .withDescription("For batch writing, when the number of buffers 
reaches the number of batch_max_rows or the byte size of batch_max_bytes or the 
time reaches batch_interval_ms, the data will be flushed into the Doris");
+
+    public static final Option<Long> BATCH_MAX_BYTES = 
Options.key("batch_max_bytes")
+            .longType()
+            .defaultValue(DEFAULT_BATCH_BYTES)
+            .withDescription("For batch writing, when the number of buffers 
reaches the number of batch_max_rows or the byte size of batch_max_bytes or the 
time reaches batch_interval_ms, the data will be flushed into the Doris");
+
+    public static final Option<Integer> BATCH_INTERVAL_MS = 
Options.key("batch_interval_ms")
+            .intType()
+            .noDefaultValue()
+            .withDescription("For batch writing, when the number of buffers 
reaches the number of batch_max_rows or the byte size of batch_max_bytes or the 
time reaches batch_interval_ms, the data will be flushed into the Doris");
+
+    public static final Option<Integer> MAX_RETRIES = 
Options.key("max_retries")
+            .intType()
+            .noDefaultValue()
+            .withDescription("The number of retries to flush failed");
+
+    public static final Option<Integer> RETRY_BACKOFF_MULTIPLIER_MS = 
Options.key("retry_backoff_multiplier_ms")
+            .intType()
+            .noDefaultValue()
+            .withDescription("Using as a multiplier for generating the next 
delay for backoff");
+
+    public static final Option<Integer> MAX_RETRY_BACKOFF_MS = 
Options.key("max_retry_backoff_ms")
+            .intType()
+            .noDefaultValue()
+            .withDescription("The amount of time to wait before attempting to 
retry a request to Doris");
+
+    public enum StreamLoadFormat {
+        CSV, JSON;
+        public static StreamLoadFormat parse(String format) {
+            if (StreamLoadFormat.JSON.name().equals(format)) {
+                return JSON;
+            }
+            return CSV;
+        }
+    }
+
+    private List<String> nodeUrls;
+    private String username;
+    private String password;
+    private String database;
+    private String table;
+    private String labelPrefix;
+    private String columnSeparator;
+    private StreamLoadFormat loadFormat = DEFAULT_LOAD_FORMAT;
+
+    private int batchMaxSize = DEFAULT_BATCH_MAX_SIZE;
+    private long batchMaxBytes = DEFAULT_BATCH_BYTES;
+
+    private Integer batchIntervalMs;
+    private int maxRetries;
+    private int retryBackoffMultiplierMs;
+    private int maxRetryBackoffMs;
+
+    private final Map<String, Object> streamLoadProps = new HashMap<>();

Review Comment:
   
   
![e03a317fc129d3d3d189d0eb81408c3](https://user-images.githubusercontent.com/45089228/205658065-f7e540c2-abeb-444a-8dd3-5dbb0db063c4.png)
   
   
   Need to put  Object type.
    



-- 
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