yunqingmoswu commented on code in PR #6741:
URL: https://github.com/apache/inlong/pull/6741#discussion_r1040631394


##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/constant/StarRocksConstant.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.inlong.sort.protocol.constant;
+
+/**
+ * StarRocks options constant
+ */
+public class StarRocksConstant {
+
+    /**
+     * 'connector' = 'starrocks-inlong'
+     */
+    public static final String CONNECTOR = "connector";
+
+    /**
+     * Host of the stream load like: 
`jdbc:mysql://fe_ip1:query_port,fe_ip2:query_port...`.
+     */
+    public static final String JDBC_URL = "jdbc-url";
+
+    /**
+     * Host of the stream load like: 
`fe_ip1:http_port;fe_ip2:http_port;fe_ip3:http_port`.
+     */
+    public static final String LOAD_URL = "load-url";
+
+    /**
+     * StarRocks user name.
+     */
+    public static final String USERNAME = "username";
+
+    /**
+     * StarRocks user password.
+     */
+    public static final String PASSWORD = "password";
+
+    /**
+     * StarRocks stream load format, support json and csv.
+     */
+    public static final String FORMAT = "sink.properties.format";
+
+    /**
+     * StarRocks stream load strip outer array for json format.
+     */
+    public static final String STRIP_OUTER_ARRAY = 
"sink.properties.strip_outer_array";
+
+    /**
+     * Database name of the stream load.
+     */
+    public static final String DATABASE_NAME = "database-name";
+
+    /**
+     * Table name of the stream load.
+     */
+    public static final String TABLE_NAME = "table-name";
+
+    /**
+     * The multiple enable of sink
+     */
+    public static final String SINK_MULTIPLE_ENABLE = "sink.multiple.enable";
+
+    /**
+     * The multiple format of sink
+     */
+    public static final String SINK_MULTIPLE_FORMAT = "sink.multiple.format";

Review Comment:
   can be extracted in the general constant class?



##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/constant/StarRocksConstant.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.inlong.sort.protocol.constant;
+
+/**
+ * StarRocks options constant
+ */
+public class StarRocksConstant {
+
+    /**
+     * 'connector' = 'starrocks-inlong'
+     */
+    public static final String CONNECTOR = "connector";
+
+    /**
+     * Host of the stream load like: 
`jdbc:mysql://fe_ip1:query_port,fe_ip2:query_port...`.
+     */
+    public static final String JDBC_URL = "jdbc-url";
+
+    /**
+     * Host of the stream load like: 
`fe_ip1:http_port;fe_ip2:http_port;fe_ip3:http_port`.
+     */
+    public static final String LOAD_URL = "load-url";
+
+    /**
+     * StarRocks user name.
+     */
+    public static final String USERNAME = "username";
+
+    /**
+     * StarRocks user password.
+     */
+    public static final String PASSWORD = "password";
+
+    /**
+     * StarRocks stream load format, support json and csv.
+     */
+    public static final String FORMAT = "sink.properties.format";
+
+    /**
+     * StarRocks stream load strip outer array for json format.
+     */
+    public static final String STRIP_OUTER_ARRAY = 
"sink.properties.strip_outer_array";
+
+    /**
+     * Database name of the stream load.
+     */
+    public static final String DATABASE_NAME = "database-name";
+
+    /**
+     * Table name of the stream load.
+     */
+    public static final String TABLE_NAME = "table-name";
+
+    /**
+     * The multiple enable of sink
+     */
+    public static final String SINK_MULTIPLE_ENABLE = "sink.multiple.enable";

Review Comment:
   can be extracted in the general constant class?



##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/constant/StarRocksConstant.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.inlong.sort.protocol.constant;
+
+/**
+ * StarRocks options constant
+ */
+public class StarRocksConstant {
+
+    /**
+     * 'connector' = 'starrocks-inlong'
+     */
+    public static final String CONNECTOR = "connector";
+
+    /**
+     * Host of the stream load like: 
`jdbc:mysql://fe_ip1:query_port,fe_ip2:query_port...`.
+     */
+    public static final String JDBC_URL = "jdbc-url";
+
+    /**
+     * Host of the stream load like: 
`fe_ip1:http_port;fe_ip2:http_port;fe_ip3:http_port`.
+     */
+    public static final String LOAD_URL = "load-url";
+
+    /**
+     * StarRocks user name.
+     */
+    public static final String USERNAME = "username";
+
+    /**
+     * StarRocks user password.
+     */
+    public static final String PASSWORD = "password";
+
+    /**
+     * StarRocks stream load format, support json and csv.
+     */
+    public static final String FORMAT = "sink.properties.format";
+
+    /**
+     * StarRocks stream load strip outer array for json format.
+     */
+    public static final String STRIP_OUTER_ARRAY = 
"sink.properties.strip_outer_array";
+
+    /**
+     * Database name of the stream load.
+     */
+    public static final String DATABASE_NAME = "database-name";
+
+    /**
+     * Table name of the stream load.
+     */
+    public static final String TABLE_NAME = "table-name";
+
+    /**
+     * The multiple enable of sink
+     */
+    public static final String SINK_MULTIPLE_ENABLE = "sink.multiple.enable";
+
+    /**
+     * The multiple format of sink
+     */
+    public static final String SINK_MULTIPLE_FORMAT = "sink.multiple.format";
+
+    /**
+     * The multiple database-pattern of sink
+     */
+    public static final String SINK_MULTIPLE_DATABASE_PATTERN = 
"sink.multiple.database-pattern";

Review Comment:
   can be extracted in the general constant class?



##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/constant/StarRocksConstant.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.inlong.sort.protocol.constant;
+
+/**
+ * StarRocks options constant
+ */
+public class StarRocksConstant {
+
+    /**
+     * 'connector' = 'starrocks-inlong'
+     */
+    public static final String CONNECTOR = "connector";
+
+    /**
+     * Host of the stream load like: 
`jdbc:mysql://fe_ip1:query_port,fe_ip2:query_port...`.
+     */
+    public static final String JDBC_URL = "jdbc-url";
+
+    /**
+     * Host of the stream load like: 
`fe_ip1:http_port;fe_ip2:http_port;fe_ip3:http_port`.
+     */
+    public static final String LOAD_URL = "load-url";
+
+    /**
+     * StarRocks user name.
+     */
+    public static final String USERNAME = "username";
+
+    /**
+     * StarRocks user password.
+     */
+    public static final String PASSWORD = "password";
+
+    /**
+     * StarRocks stream load format, support json and csv.
+     */
+    public static final String FORMAT = "sink.properties.format";
+
+    /**
+     * StarRocks stream load strip outer array for json format.
+     */
+    public static final String STRIP_OUTER_ARRAY = 
"sink.properties.strip_outer_array";
+
+    /**
+     * Database name of the stream load.
+     */
+    public static final String DATABASE_NAME = "database-name";
+
+    /**
+     * Table name of the stream load.
+     */
+    public static final String TABLE_NAME = "table-name";
+
+    /**
+     * The multiple enable of sink
+     */
+    public static final String SINK_MULTIPLE_ENABLE = "sink.multiple.enable";
+
+    /**
+     * The multiple format of sink
+     */
+    public static final String SINK_MULTIPLE_FORMAT = "sink.multiple.format";
+
+    /**
+     * The multiple database-pattern of sink
+     */
+    public static final String SINK_MULTIPLE_DATABASE_PATTERN = 
"sink.multiple.database-pattern";
+    /**
+     * The multiple table-pattern of sink
+     */
+    public static final String SINK_MULTIPLE_TABLE_PATTERN = 
"sink.multiple.table-pattern";

Review Comment:
   can be extracted in the general constant class?



##########
inlong-sort/sort-connectors/starrocks/src/main/java/org/apache/inlong/sort/starrocks/manager/StarRocksSinkManager.java:
##########
@@ -0,0 +1,579 @@
+/*
+ * 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.inlong.sort.starrocks.manager;
+
+import com.starrocks.connector.flink.connection.StarRocksJdbcConnectionOptions;
+import 
com.starrocks.connector.flink.connection.StarRocksJdbcConnectionProvider;
+import com.starrocks.connector.flink.manager.StarRocksQueryVisitor;
+import com.starrocks.connector.flink.manager.StarRocksSinkBufferEntity;
+import 
com.starrocks.connector.flink.manager.StarRocksStreamLoadFailedException;
+import com.starrocks.connector.flink.table.sink.StarRocksSinkOptions;
+import com.starrocks.connector.flink.table.sink.StarRocksSinkSemantic;
+import java.io.IOException;
+import java.io.Serializable;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingDeque;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+import org.apache.flink.api.common.functions.RuntimeContext;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.Histogram;
+import org.apache.flink.runtime.metrics.DescriptiveStatisticsHistogram;
+import org.apache.flink.runtime.util.ExecutorThreadFactory;
+import org.apache.flink.table.api.TableColumn;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.api.constraints.UniqueConstraint;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+import org.apache.inlong.sort.base.metric.SinkMetricData;
+import org.apache.inlong.sort.base.sink.SchemaUpdateExceptionPolicy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class StarRocksSinkManager implements Serializable {

Review Comment:
   Please add some comments.



##########
inlong-sort/sort-connectors/starrocks/src/main/java/org/apache/inlong/sort/starrocks/manager/StarRocksSinkManager.java:
##########
@@ -0,0 +1,579 @@
+/*
+ * 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.inlong.sort.starrocks.manager;
+
+import com.starrocks.connector.flink.connection.StarRocksJdbcConnectionOptions;
+import 
com.starrocks.connector.flink.connection.StarRocksJdbcConnectionProvider;
+import com.starrocks.connector.flink.manager.StarRocksQueryVisitor;
+import com.starrocks.connector.flink.manager.StarRocksSinkBufferEntity;
+import 
com.starrocks.connector.flink.manager.StarRocksStreamLoadFailedException;
+import com.starrocks.connector.flink.table.sink.StarRocksSinkOptions;
+import com.starrocks.connector.flink.table.sink.StarRocksSinkSemantic;
+import java.io.IOException;
+import java.io.Serializable;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingDeque;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+import org.apache.flink.api.common.functions.RuntimeContext;
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.Histogram;
+import org.apache.flink.runtime.metrics.DescriptiveStatisticsHistogram;
+import org.apache.flink.runtime.util.ExecutorThreadFactory;
+import org.apache.flink.table.api.TableColumn;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.api.constraints.UniqueConstraint;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+import org.apache.inlong.sort.base.metric.SinkMetricData;
+import org.apache.inlong.sort.base.sink.SchemaUpdateExceptionPolicy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class StarRocksSinkManager implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(StarRocksSinkManager.class);

Review Comment:
   LOG -> LOGGER



-- 
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: commits-unsubscr...@inlong.apache.org

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

Reply via email to