Caideyipi commented on code in PR #12085:
URL: https://github.com/apache/iotdb/pull/12085#discussion_r1506947535


##########
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/event/TsFileInsertionDataContainerTest.java:
##########
@@ -192,9 +194,17 @@ private void testToTabletInsertionEvents(
     }
 
     try (final TsFileInsertionDataContainer alignedContainer =
-            new TsFileInsertionDataContainer(alignedTsFile, "root", startTime, 
endTime);
+            new TsFileInsertionDataContainer(
+                alignedTsFile,
+                new PipePattern("root", PipePatternFormat.PREFIX),

Review Comment:
   May add some "IOTDB" format in these tests



##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/pipe/task/CreatePipeProcedureV2.java:
##########
@@ -67,6 +68,16 @@ public CreatePipeProcedureV2() {
   public CreatePipeProcedureV2(TCreatePipeReq createPipeRequest) throws 
PipeException {
     super();
     this.createPipeRequest = createPipeRequest;
+    // For newly created pipes, we add an internal "source.version" attribute 
to identify them.
+    // Pipes without this attribute will be treated as legacy version, and 
their default pattern
+    // format will be "prefix".
+    // Pipes with this attribute will be treated as new version, and their 
default pattern format
+    // will be "iotdb".
+    this.createPipeRequest
+        .getExtractorAttributes()
+        .put(
+            PipeExtractorConstant.SOURCE_VERSION_KEY,

Review Comment:
   Is it OK to show it to users?



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/pattern/PipePattern.java:
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.pipe.pattern;
+
+import javax.validation.constraints.NotNull;
+
+import java.util.Objects;
+
+public class PipePattern {
+
+  private final String pattern;
+  private final PipePatternFormat format;
+
+  public PipePattern(String pattern, @NotNull PipePatternFormat format) {

Review Comment:
   Better not use "@NotNull" mark since this may introduce extra dependency. If 
format is null you can assign a value to it



##########
integration-test/src/test/java/org/apache/iotdb/pipe/it/AbstractPipeDualIT.java:
##########
@@ -26,7 +26,7 @@
 import org.junit.After;
 import org.junit.Before;
 
-abstract class AbstractPipeDualIT {
+public abstract class AbstractPipeDualIT {

Review Comment:
   There is no need to add "public" and pipe meta has changed this part.



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/pattern/PipePattern.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.pipe.pattern;
+
+import java.util.Objects;
+
+public class PipePattern {

Review Comment:
   If this is printed add "toString" method.



-- 
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]

Reply via email to