This is an automated email from the ASF dual-hosted git repository.

justinchen pushed a commit to branch cp-opc-client
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/cp-opc-client by this push:
     new 92e528d893c fix
92e528d893c is described below

commit 92e528d893c42f0f580c5e15644491e79c3fa61f
Author: Caideyipi <[email protected]>
AuthorDate: Thu Mar 26 17:11:49 2026 +0800

    fix
---
 .../apache/iotdb/db/pipe/sink/PipeSinkTest.java    | 40 ++++++++++------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/PipeSinkTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/PipeSinkTest.java
index 735db4b1baf..fae64308762 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/PipeSinkTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/PipeSinkTest.java
@@ -21,16 +21,26 @@ package org.apache.iotdb.db.pipe.sink;
 
 import org.apache.iotdb.commons.pipe.agent.plugin.builtin.BuiltinPipePlugin;
 import org.apache.iotdb.commons.pipe.config.constant.PipeSinkConstant;
+import 
org.apache.iotdb.commons.pipe.config.plugin.configuraion.PipeTaskRuntimeConfiguration;
+import 
org.apache.iotdb.commons.pipe.config.plugin.env.PipeTaskSinkRuntimeEnvironment;
+import 
org.apache.iotdb.db.pipe.event.common.tablet.PipeRawTabletInsertionEvent;
 import org.apache.iotdb.db.pipe.sink.protocol.legacy.IoTDBLegacyPipeSink;
+import org.apache.iotdb.db.pipe.sink.protocol.opcua.OpcUaSink;
 import 
org.apache.iotdb.db.pipe.sink.protocol.thrift.async.IoTDBDataRegionAsyncSink;
 import 
org.apache.iotdb.db.pipe.sink.protocol.thrift.sync.IoTDBDataRegionSyncSink;
 import org.apache.iotdb.pipe.api.customizer.parameter.PipeParameterValidator;
 import org.apache.iotdb.pipe.api.customizer.parameter.PipeParameters;
 
+import org.apache.tsfile.enums.TSDataType;
+import org.apache.tsfile.write.record.Tablet;
+import org.apache.tsfile.write.schema.MeasurementSchema;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.security.SecureRandom;
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.List;
 
 public class PipeSinkTest {
 
@@ -95,7 +105,7 @@ public class PipeSinkTest {
 
   @Test
   public void testOpcUaSink() {
-    final List<IMeasurementSchema> schemaList =
+    final List<MeasurementSchema> schemaList =
         Arrays.asList(
             new MeasurementSchema("s1", TSDataType.INT64),
             new MeasurementSchema("s2", TSDataType.INT64));
@@ -104,16 +114,16 @@ public class PipeSinkTest {
 
     long timestamp = System.currentTimeMillis();
     for (long row = 0; row < 100; row++) {
-      final int rowSize = tablet.getRowSize();
+      final int rowSize = tablet.rowSize;
       tablet.addTimestamp(rowSize, timestamp);
       for (int i = 0; i < 2; i++) {
         tablet.addValue(
-            schemaList.get(i).getMeasurementName(), rowSize, new 
SecureRandom().nextLong());
+            schemaList.get(i).getMeasurementId(), rowSize, new 
SecureRandom().nextLong());
       }
       timestamp++;
     }
 
-    final List<IMeasurementSchema> opcSchemaList =
+    final List<MeasurementSchema> opcSchemaList =
         Arrays.asList(
             new MeasurementSchema("value1", TSDataType.INT64),
             new MeasurementSchema("quality1", TSDataType.BOOLEAN));
@@ -121,11 +131,11 @@ public class PipeSinkTest {
 
     timestamp = System.currentTimeMillis();
     for (long row = 0; row < 100; row++) {
-      final int rowSize = qualityTablet.getRowSize();
+      final int rowSize = qualityTablet.rowSize;
       qualityTablet.addTimestamp(rowSize, timestamp);
       qualityTablet.addValue(
-          opcSchemaList.get(0).getMeasurementName(), rowSize, new 
SecureRandom().nextLong());
-      qualityTablet.addValue(opcSchemaList.get(1).getMeasurementName(), 
rowSize, true);
+          opcSchemaList.get(0).getMeasurementId(), rowSize, new 
SecureRandom().nextLong());
+      qualityTablet.addValue(opcSchemaList.get(1).getMeasurementId(), rowSize, 
true);
       timestamp++;
     }
 
@@ -157,8 +167,7 @@ public class PipeSinkTest {
               }),
           configuration);
       final PipeRawTabletInsertionEvent event =
-          new PipeRawTabletInsertionEvent(
-              false, "root.db", "db", "root.db", tablet, false, "pipe", 0L, 
null, null, false);
+          new PipeRawTabletInsertionEvent(tablet, false, "pipe", 0L, null, 
null, false);
       event.increaseReferenceCount("");
       normalOPC.transfer(event);
       // Shall not throw
@@ -166,18 +175,7 @@ public class PipeSinkTest {
       event.decreaseReferenceCount("", false);
 
       qualityOPC.transfer(
-          new PipeRawTabletInsertionEvent(
-              false,
-              "root.db",
-              "db",
-              "root.db",
-              qualityTablet,
-              false,
-              "pipe",
-              0L,
-              null,
-              null,
-              false));
+          new PipeRawTabletInsertionEvent(qualityTablet, false, "pipe", 0L, 
null, null, false));
 
     } catch (Exception e) {
       Assert.fail();

Reply via email to