Skip to content
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 @@ -85,12 +85,14 @@ private PipeRawTabletInsertionEvent(
this.allocatedMemoryBlock =
PipeDataNodeResourceManager.memory().forceAllocateForTabletWithRetry(0);

addOnCommittedHook(
() -> {
if (shouldReportOnCommit) {
eliminateProgressIndex();
}
});
if (needToReport) {
addOnCommittedHook(
() -> {
if (shouldReportOnCommit) {
eliminateProgressIndex();
}
});
}
}

public PipeRawTabletInsertionEvent(
Expand Down Expand Up @@ -182,10 +184,8 @@ public boolean internallyDecreaseResourceReferenceCount(final String holderMessa
}

protected void eliminateProgressIndex() {
if (needToReport) {
if (sourceEvent instanceof PipeTsFileInsertionEvent) {
((PipeTsFileInsertionEvent) sourceEvent).eliminateProgressIndex();
}
if (sourceEvent instanceof PipeTsFileInsertionEvent) {
((PipeTsFileInsertionEvent) sourceEvent).eliminateProgressIndex();
}
}

Expand Down Expand Up @@ -253,6 +253,14 @@ public boolean mayEventPathsOverlappedWithPattern() {
}

public void markAsNeedToReport() {
if (!needToReport) {
addOnCommittedHook(
() -> {
if (shouldReportOnCommit) {
eliminateProgressIndex();
}
});
}
this.needToReport = true;
}

Expand All @@ -270,6 +278,11 @@ public EnrichedEvent getSourceEvent() {
return sourceEvent;
}

@Override
public boolean isShouldReportOnCommit() {
return shouldReportOnCommit && needToReport;
}

/////////////////////////// TabletInsertionEvent ///////////////////////////

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,17 @@ public boolean mayEventTimeOverlappedWithTimeRange() {
|| startTime <= resource.getFileEndTime() && resource.getFileStartTime() <= endTime;
}

@Override
public boolean shouldParseTime() {
if (!isTimeParsed
&& Objects.nonNull(resource)
&& startTime <= resource.getFileStartTime()
&& resource.getFileEndTime() <= endTime) {
isTimeParsed = true;
}
return !isTimeParsed;
}

@Override
public boolean mayEventPathsOverlappedWithPattern() {
if (Objects.isNull(resource) || !resource.isClosed()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.iotdb.commons.pipe.agent.task.meta.PipeTaskMeta;
import org.apache.iotdb.commons.pipe.datastructure.interval.Interval;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

Expand All @@ -43,7 +44,7 @@ public PipeCommitInterval(
this.pipeTaskMeta = pipeTaskMeta;
this.currentIndex =
Objects.nonNull(currentIndex) ? currentIndex : MinimumProgressIndex.INSTANCE;
this.onCommittedHooks = onCommittedHooks;
this.onCommittedHooks = new ArrayList<>(onCommittedHooks);
}

@Override
Expand Down
Loading