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/04 11:59:44 UTC

[GitHub] [inlong] fuweng11 opened a new pull request, #6411: [INLONG-6410][Manager] Ensure that the additional parameters of group and stream can be saved

fuweng11 opened a new pull request, #6411:
URL: https://github.com/apache/inlong/pull/6411

   
   ### Prepare a Pull Request
   
   - Fixes #6410 
   
   ### Motivation
   
   Ensure that the additional parameters of group and stream can be saved
   ### Modifications
   `InlongGroupDTO` extends `BasegInlongGroup`
   Ensure that the additional parameters of group and stream can be saved
   ### Verifying this change
   
   
   - [X] 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)*
   
   - [ ] This change added tests and can be verified as follows:
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (no)
   
   


-- 
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 #6411: [INLONG-6410][Manager] Ensure that the additional parameters of group and stream can be saved

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #6411:
URL: https://github.com/apache/inlong/pull/6411#discussion_r1014638247


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupOperator4TubeMQ.java:
##########
@@ -61,15 +63,25 @@ public InlongTubeMQInfo getFromEntity(InlongGroupEntity entity) {
 
         InlongTubeMQInfo groupInfo = new InlongTubeMQInfo();
         CommonBeanUtils.copyProperties(entity, groupInfo);
-
+        if (StringUtils.isNotBlank(entity.getExtParams())) {
+            InlongTubeMQDTO dto = InlongTubeMQDTO.getFromJson(entity.getExtParams());
+            CommonBeanUtils.copyProperties(dto, groupInfo);
+        }
         // TODO get the cluster
         // groupInfo.setTubeMaster();
         return groupInfo;
     }
 
     @Override
     protected void setTargetEntity(InlongGroupRequest request, InlongGroupEntity targetEntity) {
-        LOGGER.info("do nothing for inlong group with TubeMQ");
+        InlongTubeMQRequest tubeMQRequest = (InlongTubeMQRequest) request;
+        try {
+            InlongTubeMQDTO dto = InlongTubeMQDTO.getFromRequest(tubeMQRequest);
+            targetEntity.setExtParams(objectMapper.writeValueAsString(dto));
+        } catch (Exception e) {
+            throw new BusinessException(ErrorCodeEnum.SOURCE_INFO_INCORRECT.getMessage() + ": " + e.getMessage());
+        }
+        LOGGER.info("success set entity for inlong group with TubeMQ");

Review Comment:
   Not necessary to add this info log, just remove it.



-- 
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 #6411: [INLONG-6410][Manager] Ensure that the additional parameters of group and stream can be saved

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #6411:
URL: https://github.com/apache/inlong/pull/6411#discussion_r1014638768


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/consume/BaseInlongConsume.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.consume;
+
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * The base parameter class of InlongGroup, support user extend their own business params.
+ */
+@Data
+@AllArgsConstructor
+@ApiModel("Base info of inlong group")
+public class BaseInlongConsume {
+
+    // you can add extend parameters in this class
+
+}

Review Comment:
   Suggest adding one blank line after the end of `}`, then it will not appear this:
   
   <img width="115" alt="image" src="https://user-images.githubusercontent.com/31994335/200123281-0c60a7de-6215-477d-be2e-29ca2509f801.png">
   



-- 
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] gong commented on a diff in pull request #6411: [INLONG-6410][Manager] Ensure that the additional parameters of group and stream can be saved

Posted by GitBox <gi...@apache.org>.
gong commented on code in PR #6411:
URL: https://github.com/apache/inlong/pull/6411#discussion_r1014770780


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/consume/BaseInlongConsume.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.consume;
+
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * The base parameter class of InlongGroup, support user extend their own business params.
+ */

Review Comment:
   Maybe,`The base parameter class of InlongGroup` decription is error, `InlongGroup` should be modified to`InlongConsume`.



-- 
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] dockerzhang merged pull request #6411: [INLONG-6410][Manager] Ensure that the additional parameters of group and stream can be saved

Posted by GitBox <gi...@apache.org>.
dockerzhang merged PR #6411:
URL: https://github.com/apache/inlong/pull/6411


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