VGalaxies commented on code in PR #12751:
URL: https://github.com/apache/iotdb/pull/12751#discussion_r1642742514
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeInsertNodeTabletInsertionEvent.java:
##########
@@ -205,29 +205,36 @@ public boolean isGeneratedByPipe() {
@Override
public boolean mayEventTimeOverlappedWithTimeRange() {
try {
- final InsertNode insertNode = getInsertNode();
+ final InsertNode insertNode = getInsertNodeViaCacheIfPossible();
+ if (Objects.isNull(insertNode)) {
+ return true;
+ }
+
if (insertNode instanceof InsertRowNode) {
final long timestamp = ((InsertRowNode) insertNode).getTime();
return startTime <= timestamp && timestamp <= endTime;
- } else if (insertNode instanceof InsertTabletNode) {
+ }
+
+ if (insertNode instanceof InsertTabletNode) {
final long[] timestamps = ((InsertTabletNode) insertNode).getTimes();
if (Objects.isNull(timestamps) || timestamps.length == 0) {
return false;
}
// We assume that `timestamps` is ordered.
return startTime <= timestamps[timestamps.length - 1] && timestamps[0]
<= endTime;
- } else if (insertNode instanceof InsertRowsNode) {
+ }
+
+ if (insertNode instanceof InsertRowsNode) {
for (final InsertRowNode node : ((InsertRowsNode)
insertNode).getInsertRowNodeList()) {
final long timestamp = node.getTime();
Review Comment:
use stream like [`5f79e07`
(#12751)](https://github.com/apache/iotdb/pull/12751/commits/5f79e07b1ea0c2b5f8c713d229a36b5c2fbcc403#diff-34659d7ee3257a64a7863eb5b7aa3e6bf86f2f8ad9abaa9f5d8894108d70213bR265)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]