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

jackietien pushed a commit to branch ty/sonar
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/ty/sonar by this push:
     new da33ce51135 server/src/main/java/org/apache/iotdb/db/constant done
da33ce51135 is described below

commit da33ce51135c50167e336f92fb19e9f8b02b1446
Author: JackieTien97 <[email protected]>
AuthorDate: Mon Jun 19 14:13:23 2023 +0800

    server/src/main/java/org/apache/iotdb/db/constant done
---
 .../org/apache/iotdb/db/constant/TestConstant.java | 53 +++-------------------
 1 file changed, 7 insertions(+), 46 deletions(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/constant/TestConstant.java 
b/server/src/main/java/org/apache/iotdb/db/constant/TestConstant.java
index 77c15469208..00dbcf1e1f5 100644
--- a/server/src/main/java/org/apache/iotdb/db/constant/TestConstant.java
+++ b/server/src/main/java/org/apache/iotdb/db/constant/TestConstant.java
@@ -20,8 +20,6 @@
 package org.apache.iotdb.db.constant;
 
 import org.apache.iotdb.tsfile.utils.FilePathUtils;
-import org.apache.iotdb.tsfile.write.record.TSRecord;
-import org.apache.iotdb.tsfile.write.record.datapoint.DataPoint;
 
 import java.io.File;
 
@@ -35,36 +33,7 @@ public class TestConstant {
   public static final String TEST_TSFILE_PATH =
       BASE_OUTPUT_PATH + "testTsFile".concat(File.separator) + 
PARTIAL_PATH_STRING;
 
-  public static final String d0 = "root.vehicle.d0";
-  public static final String s0 = "s0";
-  public static final String s1 = "s1";
-  public static final String s2 = "s2";
-  public static final String s3 = "s3";
-  public static final String s4 = "s4";
-  public static final String s5 = "s5";
-  public static final String d1 = "root.vehicle.d1";
   public static final String TIMESTAMP_STR = "Time";
-  public static boolean testFlag = true;
-  public static String[] stringValue = new String[] {"A", "B", "C", "D", "E"};
-  public static String[] booleanValue = new String[] {"true", "false"};
-  public static final String TIMESEIRES_STR = "timeseries";
-  public static final String VALUE_STR = "value";
-  public static final String DATA_TYPE_STR = "dataType";
-
-  public static String[] createSql =
-      new String[] {
-        "CREATE DATABASE root.vehicle",
-        "CREATE TIMESERIES root.vehicle.d0.s0 WITH DATATYPE=INT32, 
ENCODING=RLE",
-        "CREATE TIMESERIES root.vehicle.d0.s1 WITH DATATYPE=INT64, 
ENCODING=RLE",
-        "CREATE TIMESERIES root.vehicle.d0.s2 WITH DATATYPE=FLOAT, 
ENCODING=RLE",
-        "CREATE TIMESERIES root.vehicle.d0.s3 WITH DATATYPE=TEXT, 
ENCODING=PLAIN",
-        "CREATE TIMESERIES root.vehicle.d0.s4 WITH DATATYPE=BOOLEAN, 
ENCODING=PLAIN",
-        "CREATE TIMESERIES root.vehicle.d0.s5 WITH DATATYPE=DOUBLE, 
ENCODING=RLE",
-        "CREATE TIMESERIES root.vehicle.d1.s0 WITH DATATYPE=INT32, 
ENCODING=RLE",
-        "CREATE TIMESERIES root.vehicle.d1.s1 WITH DATATYPE=INT64, 
ENCODING=RLE",
-      };
-
-  public static String insertTemplate = "insert into %s(timestamp%s) 
values(%d%s)";
 
   public static String firstValue(String path) {
     return String.format("first_value(%s)", path);
@@ -106,24 +75,16 @@ public class TestConstant {
     return String.format("min_value(%s)", path);
   }
 
-  public static String recordToInsert(TSRecord record) {
-    StringBuilder measurements = new StringBuilder();
-    StringBuilder values = new StringBuilder();
-    for (DataPoint dataPoint : record.dataPointList) {
-      measurements.append(",").append(dataPoint.getMeasurementId());
-      values.append(",").append(dataPoint.getValue());
-    }
-    return String.format(insertTemplate, record.deviceId, measurements, 
record.time, values);
-  }
+  private TestConstant() {}
 
   public static String getTestTsFilePath(
       String logicalStorageGroupName,
-      long VirtualStorageGroupId,
-      long TimePartitionId,
+      long virtualStorageGroupId,
+      long timePartitionId,
       long tsFileVersion) {
     String filePath =
         String.format(
-            TEST_TSFILE_PATH, logicalStorageGroupName, VirtualStorageGroupId, 
TimePartitionId);
+            TEST_TSFILE_PATH, logicalStorageGroupName, virtualStorageGroupId, 
timePartitionId);
     String fileName =
         System.currentTimeMillis()
             + FilePathUtils.FILE_NAME_SEPARATOR
@@ -133,11 +94,11 @@ public class TestConstant {
   }
 
   public static String getTestTsFileDir(
-      String logicalStorageGroupName, long VirtualStorageGroupId, long 
TimePartitionId) {
+      String logicalStorageGroupName, long virtualStorageGroupId, long 
timePartitionId) {
     return String.format(
         TestConstant.TEST_TSFILE_PATH,
         logicalStorageGroupName,
-        VirtualStorageGroupId,
-        TimePartitionId);
+        virtualStorageGroupId,
+        timePartitionId);
   }
 }

Reply via email to