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/02/26 05:28:29 UTC

[GitHub] [incubator-inlong] pocozh opened a new pull request #2740: [INLONG-2677][Manager]Manager get MQ cluster Info from database, remove local file configuration dependency

pocozh opened a new pull request #2740:
URL: https://github.com/apache/incubator-inlong/pull/2740


   ### Title Name: [INLONG-2677][Manager] Manager get MQ cluster Info from database, remove local file configuration dependency
   
   Fixes #2677 
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve.*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


-- 
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] [incubator-inlong] healchow commented on a change in pull request #2740: [INLONG-2677][Manager] Get MQ cluster from database, remove local file configuration dependency

Posted by GitBox <gi...@apache.org>.
healchow commented on a change in pull request #2740:
URL: https://github.com/apache/incubator-inlong/pull/2740#discussion_r815274853



##########
File path: inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/thirdparty/mq/TubeMqOptService.java
##########
@@ -56,19 +57,21 @@ public String createNewTopic(AddTubeMqTopicRequest request) {
                 throw new Exception("topic cannot be empty");
             }
             AddTubeMqTopicRequest.AddTopicTasksBean addTopicTasksBean = request.getAddTopicTasks().get(0);
+            String clusterIdStr = commonOperateService.getSpecifiedParam(Constant.CLUSTER_TUBE_CLUSTER_ID);
+            int clusterId = Integer.valueOf(clusterIdStr);

Review comment:
       Replace with `Integer.parseInt`.

##########
File path: inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/thirdparty/sort/CreateSortConfigListener.java
##########
@@ -90,14 +94,14 @@ public ListenerResult listen(WorkflowContext context) throws Exception {
         }
 
         Map<String, DataFlowInfo> dataFlowInfoMap = streamBriefResponses.stream().map(streamBriefResponse -> {
-                            DataFlowInfo flowInfo = createDataFlow(streamBriefResponse, groupRequest);

Review comment:
       Do not change those code formate.




-- 
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] [incubator-inlong] dockerzhang commented on a change in pull request #2740: [INLONG-2677][Manager] Get MQ cluster from database, remove local file configuration dependency

Posted by GitBox <gi...@apache.org>.
dockerzhang commented on a change in pull request #2740:
URL: https://github.com/apache/incubator-inlong/pull/2740#discussion_r815276237



##########
File path: inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/CommonOperateService.java
##########
@@ -41,6 +51,77 @@
     @Autowired
     private InlongGroupEntityMapper groupMapper;
 
+    @Autowired
+    private DataProxyClusterEntityMapper dataProxyClusterMapper;
+
+    @Autowired
+    private ThirdPartyClusterEntityMapper thirdPartyClusterMapper;
+
+    /**
+     * query some third-party-cluster info according key, such as "pulsar_adminUrl", "cluster_tube_manager", etc.
+     *
+     * @param key
+     * @return the value of key in database
+     */
+    public String getSpecifiedParam(String key) {
+        String result = "";
+        ThirdPartyClusterEntity clusterEntity;
+        Gson gson = new Gson();
+        Map<String, String> params;
+
+        switch (key) {
+            case Constant.PULSAR_ADMINURL:
+            case Constant.PULSAR_SERVICEURL: {
+                clusterEntity = getThirdPartyCluster(Constant.MIDDLEWARE_PULSAR);
+                if (clusterEntity != null) {
+                    params = gson.fromJson(clusterEntity.getExtParams(), Map.class);
+                    result = params.get(key);
+                }
+                break;
+            }
+            case Constant.CLUSTER_TUBE_MANAGER:
+            case Constant.CLUSTER_TUBE_CLUSTER_ID:
+            case Constant.TUBE_MASTER_URL: {
+                clusterEntity = getThirdPartyCluster(Constant.MIDDLEWARE_TUBE);
+                if (clusterEntity != null) {
+                    if (key.equals(Constant.TUBE_MASTER_URL)) {
+                        result = clusterEntity.getUrl();
+                    } else {
+                        params = gson.fromJson(clusterEntity.getExtParams(), Map.class);
+                        result = params.get(key);
+                    }
+                }
+                break;
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * @param type third-party-cluster type, such as TUBE, PULSAR, ZOOKEEPER, SORT

Review comment:
       remove ZOOKEEPER and SORT




-- 
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] [incubator-inlong] dockerzhang merged pull request #2740: [INLONG-2677][Manager] Get MQ cluster from database, remove local file configuration dependency

Posted by GitBox <gi...@apache.org>.
dockerzhang merged pull request #2740:
URL: https://github.com/apache/incubator-inlong/pull/2740


   


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