You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2019/06/27 09:24:48 UTC
[incubator-iotdb] 01/03: add integrated constructor in TVList
This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch feature_async_close_tsfile
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit 2ca528d5ab63ab6d343e617339b66f42234e67b3
Author: 江天 <jt...@163.com>
AuthorDate: Thu Jun 27 17:16:45 2019 +0800
add integrated constructor in TVList
---
.../iotdb/db/utils/datastructure/TVList.java | 26 ++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java
index 6192058..4dc7ed0 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.db.utils.datastructure;
import java.util.ArrayList;
import java.util.List;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.apache.iotdb.tsfile.utils.Binary;
public abstract class TVList {
@@ -34,6 +35,8 @@ public abstract class TVList {
protected long[] sortedTimestamps;
protected boolean sorted = false;
+ private long timeOffset = -1;
+
public TVList() {
timestamps = new ArrayList<>();
size = 0;
@@ -112,6 +115,8 @@ public abstract class TVList {
protected abstract void reverseRange(int lo, int hi);
+ protected abstract TVList clone();
+
protected long[] cloneTime(long[] array) {
long[] cloneArray = new long[array.length];
System.arraycopy(array, 0, cloneArray, 0, array.length);
@@ -150,4 +155,25 @@ public abstract class TVList {
return runHi - lo;
}
+
+ public static TVList newList(TSDataType dataType) {
+ switch (dataType) {
+ case TEXT:
+ case FLOAT:
+ case INT32:
+ case INT64:
+ return new LongTVList();
+ case DOUBLE:
+ case BOOLEAN:
+ }
+ return null;
+ }
+
+ public long getTimeOffset() {
+ return timeOffset;
+ }
+
+ public void setTimeOffset(long timeOffset) {
+ this.timeOffset = timeOffset;
+ }
}