Skip to content

Commit 69b8d19

Browse files
committed
collect-tablet
1 parent 425a746 commit 69b8d19

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/event/TsFileInsertionEventParserTest.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -617,18 +617,15 @@ private void testTsFilePointNum(
617617
})
618618
.forEach(
619619
tabletInsertionEvent2 ->
620-
tabletInsertionEvent2.processTablet(
621-
(tablet, rowCollector) ->
622-
new PipeRawTabletInsertionEvent(tablet, false)
623-
.processRowByRow(
624-
(row, collector) -> {
620+
tabletInsertionEvent2.processTabletWithCollect(
621+
(tablet, collector) -> {
625622
try {
626-
rowCollector.collectRow(row);
627-
count3.addAndGet(getNonNullSize(row));
623+
collector.collectTablet(tablet);
624+
count3.addAndGet(getNonNullSize(tablet));
628625
} catch (final IOException e) {
629626
throw new RuntimeException(e);
630627
}
631-
})))));
628+
}))));
632629

633630
Assert.assertEquals(expectedCount, count1.get());
634631
Assert.assertEquals(expectedCount, count2.get());
@@ -648,4 +645,16 @@ private int getNonNullSize(final Row row) {
648645
}
649646
return count;
650647
}
648+
649+
private int getNonNullSize(final Tablet tablet) {
650+
int count = 0;
651+
for (int i=0; i<tablet.getRowSize(); ++i) {
652+
for (int j=0; j<tablet.getSchemas().size(); ++j) {
653+
if (!tablet.isNull(i, j)) {
654+
++count;
655+
}
656+
}
657+
}
658+
return count;
659+
}
651660
}

0 commit comments

Comments
 (0)