You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/11/15 11:56:47 UTC

[GitHub] [inlong] fuweng11 commented on a diff in pull request #6521: [INLONG-6496][Manager] Support Elasticsearch DataNode

fuweng11 commented on code in PR #6521:
URL: https://github.com/apache/inlong/pull/6521#discussion_r1022697975


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/node/es/ElasticsearchDataNodeDTO.java:
##########
@@ -0,0 +1,114 @@
+/*
+ * 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.pojo.node.es;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+import org.apache.inlong.manager.common.util.JsonUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * Elasticsearch data node info
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@ApiModel("Elasticsearch data node info")
+public class ElasticsearchDataNodeDTO {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(ElasticsearchDataNodeDTO.class);
+
+    @ApiModelProperty("Bulk action, default is 4000")
+    private Integer bulkAction;
+
+    @ApiModelProperty("Bulk size in MB, default is 4000")
+    private Integer bulkSizeMb;
+
+    @ApiModelProperty("Flush interval, default is 60")
+    private Integer flushInterval;
+
+    @ApiModelProperty("Concurrent requests, default is 60")
+    private Integer concurrentRequests;
+
+    @ApiModelProperty("Max connection, default is 10")
+    private Integer maxConnect;
+
+    @ApiModelProperty("Max keyword length, default is 32767")
+    private Integer keywordMaxLength;
+
+    @ApiModelProperty("Is use index id, default is false")
+    private Boolean isUseIndexId;
+
+    @ApiModelProperty("Max threads, default is 2")
+    private Integer maxThreads;
+
+    @ApiModelProperty("ES username")
+    private String username;
+
+    @ApiModelProperty("ES password")
+    private String password;
+
+    @ApiModelProperty("Host of ES server, ip:port format")
+    private String httpHosts;
+
+    @ApiModelProperty("audit set name")
+    private String auditSetName;
+
+    /**
+     * Get the dto instance from the request
+     */
+    public static ElasticsearchDataNodeDTO getFromRequest(ElasticsearchDataNodeRequest request) {
+        return ElasticsearchDataNodeDTO.builder()

Review Comment:
   Recommended use `CommonBeanUtils.copyProperties(request, ElasticsearchDataNodeDTO::new, true);`



-- 
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-unsubscribe@inlong.apache.org

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