Caideyipi commented on code in PR #18639:
URL: https://github.com/apache/iotdb/pull/18639#discussion_r4281297472
##########
iotdb-client/subscription/src/test/java/org/apache/iotdb/session/subscription/consumer/base/SubscriptionConsumerMultiProviderPollTest.java:
##########
@@ -93,14 +94,41 @@ public void testPollBacksOffAfterAllProvidersAreEmpty()
throws SubscriptionExcep
}
}
+ @Test
+ public void testFilteredTabletBatchIsAckedWithoutReturningEmptyMessage()
+ throws SubscriptionException {
+ final TestPullConsumer consumer = new TestPullConsumer(1, 0, true);
+ try {
+ consumer.open();
+ consumer.subscribeTopic();
+
+ final List<SubscriptionMessage> messages = consumer.pollForTest(1_000L);
+
+ Assert.assertTrue(messages.isEmpty());
+ Assert.assertEquals(1, consumer.getAcknowledgedCommitContexts().size());
+ Assert.assertEquals(
+ new SubscriptionCommitContext(1, 0, TOPIC, CONSUMER_GROUP_ID, 0L),
+ consumer.getAcknowledgedCommitContexts().get(0));
Review Comment:
Renamed the test to
`testFullyFilteredTabletBatchIsAcknowledgedAndPollReturnsNoMessages`. The
expected result is an empty poll result, rather than a `SubscriptionMessage`
carrying an empty Tablet payload; the filtered batch is still acknowledged.
Commit: 7caec10c275.
##########
iotdb-core/confignode/src/main/i18n/zh/org/apache/iotdb/confignode/i18n/ConfigNodeMessages.java:
##########
@@ -718,6 +718,15 @@ private ConfigNodeMessages() {}
public static final String
EXCEPTION_FAILED_TO_CREATE_OR_ALTER_TOPIC_ARG_AND_ARG_ARE_ONLY_SUPPORTED_FOR_INCREMENTAL_TOPICS_D86CEA8E
=
"创建或修改 topic 失败,%s 和 %s 仅支持 incremental 模式的 topic";
+ public static final String
+
EXCEPTION_FAILED_TO_CREATE_OR_ALTER_TOPIC_DUPLICATE_ARG_ATTRIBUTES_ARE_NOT_ALLOWED_27315578
=
+ "\u521b\u5efa\u6216\u4fee\u6539 Topic
\u5931\u8d25\uff0c\u4e0d\u5141\u8bb8\u91cd\u590d\u7684 %s \u5c5e\u6027";
+ public static final String
+
EXCEPTION_FAILED_TO_CREATE_OR_ALTER_TOPIC_ARG_IS_ONLY_SUPPORTED_FOR_TABLE_TOPICS_A5126607
=
+ "\u521b\u5efa\u6216\u4fee\u6539 Topic \u5931\u8d25\uff0c%s
\u4ec5\u652f\u6301\u8868\u6a21\u578b Topic";
+ public static final String
+
EXCEPTION_FAILED_TO_CREATE_OR_ALTER_TOPIC_ARG_SHOULD_NOT_BE_EMPTY_767B1148 =
+ "\u521b\u5efa\u6216\u4fee\u6539 Topic \u5931\u8d25\uff0c%s
\u4e0d\u5e94\u4e3a\u7a7a";
Review Comment:
Replaced the Unicode escapes with readable UTF-8 Chinese text for all three
messages, preserving the format placeholders.
Commit: 7caec10c275.
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/payload/evolvable/batch/PipeTabletEventTsFileBatch.java:
##########
@@ -100,25 +126,22 @@ protected boolean constructBatch(final
TabletInsertionEvent event) {
(PipeInsertNodeTabletInsertionEvent) event;
final boolean isTableModel =
insertNodeTabletInsertionEvent.isTableModelEvent();
final List<Tablet> tablets =
insertNodeTabletInsertionEvent.convertToTablets();
- final List<Tablet> retainedTablets = new ArrayList<>(tablets.size());
- final List<Boolean> retainedAlignedFlags = new
ArrayList<>(tablets.size());
+ final List<TabletTransformResult> retainedTablets = new
ArrayList<>(tablets.size());
for (int i = 0; i < tablets.size(); ++i) {
- Tablet tablet = tablets.get(i);
+ final Tablet tablet = tablets.get(i);
if (isTabletEmpty(tablet)) {
continue;
}
- if (isTableModel) {
- tablet =
- pruneTableModelTablet(
- tablet,
insertNodeTabletInsertionEvent.getTableModelDatabaseName());
- if (isTabletEmpty(tablet)) {
- continue;
- }
- }
- retainedTablets.add(tablet);
- if (!isTableModel) {
-
retainedAlignedFlags.add(insertNodeTabletInsertionEvent.isAligned(i));
+ final TabletTransformResult transformedTablet =
+ transformTablet(
+ isTableModel ?
insertNodeTabletInsertionEvent.getTableModelDatabaseName() : null,
Review Comment:
Applied: `PipeInsertionEvent.getTableModelDatabaseName()` now returns null
for tree-model events. Both transformation call sites use the getter directly.
Added coverage for the database name passed for both event models.
Commit: 7caec10c275.
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/payload/evolvable/batch/PipeTabletEventTsFileBatch.java:
##########
@@ -127,50 +150,58 @@ protected boolean constructBatch(final
TabletInsertionEvent event) {
if (retainedTablets.isEmpty()) {
return false;
}
-
increaseTotalBufferSizeAndUpdateMemoryBlock(calculateTabletsSizeInBytes(retainedTablets));
- for (int i = 0; i < retainedTablets.size(); ++i) {
- final Tablet tablet = retainedTablets.get(i);
- if (isTableModel) {
+ increaseTotalBufferSizeAndUpdateMemoryBlock(
+ calculateTabletsSizeInBytes(
+ retainedTablets.stream()
+ .map(TabletTransformResult::getTablet)
+ .collect(java.util.stream.Collectors.toList())));
Review Comment:
Added the `Collectors` import and removed the fully qualified reference.
Commit: 7caec10c275.
--
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]