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/29 06:26:13 UTC
[GitHub] [inlong] fuweng11 opened a new pull request, #6660: [INLONG-6659][Manager] Using the elasticsearch data node when creating streamSink
fuweng11 opened a new pull request, #6660:
URL: https://github.com/apache/inlong/pull/6660
### Prepare a Pull Request
- Fixes #6659
### Motivation
Using the Elasticsearch data node when creating streamSink.
### Modifications
1.Using the Elasticsearch data node when creating streamSink.
2.Delete duplicate parameters in `ElasticsearchDataNodeInfo`、`ElasticsearchDataNodeDTO`、`ElasticsearchDataNodeRequest`.
--
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
[GitHub] [inlong] healchow merged pull request #6660: [INLONG-6659][Manager] Using the Elasticsearch data node when creating its resource
Posted by GitBox <gi...@apache.org>.
healchow merged PR #6660:
URL: https://github.com/apache/inlong/pull/6660
--
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
[GitHub] [inlong] healchow commented on a diff in pull request #6660: [INLONG-6659][Manager] Using the elasticsearch data node when creating streamSink
Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #6660:
URL: https://github.com/apache/inlong/pull/6660#discussion_r1034417987
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/es/ElasticsearchResourceOperator.java:
##########
@@ -138,4 +133,28 @@ public List<ElasticsearchFieldInfo> getElasticsearchFieldFromSink(List<StreamSin
return esFieldList;
}
+ private ElasticsearchConfig getElasticsearchConfig(SinkInfo sinkInfo, ElasticsearchSinkDTO esInfo) {
+ ElasticsearchConfig config = new ElasticsearchConfig();
+ if (StringUtils.isNotEmpty(esInfo.getUsername())) {
+ config.setAuthEnable(true);
+ config.setUsername(esInfo.getUsername());
+ config.setPassword(esInfo.getPassword());
+ }
+ config.setHost(esInfo.getHost());
+ config.setPort(esInfo.getPort());
+ // read from data node if not supplied by user
+ if (StringUtils.isBlank(esInfo.getHost())) {
+ ElasticsearchDataNodeInfo esDataNode = (ElasticsearchDataNodeInfo) dataNodeHelper.getDataNodeInfo(
+ sinkInfo.getDataNodeName(), DataNodeType.ELASTICSEARCH);
+ String[] esUrl = esDataNode.getUrl().split(InlongConstants.COLON);
+ String esHost = esUrl[0];
+ int esPort = Integer.parseInt(esUrl[1]);
Review Comment:
There may be an out-of-bounds exception.
--
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