This is an automated email from the ASF dual-hosted git repository.
leirui pushed a commit to branch research/M4-visualization
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/research/M4-visualization by
this push:
new 56bde8719e add
56bde8719e is described below
commit 56bde8719ebbf7d7c6ceb7b09bb022028fbce7c9
Author: Lei Rui <[email protected]>
AuthorDate: Wed Oct 5 14:18:22 2022 +0800
add
---
.../resources/conf/iotdb-engine.properties | 12 +++----
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 20 ------------
.../org/apache/iotdb/db/conf/IoTDBDescriptor.java | 9 -----
.../iotdb/session/MyRealDataWriteQueryTest.java | 4 +--
.../iotdb/tsfile/common/conf/TSFileConfig.java | 24 ++++++++++++--
.../iotdb/tsfile/common/conf/TSFileDescriptor.java | 19 +++++++----
.../encoding/decoder/DeltaBinaryDecoder.java | 38 +++++++++++++++-------
7 files changed, 69 insertions(+), 57 deletions(-)
diff --git a/server/src/assembly/resources/conf/iotdb-engine.properties
b/server/src/assembly/resources/conf/iotdb-engine.properties
index c5331cf95f..24ee8f7c9c 100644
--- a/server/src/assembly/resources/conf/iotdb-engine.properties
+++ b/server/src/assembly/resources/conf/iotdb-engine.properties
@@ -22,12 +22,6 @@
####################
enable_CPV=false
-# regularity-aware fast TS_2DIFF decoding on the time column
-enable_regularity_time_decode=false
-
-# use timestampPrecision as unit
-regular_time_interval=1
-
####################
### Web Page Configuration
@@ -613,6 +607,12 @@ enable_unseq_compaction=false
### Configurations for tsfile-format
####################
+# regularity-aware fast TS_2DIFF decoding on the time column
+enable_regularity_time_decode=false
+
+# use timestampPrecision as unit
+regular_time_interval=1
+
# group_size_in_byte=134217728
# The memory size for each series writer to pack page, default value is 64KB
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index c3723085de..e275639edd 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -579,10 +579,6 @@ public class IoTDBConfig {
private boolean enableCPV = false;
- private boolean enableRegularityTimeDecode = false;
-
- private long regularTimeInterval = 1L;
-
/**
* The display of stat performance interval in ms.
*/
@@ -1629,14 +1625,6 @@ public class IoTDBConfig {
return enableCPV;
}
- public boolean isEnableRegularityTimeDecode() {
- return enableRegularityTimeDecode;
- }
-
- public long getRegularTimeInterval() {
- return regularTimeInterval;
- }
-
public void setEnablePerformanceTracing(boolean enablePerformanceTracing) {
this.enablePerformanceTracing = enablePerformanceTracing;
}
@@ -1645,14 +1633,6 @@ public class IoTDBConfig {
this.enableCPV = enableCPV;
}
- public void setEnableRegularityTimeDecode(boolean
enableRegularityTimeDecode) {
- this.enableRegularityTimeDecode = enableRegularityTimeDecode;
- }
-
- public void setRegularTimeInterval(long regularTimeInterval) {
- this.regularTimeInterval = regularTimeInterval;
- }
-
public long getPerformanceStatDisplayInterval() {
return performanceStatDisplayInterval;
}
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
index e36613a1fa..9f7bc94f94 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
@@ -539,15 +539,6 @@ public class IoTDBDescriptor {
Boolean.parseBoolean(
properties.getProperty("enable_CPV",
Boolean.toString(conf.isEnableCPV())).trim()));
- conf.setEnableRegularityTimeDecode(
- Boolean.parseBoolean(
- properties.getProperty("enable_regularity_time_decode",
-
Boolean.toString(conf.isEnableRegularityTimeDecode())).trim()));
-
- conf.setRegularTimeInterval(Long.parseLong(properties
- .getProperty("regular_time_interval",
Long.toString(conf.getRegularTimeInterval()))
- .trim()));
-
conf.setPerformanceStatDisplayInterval(
Long.parseLong(
properties
diff --git
a/session/src/test/java/org/apache/iotdb/session/MyRealDataWriteQueryTest.java
b/session/src/test/java/org/apache/iotdb/session/MyRealDataWriteQueryTest.java
index 0e97cb545a..56de554440 100644
---
a/session/src/test/java/org/apache/iotdb/session/MyRealDataWriteQueryTest.java
+++
b/session/src/test/java/org/apache/iotdb/session/MyRealDataWriteQueryTest.java
@@ -71,11 +71,11 @@ public class MyRealDataWriteQueryTest {
config.setSeqTsFileSize(1073741824);
config.setCompactionStrategy(CompactionStrategy.NO_COMPACTION);
config.setEnableUnseqCompaction(false);
- config.setEnableRegularityTimeDecode(true);
- config.setRegularTimeInterval(511996);
config.setEnablePerformanceStat(false);
TSFileDescriptor.getInstance().getConfig().setPageSizeInByte(1073741824);
+
TSFileDescriptor.getInstance().getConfig().setEnableRegularityTimeDecode(true);
+ TSFileDescriptor.getInstance().getConfig().setRegularTimeInterval(511996);
EnvironmentUtils.envSetUp(); // start after configuration settings
Class.forName(Config.JDBC_DRIVER_NAME);
diff --git
a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
index 08db1d10cc..a435c7f4bb 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
@@ -18,15 +18,17 @@
*/
package org.apache.iotdb.tsfile.common.conf;
-import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
-import org.apache.iotdb.tsfile.fileSystem.FSType;
-
import java.io.Serializable;
import java.nio.charset.Charset;
+import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
+import org.apache.iotdb.tsfile.fileSystem.FSType;
/** TSFileConfig is a configure class. Every variables is public and has
default value. */
public class TSFileConfig implements Serializable {
+ private boolean enableRegularityTimeDecode = false;
+ private long regularTimeInterval = 1L;
+
/** encoding configuration */
public static final int RLE_MIN_REPEATED_NUM = 8;
@@ -147,6 +149,22 @@ public class TSFileConfig implements Serializable {
public TSFileConfig() {}
+ public void setEnableRegularityTimeDecode(boolean
enableRegularityTimeDecode) {
+ this.enableRegularityTimeDecode = enableRegularityTimeDecode;
+ }
+
+ public void setRegularTimeInterval(long regularTimeInterval) {
+ this.regularTimeInterval = regularTimeInterval;
+ }
+
+ public boolean isEnableRegularityTimeDecode() {
+ return enableRegularityTimeDecode;
+ }
+
+ public long getRegularTimeInterval() {
+ return regularTimeInterval;
+ }
+
public int getGroupSizeInByte() {
return groupSizeInByte;
}
diff --git
a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileDescriptor.java
b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileDescriptor.java
index d0b6ff49fd..b97bd9a9d7 100644
---
a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileDescriptor.java
+++
b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileDescriptor.java
@@ -19,12 +19,6 @@
package org.apache.iotdb.tsfile.common.conf;
-import org.apache.iotdb.tsfile.common.constant.TsFileConstant;
-import org.apache.iotdb.tsfile.utils.Loader;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -33,6 +27,10 @@ import java.io.InputStream;
import java.net.URL;
import java.util.Properties;
import java.util.Set;
+import org.apache.iotdb.tsfile.common.constant.TsFileConstant;
+import org.apache.iotdb.tsfile.utils.Loader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** TSFileDescriptor is used to load TSFileConfig and provide configure
information. */
public class TSFileDescriptor {
@@ -105,6 +103,15 @@ public class TSFileDescriptor {
Properties properties = new Properties();
try {
properties.load(inputStream);
+ conf.setEnableRegularityTimeDecode(
+ Boolean.parseBoolean(
+ properties.getProperty("enable_regularity_time_decode",
+
Boolean.toString(conf.isEnableRegularityTimeDecode())).trim()));
+
+ conf.setRegularTimeInterval(Long.parseLong(properties
+ .getProperty("regular_time_interval",
Long.toString(conf.getRegularTimeInterval()))
+ .trim()));
+
conf.setGroupSizeInByte(
Integer.parseInt(
properties.getProperty(
diff --git
a/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/DeltaBinaryDecoder.java
b/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/DeltaBinaryDecoder.java
index 7f50cd4bb6..b6196916f7 100644
---
a/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/DeltaBinaryDecoder.java
+++
b/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/DeltaBinaryDecoder.java
@@ -19,18 +19,17 @@
package org.apache.iotdb.tsfile.encoding.decoder;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
import org.apache.iotdb.tsfile.encoding.encoder.DeltaBinaryEncoder;
import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
import org.apache.iotdb.tsfile.utils.BytesUtils;
import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
/**
* This class is a decoder for decoding the byte array that encoded by {@code
- * DeltaBinaryEncoder}.DeltaBinaryDecoder just supports integer and long
values.<br>
- * .
+ * DeltaBinaryEncoder}.DeltaBinaryDecoder just supports integer and long
values.<br> .
*
* @see DeltaBinaryEncoder
*/
@@ -39,16 +38,24 @@ public abstract class DeltaBinaryDecoder extends Decoder {
protected long count = 0;
protected byte[] deltaBuf;
- /** the first value in one pack. */
+ /**
+ * the first value in one pack.
+ */
protected int readIntTotalCount = 0;
protected int nextReadIndex = 0;
- /** max bit length of all value in a pack. */
+ /**
+ * max bit length of all value in a pack.
+ */
protected int packWidth;
- /** data number in this pack. */
+ /**
+ * data number in this pack.
+ */
protected int packNum;
- /** how many bytes data takes after encoding. */
+ /**
+ * how many bytes data takes after encoding.
+ */
protected int encodingLength;
public DeltaBinaryDecoder() {
@@ -81,7 +88,9 @@ public abstract class DeltaBinaryDecoder extends Decoder {
private int firstValue;
private int[] data;
private int previous;
- /** minimum value for all difference. */
+ /**
+ * minimum value for all difference.
+ */
private int minDeltaBase;
public IntDeltaDecoder() {
@@ -165,11 +174,18 @@ public abstract class DeltaBinaryDecoder extends Decoder {
private long firstValue;
private long[] data;
private long previous;
- /** minimum value for all difference. */
+ /**
+ * minimum value for all difference.
+ */
private long minDeltaBase;
+ private long regularTimeInterval;
+ private byte[] decodedRegularTimeInterval; // it depends on minDeltaBase
and bitWidth of each pack
+
public LongDeltaDecoder() {
super();
+ this.regularTimeInterval = TSFileDescriptor.getInstance().getConfig()
+ .getRegularTimeInterval();
}
/**