Skip to content

Commit f2c1a2a

Browse files
authored
Pipe: Fixed the bug that delete timeSeries / logicalView cannot be transferred (apache#14867)
1 parent 2c4acfc commit f2c1a2a

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeIdempotentIT.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ public void testDeleteTimeSeriesIdempotent() throws Exception {
170170
Collections.singletonList(
171171
"create timeSeries root.ln.wf01.wt01.status0(status0) with datatype=BOOLEAN,encoding=PLAIN"),
172172
"delete timeSeries root.ln.wf01.wt01.status0",
173-
"create timeSeries root.ln.wf01.wt01.status2(status2) with datatype=BOOLEAN,encoding=PLAIN",
174-
"count timeSeries",
175-
"count(timeseries),",
176-
Collections.singleton("1,"));
173+
"create database root.sg",
174+
"count databases",
175+
"count,",
176+
Collections.singleton("2,"));
177177
}
178178

179179
@Test
@@ -262,10 +262,10 @@ public void testDeactivateTemplateIdempotent() throws Exception {
262262
"create timeSeries using device template on root.sg1.d1",
263263
"create timeSeries using device template on root.sg1.d2"),
264264
"delete timeSeries of schema template t1 from root.sg1.*",
265-
"create timeSeries using device template on root.sg1.d3",
266-
"count timeSeries",
267-
"count(timeseries),",
268-
Collections.singleton("3,"));
265+
"create database root.sg2",
266+
"count databases",
267+
"count,",
268+
Collections.singleton("2,"));
269269
}
270270

271271
@Test

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/write/pipe/payload/PipeDeleteLogicalViewPlan.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
import org.apache.tsfile.utils.ReadWriteIOUtils;
2626

27+
import javax.annotation.Nonnull;
28+
2729
import java.io.DataOutputStream;
2830
import java.io.IOException;
2931
import java.nio.ByteBuffer;
@@ -38,12 +40,13 @@ public PipeDeleteLogicalViewPlan() {
3840
super(ConfigPhysicalPlanType.PipeDeleteLogicalView);
3941
}
4042

41-
public PipeDeleteLogicalViewPlan(final ByteBuffer patternTreeBytes) {
43+
public PipeDeleteLogicalViewPlan(final @Nonnull ByteBuffer patternTreeBytes) {
4244
super(ConfigPhysicalPlanType.PipeDeleteLogicalView);
4345
this.patternTreeBytes = patternTreeBytes;
4446
}
4547

4648
public ByteBuffer getPatternTreeBytes() {
49+
patternTreeBytes.rewind();
4750
return patternTreeBytes;
4851
}
4952

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/write/pipe/payload/PipeDeleteTimeSeriesPlan.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
import org.apache.tsfile.utils.ReadWriteIOUtils;
2626

27+
import javax.annotation.Nonnull;
28+
2729
import java.io.DataOutputStream;
2830
import java.io.IOException;
2931
import java.nio.ByteBuffer;
@@ -38,12 +40,13 @@ public PipeDeleteTimeSeriesPlan() {
3840
super(ConfigPhysicalPlanType.PipeDeleteTimeSeries);
3941
}
4042

41-
public PipeDeleteTimeSeriesPlan(final ByteBuffer patternTreeBytes) {
43+
public PipeDeleteTimeSeriesPlan(final @Nonnull ByteBuffer patternTreeBytes) {
4244
super(ConfigPhysicalPlanType.PipeDeleteTimeSeries);
4345
this.patternTreeBytes = patternTreeBytes;
4446
}
4547

4648
public ByteBuffer getPatternTreeBytes() {
49+
patternTreeBytes.rewind();
4750
return patternTreeBytes;
4851
}
4952

0 commit comments

Comments
 (0)