Skip to content
Merged
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 @@ -58,12 +58,22 @@ public SubscriptionPipeTsFileEventBatch(
@Override
public synchronized void ack() {
batch.decreaseEventsReferenceCount(this.getClass().getName(), true);
enrichedEvents.stream()
Copy link

Copilot AI May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an inline comment clarifying why only tsfile events are filtered for reference count decrease in ack(), emphasizing that tablet events are handled separately.

Copilot uses AI. Check for mistakes.
// only decrease reference count for tsfile event, since we already decrease reference count
// for tablet event in batch
.filter(event -> event instanceof PipeTsFileInsertionEvent)
.forEach(event -> event.decreaseReferenceCount(this.getClass().getName(), true));
}

@Override
public synchronized void cleanUp(final boolean force) {
// close batch, it includes clearing the reference count of events
batch.close();

// clear the reference count of events
for (final EnrichedEvent enrichedEvent : enrichedEvents) {
enrichedEvent.clearReferenceCount(this.getClass().getName());
}
enrichedEvents.clear();
}

Expand Down Expand Up @@ -103,7 +113,6 @@ protected void onTsFileInsertionEvent(final TsFileInsertionEvent event) {
} finally {
try {
event.close();
((PipeTsFileInsertionEvent) event).decreaseReferenceCount(this.getClass().getName(), false);
} catch (final Exception ignored) {
// no exceptions will be thrown
}
Expand Down
Loading