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/07/18 11:52:01 UTC
[GitHub] [inlong] yunqingmoswu opened a new pull request, #5106: [INLONG-5103][Manager] Add constant field support for stream source and transform node
yunqingmoswu opened a new pull request, #5106:
URL: https://github.com/apache/inlong/pull/5106
### Prepare a Pull Request
*(Change the title refer to the following example)*
Title: [INLONG-5103][Manager] Add constant field support for stream source and transform node
*(The following *XYZ* should be replaced by the actual [GitHub Issue](https://github.com/apache/inlong/issues) number)*
Fixes #5103
### Motivation
Add constant field support for stream source and transform node
### Modifications
Constant field will be supported in stream source and transform node.
### Verifying this change
*(Please pick either of the following options)*
- [ ] This change is a trivial rework/code cleanup without any test coverage.
- [x] This change is already covered by existing tests, such as:
*(please describe tests)*
- [ ] 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 follow-up 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] [inlong] yunqingmoswu closed pull request #5106: [INLONG-5103][Manager] Add constant field support for stream source and transform node
Posted by GitBox <gi...@apache.org>.
yunqingmoswu closed pull request #5106: [INLONG-5103][Manager] Add constant field support for stream source and transform node
URL: https://github.com/apache/inlong/pull/5106
--
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 #5106: [INLONG-5103][Manager] Add constant field support for stream source and transform node
Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #5106:
URL: https://github.com/apache/inlong/pull/5106#discussion_r923408156
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/util/ExtractNodeUtils.java:
##########
@@ -431,4 +385,16 @@ public static TubeMQExtractNode createExtractNode(TubeMQSource source) {
);
}
+ private static List<FieldInfo> parseFieldInfos(List<StreamField> streamFields, String nodeId) {
Review Comment:
Please add Java docs for static methods, thanks.
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/DefaultSortConfigOperator.java:
##########
@@ -130,44 +130,30 @@ private GroupInfo getLightweightGroupInfo(InlongGroupInfo groupInfo, List<Inlong
}
/**
- * Get Sort GroupInfo of normal inlong group.
+ * Get constant field from stream fields
*
- * @see org.apache.inlong.sort.protocol.GroupInfo
+ * @param nodeId The node id
+ * @param fields The stream fields
+ * @param constantFieldMap The constant field map
*/
- private GroupInfo getNormalGroupInfo(InlongGroupInfo groupInfo, List<InlongStreamInfo> streamInfoList) {
- // get source info
- Map<String, List<StreamSource>> sourceMap = sourceService.getSourcesMap(groupInfo, streamInfoList);
- // get sink info
- Map<String, List<StreamSink>> sinkMap = sinkService.getSinksMap(groupInfo, streamInfoList);
-
- // create StreamInfo for Sort protocol
- List<StreamInfo> sortStreamInfos = new ArrayList<>();
- for (InlongStreamInfo inlongStream : streamInfoList) {
- String streamId = inlongStream.getInlongStreamId();
- List<StreamSource> sources = sourceMap.get(streamId);
- List<StreamSink> sinks = sinkMap.get(streamId);
- StreamInfo sortStream = new StreamInfo(streamId,
- this.createNodesForStream(sources, sinks),
- this.createNodeRelationsForStream(sources, sinks));
- sortStreamInfos.add(sortStream);
+ private void parseConstantFieldMap(String nodeId, List<StreamField> fields,
+ Map<String, StreamField> constantFieldMap) {
+ if (fields != null && !fields.isEmpty()) {
Review Comment:
Maybe can refactor like this:
```java
if (Collections.isEmpty(fields)) {
return;
}
// loop directly
for (StreamField field : fields) {
...
}
```
--
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] yunqingmoswu commented on a diff in pull request #5106: [INLONG-5103][Manager] Add constant field support for stream source and transform node
Posted by GitBox <gi...@apache.org>.
yunqingmoswu commented on code in PR #5106:
URL: https://github.com/apache/inlong/pull/5106#discussion_r923481205
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/util/ExtractNodeUtils.java:
##########
@@ -431,4 +385,16 @@ public static TubeMQExtractNode createExtractNode(TubeMQSource source) {
);
}
+ private static List<FieldInfo> parseFieldInfos(List<StreamField> streamFields, String nodeId) {
Review Comment:
ok
--
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 #5106: [INLONG-5103][Manager] Add constant field support for stream source and transform node
Posted by GitBox <gi...@apache.org>.
dockerzhang merged PR #5106:
URL: https://github.com/apache/inlong/pull/5106
--
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