You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hu...@apache.org on 2023/12/04 14:29:39 UTC
(iotdb) 36/42: update
This is an automated email from the ASF dual-hosted git repository.
hui pushed a commit to branch research/encoding-reorder
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit e235845536ae06fd9fbbe54573a8b21179a9e959
Author: xjz17 <67...@users.noreply.github.com>
AuthorDate: Wed Nov 22 16:47:55 2023 +0800
update
---
.../iotdb/tsfile/encoding/REGERDoubleTest.java | 45 ++++++++++-------
.../iotdb/tsfile/encoding/REGERFloatTest.java | 57 ++++++++++------------
2 files changed, 54 insertions(+), 48 deletions(-)
diff --git a/iotdb-core/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/REGERDoubleTest.java b/iotdb-core/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/REGERDoubleTest.java
index 6bf281e7ec8..2c4498f9c75 100644
--- a/iotdb-core/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/REGERDoubleTest.java
+++ b/iotdb-core/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/REGERDoubleTest.java
@@ -3056,8 +3056,8 @@ public class REGERDoubleTest {
int[] dataset_9 = {474, 678};
int[] dataset_10 = {4, 30, 38, 49, 58};
int[] dataset_11 = {5182, 8206};
- int[] dataset_12 = {0};
- int[] dataset_13 = {0};
+ int[] dataset_12 = {652477};
+ int[] dataset_13 = {581388};
dataset_third.add(dataset_0);
dataset_third.add(dataset_1);
@@ -3106,8 +3106,10 @@ public class REGERDoubleTest {
output_path_list.add(output_parent_dir + "/FANYP-Sensors_ratio.csv"); // 12
output_path_list.add(output_parent_dir + "/TRAJET-Transport_ratio.csv"); // 13
- for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
-// for (int file_i = 2; file_i < 3; file_i++) {
+// int[] file_lists = {5,6,8,10};
+// for (int file_i : file_lists) {
+// for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
+ for (int file_i = 12; file_i < 14; file_i++) {
String inputPath = input_path_list.get(file_i);
String Output = output_path_list.get(file_i);
@@ -3129,9 +3131,10 @@ public class REGERDoubleTest {
assert tempList != null;
+ int count_csv =0;
for (File f : tempList) {
-// f = tempList[2];
-
+ System.out.println(count_csv);
+ count_csv ++;
System.out.println(f);
InputStream inputStream = Files.newInputStream(f.toPath());
CsvReader loader = new CsvReader(inputStream, StandardCharsets.UTF_8);
@@ -3261,8 +3264,8 @@ public class REGERDoubleTest {
int[] dataset_9 = {474, 678};
int[] dataset_10 = {4, 30, 38, 49, 58};
int[] dataset_11 = {5182, 8206};
- int[] dataset_12 = {0};
- int[] dataset_13 = {0};
+ int[] dataset_12 = {652477};
+ int[] dataset_13 = {581388};
dataset_third.add(dataset_0);
dataset_third.add(dataset_1);
@@ -3312,10 +3315,10 @@ public class REGERDoubleTest {
output_path_list.add(output_parent_dir + "/FANYP-Sensors_ratio.csv"); // 12
output_path_list.add(output_parent_dir + "/TRAJET-Transport_ratio.csv"); // 13
-// int[] file_lists = {0,2,11};
+// int[] file_lists = {5,6,8,10};
// for (int file_i : file_lists) {
- for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
- // for (int file_i = 6; file_i < input_path_list.size(); file_i++) {
+// for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
+ for (int file_i = 12; file_i < 14; file_i++) {
String inputPath = input_path_list.get(file_i);
String Output = output_path_list.get(file_i);
@@ -3338,7 +3341,10 @@ public class REGERDoubleTest {
assert tempList != null;
+ int count_csv =0;
for (File f : tempList) {
+ System.out.println(count_csv);
+ count_csv ++;
System.out.println(f);
InputStream inputStream = Files.newInputStream(f.toPath());
CsvReader loader = new CsvReader(inputStream, StandardCharsets.UTF_8);
@@ -3387,7 +3393,7 @@ public class REGERDoubleTest {
long decodeTime = 0;
double ratio = 0;
double compressed_size = 0;
- int repeatTime2 = 100;
+ int repeatTime2 = 10;
long s = System.nanoTime();
int length = 0;
for (int repeat = 0; repeat < repeatTime2; repeat++)
@@ -3468,8 +3474,8 @@ public class REGERDoubleTest {
int[] dataset_9 = {474, 678};
int[] dataset_10 = {4, 30, 38, 49, 58};
int[] dataset_11 = {5182, 8206};
- int[] dataset_12 = {0};
- int[] dataset_13 = {0};
+ int[] dataset_12 = {652477};
+ int[] dataset_13 = {581388};
dataset_third.add(dataset_0);
dataset_third.add(dataset_1);
@@ -3520,8 +3526,10 @@ public class REGERDoubleTest {
output_path_list.add(output_parent_dir + "/FANYP-Sensors_ratio.csv"); // 12
output_path_list.add(output_parent_dir + "/TRAJET-Transport_ratio.csv"); // 13
- for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
- // for (int file_i = 0; file_i < 1; file_i++) {
+// int[] file_lists = {5,6,8,10};
+// for (int file_i : file_lists) {
+// for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
+ for (int file_i = 12; file_i < 14; file_i++) {
String inputPath = input_path_list.get(file_i);
String Output = output_path_list.get(file_i);
@@ -3544,7 +3552,10 @@ public class REGERDoubleTest {
assert tempList != null;
+ int count_csv =0;
for (File f : tempList) {
+ System.out.println(count_csv);
+ count_csv ++;
System.out.println(f);
InputStream inputStream = Files.newInputStream(f.toPath());
CsvReader loader = new CsvReader(inputStream, StandardCharsets.UTF_8);
@@ -3579,7 +3590,7 @@ public class REGERDoubleTest {
long decodeTime = 0;
double ratio = 0;
double compressed_size = 0;
- int repeatTime2 = 100;
+ int repeatTime2 = 10;
long s = System.nanoTime();
int length = 0;
for (int repeat = 0; repeat < repeatTime2; repeat++)
diff --git a/iotdb-core/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/REGERFloatTest.java b/iotdb-core/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/REGERFloatTest.java
index ed80b4968dd..59e1a109c24 100644
--- a/iotdb-core/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/REGERFloatTest.java
+++ b/iotdb-core/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/REGERFloatTest.java
@@ -3140,9 +3140,10 @@ public class REGERFloatTest {
output_path_list.add(output_parent_dir + "/FANYP-Sensors_ratio.csv"); // 12
output_path_list.add(output_parent_dir + "/TRAJET-Transport_ratio.csv"); // 13
-
+ int[] file_lists = {5,6,8,10};
+ for (int file_i : file_lists) {
// for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
- for (int file_i = 12; file_i < 14; file_i++) {
+// for (int file_i = 12; file_i < 14; file_i++) {
String inputPath = input_path_list.get(file_i);
String Output = output_path_list.get(file_i);
@@ -3164,54 +3165,40 @@ public class REGERFloatTest {
assert tempList != null;
+ int count_csv =0;
for (File f : tempList) {
-// f = tempList[2];
-
+ System.out.println(count_csv);
+ count_csv ++;
System.out.println(f);
InputStream inputStream = Files.newInputStream(f.toPath());
CsvReader loader = new CsvReader(inputStream, StandardCharsets.UTF_8);
-// ArrayList<ArrayList<Integer>> data = new ArrayList<>();
ArrayList<Long> data = new ArrayList<>();
- // add a column to "data"
loader.readHeaders();
loader.readRecord();
int time0 = Integer.parseInt(loader.getValues()[0]);
int value0 = Integer.parseInt(loader.getValues()[1]);
data.add(combine2Int(0, value0));
-// loader.readRecord();
-// int time1 = Integer.parseInt(loader.getValues()[0]);
-// int value1 = Integer.parseInt(loader.getValues()[1]);
-// System.out.println(time0);
-// System.out.println(time1);
-// System.out.println(value1);
-// data.add(combine2Int(time1-time0, value1));
while (loader.readRecord()) {
-// long time_tmp = Integer.parseInt(loader.getValues()[0])-time0;
-// time_tmp <<=32;
-// time_tmp += Integer.parseInt(loader.getValues()[1]);
+
int time_tmp = Integer.parseInt(loader.getValues()[0]) - time0;
-// System.out.println(time_tmp);
int value_tmp = Integer.parseInt(loader.getValues()[1]);
data.add(combine2Int(time_tmp, value_tmp));
}
-// System.out.println(getTime(data.get(1)));
-// System.out.println((data.get(1)));
-// System.out.println(data);
+
inputStream.close();
ArrayList<Integer> result2 = new ArrayList<>();
splitTimeStamp3(data, result2);
-// System.out.println(data);
long[] data2_arr = new long[data.size()];
-// int min_time = data.get(0).get(0);
+
for (int i = 0; i < data.size(); i++) {
data2_arr[i] = data.get(i);
}
-// System.out.println(data2_arr[0][0]);
+
byte[] encoded_result = new byte[data2_arr.length * 8];
long encodeTime = 0;
long decodeTime = 0;
@@ -3334,10 +3321,10 @@ public class REGERFloatTest {
output_path_list.add(output_parent_dir + "/FANYP-Sensors_ratio.csv"); // 12
output_path_list.add(output_parent_dir + "/TRAJET-Transport_ratio.csv"); // 13
-// int[] file_lists = {0,2,11};
-// for (int file_i : file_lists) {
- for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
-// for (int file_i = 12; file_i < input_path_list.size(); file_i++) {
+ int[] file_lists = {5,6,8,10};
+ for (int file_i : file_lists) {
+// for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
+// for (int file_i = 12; file_i < 14; file_i++) {
String inputPath = input_path_list.get(file_i);
String Output = output_path_list.get(file_i);
@@ -3360,7 +3347,10 @@ public class REGERFloatTest {
assert tempList != null;
+ int count_csv =0;
for (File f : tempList) {
+ System.out.println(count_csv);
+ count_csv ++;
System.out.println(f);
InputStream inputStream = Files.newInputStream(f.toPath());
CsvReader loader = new CsvReader(inputStream, StandardCharsets.UTF_8);
@@ -3395,7 +3385,7 @@ public class REGERFloatTest {
long decodeTime = 0;
double ratio = 0;
double compressed_size = 0;
- int repeatTime2 = 100;
+ int repeatTime2 = 10;
long s = System.nanoTime();
int length = 0;
for (int repeat = 0; repeat < repeatTime2; repeat++)
@@ -3528,8 +3518,10 @@ public class REGERFloatTest {
output_path_list.add(output_parent_dir + "/FANYP-Sensors_ratio.csv"); // 12
output_path_list.add(output_parent_dir + "/TRAJET-Transport_ratio.csv"); // 13
- for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
- // for (int file_i = 0; file_i < 1; file_i++) {
+ int[] file_lists = {5,6,8,10};
+ for (int file_i : file_lists) {
+// for (int file_i = 0; file_i < input_path_list.size(); file_i++) {
+// for (int file_i = 12; file_i < 14; file_i++) {
String inputPath = input_path_list.get(file_i);
String Output = output_path_list.get(file_i);
@@ -3552,7 +3544,10 @@ public class REGERFloatTest {
assert tempList != null;
+ int count_csv =0;
for (File f : tempList) {
+ System.out.println(count_csv);
+ count_csv ++;
System.out.println(f);
InputStream inputStream = Files.newInputStream(f.toPath());
CsvReader loader = new CsvReader(inputStream, StandardCharsets.UTF_8);
@@ -3587,7 +3582,7 @@ public class REGERFloatTest {
long decodeTime = 0;
double ratio = 0;
double compressed_size = 0;
- int repeatTime2 = 100;
+ int repeatTime2 = 10;
long s = System.nanoTime();
int length = 0;
for (int repeat = 0; repeat < repeatTime2; repeat++)