healchow commented on code in PR #4238:
URL: https://github.com/apache/incubator-inlong/pull/4238#discussion_r879148871


##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/sink/es/ElasticsearchIndexInfo.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * 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.manager.common.pojo.sink.es;
+
+import lombok.Data;
+
+@Data
+public class ElasticsearchIndexInfo {
+    // Basic attributes
+    private String indexName;

Review Comment:
   Suggest using a String variable directly.



##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/sink/es/ElasticsearchFieldInfo.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.manager.common.pojo.sink.es;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ElasticsearchFieldInfo {
+
+    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+    @ApiModelProperty("Elasticsearch Field name")
+    private String name;
+
+    @ApiModelProperty("Elasticsearch Field type")
+    private String type;
+
+    @ApiModelProperty("Elasticsearch Field text format")
+    private String format;
+
+    @ApiModelProperty("Elasticsearch Analyzer")
+    private String analyzer;
+
+    @ApiModelProperty("Elasticsearch Search Analyzer")
+    private String searchAnalyzer;
+
+    @ApiModelProperty("Elasticsearch Scaling Factor")
+    private Integer scalingFactor;
+
+    /**
+     * Get the extra param from the Json
+     */
+

Review Comment:
   Please remove the blank line, thanks.



##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/sink/es/ElasticsearchSinkExtrParamDTO.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.manager.common.pojo.sink.es;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * Sink info of Elasticsearch
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ElasticsearchSinkExtrParamDTO {

Review Comment:
   Can reuse in `ElasticsearchFieldInfo`, thanks.



##########
inlong-manager/manager-test/src/main/resources/sql/apache_inlong_manager.sql:
##########
@@ -631,6 +631,7 @@ CREATE TABLE IF NOT EXISTS `stream_sink_field`
     `field_precision`    int(4)        DEFAULT NULL COMMENT 'Field precision',
     `field_scale`        int(4)        DEFAULT NULL COMMENT 'Field scale',
     `partition_strategy` varchar(20)   DEFAULT NULL COMMENT 'Field partition 
strategy',
+    `extr_param`         varchar(20)   DEFAULT NULL COMMENT 'Field extr param',

Review Comment:
   Please change the type to `text`, thanks.



##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/util/SinkInfoUtils.java:
##########
@@ -233,4 +237,19 @@ public static void checkPartitionField(List<? extends 
SinkFieldBase> fieldList,
         }
     }
 
+    private static ElasticsearchSinkInfo 
createElasticsearchSinkInfo(ElasticsearchSinkResponse sinkResponse,

Review Comment:
   Please add Java docs for static methods.



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