Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INLONG-11546][SDK] Support async and sync report dirty data #11547

Merged
merged 5 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;

@Slf4j
@Builder
Expand Down Expand Up @@ -75,7 +74,11 @@ public void init() throws Exception {
}

public void sendDirtyMessage(DirtyMessageWrapper messageWrapper) throws InterruptedException {
dirtyDataQueue.offer(messageWrapper, 10, TimeUnit.SECONDS);
dirtyDataQueue.put(messageWrapper);
}
vernedeng marked this conversation as resolved.
Show resolved Hide resolved

public boolean sendDirtyMessageAsync(DirtyMessageWrapper messageWrapper) {
return dirtyDataQueue.offer(messageWrapper);
}

private void doSendDirtyMessage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void invoke(DirtyData<T> dirtyData) throws Exception {
.data(dirtyMessage)
.build();

dirtySender.sendDirtyMessage(wrapper);
dirtySender.sendDirtyMessageAsync(wrapper);
} catch (Throwable t) {
log.error("failed to send dirty message to inlong sdk", t);
if (!options.isIgnoreSideOutputErrors()) {
Expand Down
Loading