Skip to content

Pipe: refact pipe remaining metrics calculation#13640

Draft
VGalaxies wants to merge 11 commits intoapache:masterfrom
VGalaxies:fix-remaining-time
Draft

Pipe: refact pipe remaining metrics calculation#13640
VGalaxies wants to merge 11 commits intoapache:masterfrom
VGalaxies:fix-remaining-time

Conversation

@VGalaxies
Copy link
Contributor

TBD.

@SteveYurongSu SteveYurongSu self-assigned this Sep 26, 2024
return inputPendingQueue.isEmpty();
}

/** DO NOT FORGET to set eventCounter to new value after invoking this method. */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SteveYurongSu what for?

@VGalaxies VGalaxies changed the title Pipe: exclude raw tablet events with needToReport set to false when calculating commit rate to avoid extremely low remaining time Pipe: refact pipe remaining metrics calculation Oct 1, 2024
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Refactors the pipe remaining metrics calculation to distinguish historical vs. realtime events and unify event‐count filtering.

  • Introduces CommitRateMarker and updates commit logic to include a realtime flag.
  • Replaces many getEventCount() methods with predicate-based filtering on EnrichedEvent.
  • Overhauls PipeDataNodeRemainingEventAndTimeOperator to separately compute historical and realtime remaining‐time metrics.

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
EnrichedEvent.java Added isDataRegionRealtimeEvent and needToCommitRate defaults.
PipeEventCommitManager.java Switched to CommitRateMarker, updated commit calls.
CommitRateMarker.java New interface for commit‐rate reporting with realtime flag.
SubscriptionConnectorSubtask.java Changed getEventCount to accept a Predicate<EnrichedEvent>.
SubscriptionPipeTsFilePlainEvent.java Adapted getPipeEventCount to predicate filter.
SubscriptionPipeTsFileBatchEvents.java Predicate‐based event counting in batch.
SubscriptionPipeTabletBatchEvents.java Predicate‐based event counting in tablet batch.
SubscriptionPipeEvents.java Updated interface signature to use predicates.
SubscriptionPipeEmptyEvent.java Predicate‐based empty count.
SubscriptionPipeTsFileEventBatch.java Removed old enriched‐event size metrics.
SubscriptionPipeTabletEventBatch.java Removed outdated enriched‐events list and count.
SubscriptionPipeEventBatch.java Added enrichedEvents list and predicate filtering.
SubscriptionEvent.java Switched to predicate‐based getPipeEventCount.
SubscriptionPrefetchingQueue.java Predicate version of getPipeEventCount.
SubscriptionBroker.java Propagated predicate to getPipeEventCount.
SubscriptionBlockingPendingQueue.java Added forEach helper.
SubscriptionBrokerAgent.java Predicate‐aware broker event count.
PipeDataNodeRemainingEventAndTimeOperator.java Major refactor separating historical vs. realtime metrics, added filtering predicates.
PipeDataNodeRemainingEventAndTimeMetrics.java Updated markRegionCommit to include realtime flag.
PipeRealtimeDataRegionExtractor.java Predicate‐based getEventCount on realtime extractor.
IoTDBDataRegionExtractor.java Renamed to getRealtimeEventCount with predicate.
PipeTsFileInsertionEvent.java Implemented isDataRegionRealtimeEvent.
PipeRawTabletInsertionEvent.java Overrode realtime/event‐rate logic.
IoTDBDataRegionAsyncConnector.java Changed getRetryEventCount to predicate signature.
PipeProcessorSubtask.java Changed getEventCount to predicate signature.
PipeConnectorSubtask.java Predicate‐based getEventCount and retry counts.
pom.xml Added metrics-core dependency.
PipeConfigNodeRemainingTimeMetrics.java Updated markRegionCommit to include realtime flag.
Comments suppressed due to low confidence (1)

iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/event/EnrichedEvent.java:331

  • Defaulting isDataRegionRealtimeEvent() to always return true means all events are treated as realtime. Consider returning false by default and only overriding in subclasses that truly represent realtime events.
  }

: totalDataRegionWriteEventCount / lastDataRegionCommitSmoothingValue;
dataRegionRealtimeEventRemainingTime =
lastDataRegionRealtimeEventCommitSmoothingValue <= 0
? 0 // NOTE HERE
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

Returning 0 when the realtime commit‐rate smoothing value is ≤ 0 underestimates remaining time. For symmetry with historical events, consider returning Double.MAX_VALUE to indicate unbounded remaining time.

Suggested change
? 0 // NOTE HERE
? Double.MAX_VALUE // Indicate unbounded remaining time

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants