Skip to content

Commit 02e358b

Browse files
luoluoyuyuJackieTien97
authored andcommitted
[To dev/1.3] Pipe: Delete the heartbeat event count in Remaining Count #16115 (#16116)
* Pipe: Delete the heartbeat event count in Remaining Count * update * delete getRemainingEvents function
1 parent 902aa35 commit 02e358b

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/metric/overview/PipeDataNodeRemainingEventAndTimeOperator.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,8 @@ public long getRemainingNonHeartbeatEvents() {
116116
return remainingEvents >= 0 ? remainingEvents : 0;
117117
}
118118

119-
long getRemainingEvents() {
120-
final long remainingEvents =
121-
tsfileEventCount.get()
122-
+ rawTabletEventCount.get()
123-
+ insertNodeEventCount.get()
124-
+ heartbeatEventCount.get()
125-
+ schemaRegionExtractors.stream()
126-
.map(IoTDBSchemaRegionExtractor::getUnTransferredEventCount)
127-
.reduce(Long::sum)
128-
.orElse(0L);
129-
130-
// There are cases where the indicator is negative. For example, after the Pipe is restarted,
131-
// the Processor SubTask is still collecting Events, resulting in a negative count. This
132-
// situation cannot be avoided because the Pipe may be restarted internally.
133-
return remainingEvents >= 0 ? remainingEvents : 0;
119+
public int getInsertNodeEventCount() {
120+
return insertNodeEventCount.get();
134121
}
135122

136123
/**

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/metric/overview/PipeDataNodeSinglePipeMetrics.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private void createAutoGauge(final String pipeID) {
8989
Metric.PIPE_DATANODE_REMAINING_EVENT_COUNT.toString(),
9090
MetricLevel.IMPORTANT,
9191
operator,
92-
PipeDataNodeRemainingEventAndTimeOperator::getRemainingEvents,
92+
PipeDataNodeRemainingEventAndTimeOperator::getRemainingNonHeartbeatEvents,
9393
Tag.NAME.toString(),
9494
operator.getPipeName(),
9595
Tag.CREATION_TIME.toString(),
@@ -399,7 +399,7 @@ public Pair<Long, Double> getRemainingEventAndTime(
399399
remainingEventAndTimeOperatorMap.computeIfAbsent(
400400
pipeName + "_" + creationTime,
401401
k -> new PipeDataNodeRemainingEventAndTimeOperator(pipeName, creationTime));
402-
return new Pair<>(operator.getRemainingEvents(), operator.getRemainingTime());
402+
return new Pair<>(operator.getRemainingNonHeartbeatEvents(), operator.getRemainingTime());
403403
}
404404

405405
//////////////////////////// singleton ////////////////////////////

0 commit comments

Comments
 (0)