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

rong pushed a commit to branch pipe-package-refactor
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 8fd9521ff564fa265c71dab3c51c1815bb911208
Author: Steve Yurong Su <[email protected]>
AuthorDate: Wed Jun 7 03:29:13 2023 +0800

    Pipe: refactor package structure (node-commons)
---
 .../commons/pipe/utils/PipeBinaryTransformer.java  | 32 -----------------
 .../pipe/{task/meta => }/PipeMetaDeSerTest.java    |  6 +++-
 .../event/common/row}/PipeDataTypeTransformer.java | 40 ++++------------------
 .../iotdb/db/pipe/event/common/row/PipeRow.java    |  1 -
 4 files changed, 12 insertions(+), 67 deletions(-)

diff --git 
a/node-commons/src/main/java/org/apache/iotdb/commons/pipe/utils/PipeBinaryTransformer.java
 
b/node-commons/src/main/java/org/apache/iotdb/commons/pipe/utils/PipeBinaryTransformer.java
deleted file mode 100644
index 125de0e9206..00000000000
--- 
a/node-commons/src/main/java/org/apache/iotdb/commons/pipe/utils/PipeBinaryTransformer.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.commons.pipe.utils;
-
-public class PipeBinaryTransformer {
-  public static org.apache.iotdb.tsfile.utils.Binary transformToBinary(
-      org.apache.iotdb.pipe.api.type.Binary binary) {
-    return binary == null ? null : new 
org.apache.iotdb.tsfile.utils.Binary(binary.getValues());
-  }
-
-  public static org.apache.iotdb.pipe.api.type.Binary transformToPipeBinary(
-      org.apache.iotdb.tsfile.utils.Binary binary) {
-    return binary == null ? null : new 
org.apache.iotdb.pipe.api.type.Binary(binary.getValues());
-  }
-}
diff --git 
a/node-commons/src/test/java/org/apache/iotdb/commons/pipe/task/meta/PipeMetaDeSerTest.java
 
b/node-commons/src/test/java/org/apache/iotdb/commons/pipe/PipeMetaDeSerTest.java
similarity index 91%
rename from 
node-commons/src/test/java/org/apache/iotdb/commons/pipe/task/meta/PipeMetaDeSerTest.java
rename to 
node-commons/src/test/java/org/apache/iotdb/commons/pipe/PipeMetaDeSerTest.java
index b9fc0ef7e5d..c5813959938 100644
--- 
a/node-commons/src/test/java/org/apache/iotdb/commons/pipe/task/meta/PipeMetaDeSerTest.java
+++ 
b/node-commons/src/test/java/org/apache/iotdb/commons/pipe/PipeMetaDeSerTest.java
@@ -17,11 +17,15 @@
  * under the License.
  */
 
-package org.apache.iotdb.commons.pipe.task.meta;
+package org.apache.iotdb.commons.pipe;
 
 import org.apache.iotdb.common.rpc.thrift.TConsensusGroupId;
 import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
 import org.apache.iotdb.commons.consensus.index.impl.MinimumProgressIndex;
+import org.apache.iotdb.commons.pipe.task.meta.PipeMeta;
+import org.apache.iotdb.commons.pipe.task.meta.PipeRuntimeMeta;
+import org.apache.iotdb.commons.pipe.task.meta.PipeStaticMeta;
+import org.apache.iotdb.commons.pipe.task.meta.PipeTaskMeta;
 
 import org.junit.Assert;
 import org.junit.Test;
diff --git 
a/node-commons/src/main/java/org/apache/iotdb/commons/pipe/utils/PipeDataTypeTransformer.java
 
b/server/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeDataTypeTransformer.java
similarity index 69%
rename from 
node-commons/src/main/java/org/apache/iotdb/commons/pipe/utils/PipeDataTypeTransformer.java
rename to 
server/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeDataTypeTransformer.java
index 7e810f41c28..e233c3a8431 100644
--- 
a/node-commons/src/main/java/org/apache/iotdb/commons/pipe/utils/PipeDataTypeTransformer.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeDataTypeTransformer.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.iotdb.commons.pipe.utils;
+package org.apache.iotdb.db.pipe.event.common.row;
 
 import org.apache.iotdb.pipe.api.type.Type;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
@@ -30,9 +30,6 @@ import java.util.stream.Collectors;
  * org.apache.iotdb.pipe.api.type.Type}
  */
 public class PipeDataTypeTransformer {
-  public static Type transformToPipeDataType(TSDataType tsDataType) {
-    return tsDataType == null ? null : getPipeDataType(tsDataType.getType());
-  }
 
   public static List<Type> transformToPipeDataTypeList(List<TSDataType> 
tsDataTypeList) {
     return tsDataTypeList == null
@@ -42,6 +39,10 @@ public class PipeDataTypeTransformer {
             .collect(Collectors.toList());
   }
 
+  public static Type transformToPipeDataType(TSDataType tsDataType) {
+    return tsDataType == null ? null : getPipeDataType(tsDataType.getType());
+  }
+
   private static Type getPipeDataType(byte type) {
     switch (type) {
       case 0:
@@ -61,34 +62,7 @@ public class PipeDataTypeTransformer {
     }
   }
 
-  public static TSDataType transformToTsDataType(Type type) {
-    return type == null ? null : getTsDataType(type.getType());
-  }
-
-  public static List<TSDataType> transformToTsDataTypeList(List<Type> 
typeList) {
-    return typeList == null
-        ? null
-        : typeList.stream()
-            .map(PipeDataTypeTransformer::transformToTsDataType)
-            .collect(Collectors.toList());
-  }
-
-  private static TSDataType getTsDataType(byte type) {
-    switch (type) {
-      case 0:
-        return TSDataType.BOOLEAN;
-      case 1:
-        return TSDataType.INT32;
-      case 2:
-        return TSDataType.INT64;
-      case 3:
-        return TSDataType.FLOAT;
-      case 4:
-        return TSDataType.DOUBLE;
-      case 5:
-        return TSDataType.TEXT;
-      default:
-        throw new IllegalArgumentException("Invalid input: " + type);
-    }
+  private PipeDataTypeTransformer() {
+    // util class
   }
 }
diff --git 
a/server/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeRow.java 
b/server/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeRow.java
index ac540ce70f4..8b9e10ebf91 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeRow.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeRow.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.pipe.event.common.row;
 
-import org.apache.iotdb.commons.pipe.utils.PipeDataTypeTransformer;
 import org.apache.iotdb.pipe.api.access.Row;
 import org.apache.iotdb.pipe.api.exception.PipeParameterNotValidException;
 import org.apache.iotdb.pipe.api.type.Binary;

Reply via email to