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/10/19 07:04:08 UTC
[GitHub] [inlong] GanfengTan opened a new pull request, #6221: [INLONG-6220][Manager] Support query of DP cluster based on GroupId and protocol
GanfengTan opened a new pull request, #6221:
URL: https://github.com/apache/inlong/pull/6221
1. Support query of DP cluster based on GroupId and protocol.
2. The common code to extract the cluster query.
- Fixes #6220
### Motivation
Update Manager client, add query DP nodes by group id and protocol type.
### Modifications
InlongClusterController.listDPByGroupId
### Verifying this change
*(Please pick either of the following options)*
- [ ] This change is a trivial rework/code cleanup without any test coverage.
- [ ] This change is already covered by existing tests, such as:
*(please describe tests)*
- [x] This change added tests and can be verified as follows:
@test
ClientFactoryTest.testListDPNode()
--
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 #6221: [INLONG-6220][Manager] Support query cluster nodes by the manager client
Posted by GitBox <gi...@apache.org>.
healchow merged PR #6221:
URL: https://github.com/apache/inlong/pull/6221
--
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] woofyzhao commented on a diff in pull request #6221: [INLONG-6220][Manager] Support query of DP cluster based on GroupId and protocol
Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #6221:
URL: https://github.com/apache/inlong/pull/6221#discussion_r999067422
##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/InlongClient.java:
##########
@@ -224,6 +224,15 @@ static InlongClient create(String serviceUrl, ClientConfiguration configuration)
*/
PageResult<ClusterNodeResponse> listNode(ClusterPageRequest request);
+ /**
+ * Get DP node info by groupId and protocol
+ *
+ * @param groupId inlong group id
+ * @param protocolType protocol type, such as: TCP,HTTP
+ * @return DP list
+ */
+ List<ClusterNodeResponse> listDPNode(String groupId, String protocolType);
Review Comment:
would it be clearer if we use the full name DataProxy rather than DP?
--
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] GanfengTan commented on a diff in pull request #6221: [INLONG-6220][Manager] Support query of DP cluster based on GroupId and protocol
Posted by GitBox <gi...@apache.org>.
GanfengTan commented on code in PR #6221:
URL: https://github.com/apache/inlong/pull/6221#discussion_r999125418
##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/InlongClient.java:
##########
@@ -224,6 +224,15 @@ static InlongClient create(String serviceUrl, ClientConfiguration configuration)
*/
PageResult<ClusterNodeResponse> listNode(ClusterPageRequest request);
+ /**
+ * Get DP node info by groupId and protocol
+ *
+ * @param groupId inlong group id
+ * @param protocolType protocol type, such as: TCP,HTTP
+ * @return DP list
+ */
+ List<ClusterNodeResponse> listDPNode(String groupId, String protocolType);
Review Comment:
done
--
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 #6221: [INLONG-6220][Manager] Support query of DP cluster based on GroupId and protocol
Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #6221:
URL: https://github.com/apache/inlong/pull/6221#discussion_r1000094704
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java:
##########
@@ -713,31 +748,17 @@ public DataProxyNodeResponse getDataProxyNodes(String inlongGroupId, String prot
LOGGER.debug(msg);
throw new BusinessException(msg);
}
-
- // if more than one data proxy cluster, currently takes first
- // TODO consider the data proxy load and re-balance
- List<DataProxyNodeInfo> nodeInfos = new ArrayList<>();
+ List<InlongClusterNodeEntity> nodeList = new ArrayList<>();
for (InlongClusterEntity entity : clusterList) {
- List<InlongClusterNodeEntity> nodeList = clusterNodeMapper.selectByParentId(entity.getId(), protocolType);
- for (InlongClusterNodeEntity nodeEntity : nodeList) {
- DataProxyNodeInfo nodeInfo = new DataProxyNodeInfo();
- nodeInfo.setId(nodeEntity.getId());
- nodeInfo.setIp(nodeEntity.getIp());
- nodeInfo.setPort(nodeEntity.getPort());
- nodeInfo.setProtocolType(nodeEntity.getProtocolType());
- nodeInfos.add(nodeInfo);
+ List<InlongClusterNodeEntity> clusterDPList = clusterNodeMapper
+ .selectByParentId(entity.getId(), protocolType);
+ if (CollectionUtils.isNotEmpty(clusterDPList)) {
+ nodeList.addAll(clusterDPList);
}
}
-
- DataProxyNodeResponse response = new DataProxyNodeResponse();
- response.setClusterId(clusterList.get(0).getId());
- response.setNodeList(nodeInfos);
-
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("success to get data proxy nodes for groupId={}, protocol={} result={}",
- inlongGroupId, protocolType, response);
- }
- return response;
+ Map<Integer, List<InlongClusterNodeEntity>> clusterDP = new HashMap<>();
+ clusterDP.put(clusterList.get(0).getId(), nodeList);
Review Comment:
Why just put `clusterList.get(0).getId()`, not need another IDs from clusterList?
--
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] woofyzhao commented on a diff in pull request #6221: [INLONG-6220][Manager] Support query of DP cluster based on GroupId and protocol
Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #6221:
URL: https://github.com/apache/inlong/pull/6221#discussion_r999060361
##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/InlongClient.java:
##########
@@ -224,6 +224,15 @@ static InlongClient create(String serviceUrl, ClientConfiguration configuration)
*/
PageResult<ClusterNodeResponse> listNode(ClusterPageRequest request);
+ /**
+ * Get DP node info by groupId and protocol
+ *
+ * @param groupId inlong group id
+ * @param protocolType protocol type, such as: TCP,HTTP
+ * @return DP list
+ */
+ List<ClusterNodeResponse> listDPNode(String groupId, String protocolType);
Review Comment:
would it be clearer to use the full name DataProxy instead of DP?
--
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