You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "vernedeng (via GitHub)" <gi...@apache.org> on 2024/11/26 08:45:58 UTC
[PR] [INLONG-11546][SDK] Support async and sync report dirty data [inlong]
vernedeng opened a new pull request, #11547:
URL: https://github.com/apache/inlong/pull/11547
<!-- Prepare a Pull Request
Change the title of pull request refer to the following example:
[INLONG-XYZ][Component] Title of the pull request
-->
<!-- Specify the issue this pull request going to fix.
The following *XYZ* should be replaced by the actual [GitHub Issue](https://github.com/apache/inlong/issues) number)-->
Fixes #11546
### Motivation
Provide async and sync way to report dirty data
### Modifications
Add sendDirtyMessageSync and sendDirtyMessageAsync method
### 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)*
- [ ] 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
Re: [PR] [INLONG-11546][SDK] Support async and sync report dirty data [inlong]
Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng commented on code in PR #11547:
URL: https://github.com/apache/inlong/pull/11547#discussion_r1858187521
##########
inlong-sdk/dirty-data-sdk/src/main/java/org/apache/inlong/sdk/dirtydata/InlongSdkDirtySender.java:
##########
@@ -75,7 +74,15 @@ public void init() throws Exception {
}
public void sendDirtyMessage(DirtyMessageWrapper messageWrapper) throws InterruptedException {
- dirtyDataQueue.offer(messageWrapper, 10, TimeUnit.SECONDS);
+ dirtyDataQueue.put(messageWrapper);
+ }
+
+ public boolean sendDirtyMessageAsync(DirtyMessageWrapper messageWrapper) {
+ boolean result = dirtyDataQueue.offer(messageWrapper);
+ if (!result) {
+ log.warn("send dirty message async queue is full, you can increase maxCallbackSize");
+ }
Review Comment:
just remove this log
--
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
Re: [PR] [INLONG-11546][SDK] Support async and sync report dirty data [inlong]
Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng commented on code in PR #11547:
URL: https://github.com/apache/inlong/pull/11547#discussion_r1858081361
##########
inlong-sdk/dirty-data-sdk/src/main/java/org/apache/inlong/sdk/dirtydata/InlongSdkDirtySender.java:
##########
@@ -74,8 +73,14 @@ public void init() throws Exception {
log.info("init InlongSdkDirtySink successfully, target group={}, stream={}", inlongGroupId, inlongStreamId);
}
- public void sendDirtyMessage(DirtyMessageWrapper messageWrapper) throws InterruptedException {
- dirtyDataQueue.offer(messageWrapper, 10, TimeUnit.SECONDS);
+ public void sendDirtyMessageSync(DirtyMessageWrapper messageWrapper) throws InterruptedException {
Review Comment:
fixed, thx
--
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
Re: [PR] [INLONG-11546][SDK] Support async and sync report dirty data [inlong]
Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #11547:
URL: https://github.com/apache/inlong/pull/11547#discussion_r1858076799
##########
inlong-sdk/dirty-data-sdk/src/main/java/org/apache/inlong/sdk/dirtydata/InlongSdkDirtySender.java:
##########
@@ -74,8 +73,14 @@ public void init() throws Exception {
log.info("init InlongSdkDirtySink successfully, target group={}, stream={}", inlongGroupId, inlongStreamId);
}
- public void sendDirtyMessage(DirtyMessageWrapper messageWrapper) throws InterruptedException {
- dirtyDataQueue.offer(messageWrapper, 10, TimeUnit.SECONDS);
+ public void sendDirtyMessageSync(DirtyMessageWrapper messageWrapper) throws InterruptedException {
Review Comment:
```suggestion
public void sendDirtyMessage(DirtyMessageWrapper messageWrapper) throws InterruptedException {
```
--
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
Re: [PR] [INLONG-11546][SDK] Support async and sync report dirty data [inlong]
Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng commented on code in PR #11547:
URL: https://github.com/apache/inlong/pull/11547#discussion_r1858188409
##########
inlong-sdk/dirty-data-sdk/src/main/java/org/apache/inlong/sdk/dirtydata/InlongSdkDirtySender.java:
##########
@@ -75,7 +74,15 @@ public void init() throws Exception {
}
public void sendDirtyMessage(DirtyMessageWrapper messageWrapper) throws InterruptedException {
- dirtyDataQueue.offer(messageWrapper, 10, TimeUnit.SECONDS);
+ dirtyDataQueue.put(messageWrapper);
+ }
Review Comment:
we provide an async method sendDirtyMessageAsync
--
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
Re: [PR] [INLONG-11546][SDK] Support async and sync report dirty data [inlong]
Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng merged PR #11547:
URL: https://github.com/apache/inlong/pull/11547
--
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
Re: [PR] [INLONG-11546][SDK] Support async and sync report dirty data [inlong]
Posted by "baomingyu (via GitHub)" <gi...@apache.org>.
baomingyu commented on code in PR #11547:
URL: https://github.com/apache/inlong/pull/11547#discussion_r1858097984
##########
inlong-sdk/dirty-data-sdk/src/main/java/org/apache/inlong/sdk/dirtydata/InlongSdkDirtySender.java:
##########
@@ -75,7 +74,15 @@ public void init() throws Exception {
}
public void sendDirtyMessage(DirtyMessageWrapper messageWrapper) throws InterruptedException {
- dirtyDataQueue.offer(messageWrapper, 10, TimeUnit.SECONDS);
+ dirtyDataQueue.put(messageWrapper);
+ }
+
+ public boolean sendDirtyMessageAsync(DirtyMessageWrapper messageWrapper) {
+ boolean result = dirtyDataQueue.offer(messageWrapper);
+ if (!result) {
+ log.warn("send dirty message async queue is full, you can increase maxCallbackSize");
+ }
Review Comment:
need control the frequency of log outputs
##########
inlong-sdk/dirty-data-sdk/src/main/java/org/apache/inlong/sdk/dirtydata/InlongSdkDirtySender.java:
##########
@@ -75,7 +74,15 @@ public void init() throws Exception {
}
public void sendDirtyMessage(DirtyMessageWrapper messageWrapper) throws InterruptedException {
- dirtyDataQueue.offer(messageWrapper, 10, TimeUnit.SECONDS);
+ dirtyDataQueue.put(messageWrapper);
+ }
Review Comment:
this function may block the main process.
--
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