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 2021/02/15 03:27:17 UTC
[iotdb] branch spotless updated (8e20570 -> 942de25)
This is an automated email from the ASF dual-hosted git repository.
jincheng pushed a change to branch spotless
in repository https://gitbox.apache.org/repos/asf/iotdb.git.
discard 8e20570 Apply spotless and Resolve your conflict
discard 2c0529a IOTDB-1152 optimize regular data size in traversing
new 91fbde0 IOTDB-1152 optimize regular data size in traversing
new 942de25 Apply spotless and Resolve your conflict
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (8e20570)
\
N -- N -- N refs/heads/spotless (942de25)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../level/LevelCompactionTsFileManagement.java | 55 +++++++++++++++++++
.../engine/compaction/utils/CompactionUtils.java | 64 +++++++++++++++++++++-
.../engine/storagegroup/StorageGroupProcessor.java | 10 ++++
.../org/apache/iotdb/db/service/MQTTService.java | 9 +++
.../db/engine/compaction/CompactionChunkTest.java | 10 ++++
.../compaction/LevelCompactionRecoverTest.java | 25 +++++++++
.../iotdb/tsfile/common/conf/TSFileDescriptor.java | 4 ++
7 files changed, 175 insertions(+), 2 deletions(-)
[iotdb] 02/02: Apply spotless and Resolve your conflict
Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jincheng pushed a commit to branch spotless
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 942de25a8bae7115709807534482e03d6104bddb
Author: sunjincheng121 <su...@gmail.com>
AuthorDate: Mon Feb 15 11:23:32 2021 +0800
Apply spotless and Resolve your conflict
---
.../level/LevelCompactionTsFileManagement.java | 18 +++++++++
.../engine/compaction/utils/CompactionUtils.java | 44 ++++++++++++++++++++++
.../engine/storagegroup/StorageGroupProcessor.java | 8 ++++
.../org/apache/iotdb/db/service/MQTTService.java | 7 ++++
.../db/engine/compaction/CompactionChunkTest.java | 8 ++++
.../compaction/LevelCompactionRecoverTest.java | 20 ++++++++++
.../iotdb/tsfile/common/conf/TSFileDescriptor.java | 4 ++
.../regular/RegularDataEncoderIntegerTest.java | 2 +-
.../regular/RegularDataEncoderLongTest.java | 2 +-
9 files changed, 111 insertions(+), 2 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/level/LevelCompactionTsFileManagement.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/level/LevelCompactionTsFileManagement.java
index cfb2064..62b2e69 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/level/LevelCompactionTsFileManagement.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/level/LevelCompactionTsFileManagement.java
@@ -409,15 +409,22 @@ public class LevelCompactionTsFileManagement extends TsFileManagement {
writer.close();
CompactionLogger compactionLogger =
new CompactionLogger(storageGroupDir, storageGroupName);
+<<<<<<< HEAD
List<Modification> modifications = new ArrayList<>();
+=======
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
CompactionUtils.merge(
targetTsFileResource,
getTsFileList(isSeq),
storageGroupName,
compactionLogger,
deviceSet,
+<<<<<<< HEAD
isSeq,
modifications);
+=======
+ isSeq);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
compactionLogger.close();
} else {
writer.close();
@@ -443,15 +450,22 @@ public class LevelCompactionTsFileManagement extends TsFileManagement {
writer.close();
CompactionLogger compactionLogger =
new CompactionLogger(storageGroupDir, storageGroupName);
+<<<<<<< HEAD
List<Modification> modifications = new ArrayList<>();
+=======
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
CompactionUtils.merge(
targetResource,
sourceTsFileResources,
storageGroupName,
compactionLogger,
deviceSet,
+<<<<<<< HEAD
isSeq,
modifications);
+=======
+ isSeq);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
// complete compaction and delete source file
writeLock();
try {
@@ -627,8 +641,12 @@ public class LevelCompactionTsFileManagement extends TsFileManagement {
storageGroupName,
compactionLogger,
new HashSet<>(),
+<<<<<<< HEAD
sequence,
modifications);
+=======
+ sequence);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
logger.info(
"{} [Compaction] merged level-{}'s {} TsFiles to next level, and start to delete old files",
storageGroupName,
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
index 6aec3fb..4b32be3 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
@@ -71,8 +71,12 @@ public class CompactionUtils {
private static Pair<ChunkMetadata, Chunk> readByAppendMerge(
Map<TsFileSequenceReader, List<ChunkMetadata>> readerChunkMetadataMap,
Map<String, List<Modification>> modificationCache,
+<<<<<<< HEAD
PartialPath seriesPath,
List<Modification> modifications)
+=======
+ PartialPath seriesPath)
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
throws IOException {
ChunkMetadata newChunkMetadata = null;
Chunk newChunk = null;
@@ -101,8 +105,12 @@ public class CompactionUtils {
long maxVersion,
Map<Long, TimeValuePair> timeValuePairMap,
Map<String, List<Modification>> modificationCache,
+<<<<<<< HEAD
PartialPath seriesPath,
List<Modification> modifications)
+=======
+ PartialPath seriesPath)
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
throws IOException {
for (Entry<TsFileSequenceReader, List<ChunkMetadata>> entry :
readerChunkMetadataMap.entrySet()) {
@@ -132,6 +140,7 @@ public class CompactionUtils {
Entry<String, Map<TsFileSequenceReader, List<ChunkMetadata>>> entry,
TsFileResource targetResource,
RestorableTsFileIOWriter writer,
+<<<<<<< HEAD
Map<String, List<Modification>> modificationCache,
List<Modification> modifications)
throws IOException, IllegalPathException {
@@ -141,6 +150,13 @@ public class CompactionUtils {
modificationCache,
new PartialPath(device, entry.getKey()),
modifications);
+=======
+ Map<String, List<Modification>> modificationCache)
+ throws IOException, IllegalPathException {
+ Pair<ChunkMetadata, Chunk> chunkPair =
+ readByAppendMerge(
+ entry.getValue(), modificationCache, new PartialPath(device, entry.getKey()));
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
ChunkMetadata newChunkMetadata = chunkPair.left;
Chunk newChunk = chunkPair.right;
if (newChunkMetadata != null && newChunk != null) {
@@ -163,8 +179,12 @@ public class CompactionUtils {
Entry<String, Map<TsFileSequenceReader, List<ChunkMetadata>>> entry,
TsFileResource targetResource,
RestorableTsFileIOWriter writer,
+<<<<<<< HEAD
Map<String, List<Modification>> modificationCache,
List<Modification> modifications)
+=======
+ Map<String, List<Modification>> modificationCache)
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
throws IOException, IllegalPathException {
Map<Long, TimeValuePair> timeValuePairMap = new TreeMap<>();
Map<TsFileSequenceReader, List<ChunkMetadata>> readerChunkMetadataMap = entry.getValue();
@@ -174,8 +194,12 @@ public class CompactionUtils {
maxVersion,
timeValuePairMap,
modificationCache,
+<<<<<<< HEAD
new PartialPath(device, entry.getKey()),
modifications);
+=======
+ new PartialPath(device, entry.getKey()));
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
boolean isChunkMetadataEmpty = true;
for (List<ChunkMetadata> chunkMetadataList : readerChunkMetadataMap.values()) {
if (!chunkMetadataList.isEmpty()) {
@@ -238,8 +262,12 @@ public class CompactionUtils {
String storageGroup,
CompactionLogger compactionLogger,
Set<String> devices,
+<<<<<<< HEAD
boolean sequence,
List<Modification> modifications)
+=======
+ boolean sequence)
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
throws IOException, IllegalPathException {
RestorableTsFileIOWriter writer = new RestorableTsFileIOWriter(targetResource.getTsFile());
Map<String, TsFileSequenceReader> tsFileSequenceReaderMap = new HashMap<>();
@@ -297,8 +325,12 @@ public class CompactionUtils {
entry,
targetResource,
writer,
+<<<<<<< HEAD
modificationCache,
modifications);
+=======
+ modificationCache);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
}
writer.endChunkGroup();
} else {
@@ -326,8 +358,12 @@ public class CompactionUtils {
entry,
targetResource,
writer,
+<<<<<<< HEAD
modificationCache,
modifications);
+=======
+ modificationCache);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
} else {
logger.debug("{} [Compaction] page too small, use deserialize merge", storageGroup);
// we have to deserialize chunks to merge pages
@@ -339,8 +375,12 @@ public class CompactionUtils {
entry,
targetResource,
writer,
+<<<<<<< HEAD
modificationCache,
modifications);
+=======
+ modificationCache);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
}
}
writer.endChunkGroup();
@@ -390,8 +430,12 @@ public class CompactionUtils {
TsFileSequenceReader reader,
List<ChunkMetadata> chunkMetadataList,
Map<String, List<Modification>> modificationCache,
+<<<<<<< HEAD
PartialPath seriesPath,
List<Modification> usedModifications) {
+=======
+ PartialPath seriesPath) {
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
List<Modification> modifications =
modificationCache.computeIfAbsent(
reader.getFileName(),
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
index 816f0f1..966191f 100755
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
@@ -517,8 +517,12 @@ public class StorageGroupProcessor {
logger.error(
"{} - {} compaction submit task failed",
logicalStorageGroupName,
+<<<<<<< HEAD
virtualStorageGroupId,
e);
+=======
+ virtualStorageGroupId);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
}
} else {
logger.error(
@@ -1955,8 +1959,12 @@ public class StorageGroupProcessor {
this.closeCompactionMergeCallBack();
logger.error(
"{} compaction submit task failed",
+<<<<<<< HEAD
logicalStorageGroupName + "-" + virtualStorageGroupId,
e);
+=======
+ logicalStorageGroupName + "-" + virtualStorageGroupId);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
}
} else {
logger.info(
diff --git a/server/src/main/java/org/apache/iotdb/db/service/MQTTService.java b/server/src/main/java/org/apache/iotdb/db/service/MQTTService.java
index 3a80919..a4b56e5 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/MQTTService.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/MQTTService.java
@@ -40,8 +40,11 @@ public class MQTTService implements IService {
private static final Logger LOG = LoggerFactory.getLogger(MQTTService.class);
private Server server = new Server();
+<<<<<<< HEAD
private MQTTService() {}
+=======
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
@Override
public void start() throws StartupException {
startup();
@@ -101,7 +104,11 @@ public class MQTTService implements IService {
return ServiceType.MQTT_SERVICE;
}
+<<<<<<< HEAD
public static MQTTService getInstance() {
+=======
+ public static final MQTTService getInstance() {
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
return MQTTServiceHolder.INSTANCE;
}
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/CompactionChunkTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/CompactionChunkTest.java
index 0f21455..8158104 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/CompactionChunkTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/CompactionChunkTest.java
@@ -123,8 +123,12 @@ public class CompactionChunkTest extends LevelCompactionTest {
entry,
targetTsfileResource,
writer,
+<<<<<<< HEAD
new HashMap<>(),
new ArrayList<>());
+=======
+ new HashMap<>());
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
}
reader.close();
}
@@ -207,8 +211,12 @@ public class CompactionChunkTest extends LevelCompactionTest {
entry,
targetTsfileResource,
writer,
+<<<<<<< HEAD
new HashMap<>(),
new ArrayList<>());
+=======
+ new HashMap<>());
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
}
reader.close();
}
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/LevelCompactionRecoverTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/LevelCompactionRecoverTest.java
index fe48f24..d4b9b28 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/LevelCompactionRecoverTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/LevelCompactionRecoverTest.java
@@ -132,8 +132,12 @@ public class LevelCompactionRecoverTest extends LevelCompactionTest {
COMPACTION_TEST_SG,
compactionLogger,
new HashSet<>(),
+<<<<<<< HEAD
true,
new ArrayList<>());
+=======
+ true);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
compactionLogger.close();
levelCompactionTsFileManagement.addRecover(targetTsFileResource, true);
levelCompactionTsFileManagement.recover();
@@ -221,8 +225,12 @@ public class LevelCompactionRecoverTest extends LevelCompactionTest {
COMPACTION_TEST_SG,
compactionLogger,
new HashSet<>(),
+<<<<<<< HEAD
true,
new ArrayList<>());
+=======
+ true);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
compactionLogger.close();
BufferedReader logReader =
@@ -334,8 +342,12 @@ public class LevelCompactionRecoverTest extends LevelCompactionTest {
COMPACTION_TEST_SG,
compactionLogger,
new HashSet<>(),
+<<<<<<< HEAD
true,
new ArrayList<>());
+=======
+ true);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
compactionLogger.close();
BufferedReader logReader =
@@ -453,8 +465,12 @@ public class LevelCompactionRecoverTest extends LevelCompactionTest {
COMPACTION_TEST_SG,
compactionLogger,
new HashSet<>(),
+<<<<<<< HEAD
false,
new ArrayList<>());
+=======
+ false);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
compactionLogger.close();
levelCompactionTsFileManagement.addRecover(targetTsFileResource, false);
levelCompactionTsFileManagement.recover();
@@ -655,8 +671,12 @@ public class LevelCompactionRecoverTest extends LevelCompactionTest {
COMPACTION_TEST_SG,
compactionLogger,
new HashSet<>(),
+<<<<<<< HEAD
true,
new ArrayList<>());
+=======
+ true);
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
levelCompactionTsFileManagement.addRecover(targetTsFileResource, true);
compactionLogger.close();
levelCompactionTsFileManagement.recover();
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 4654e98..b9d5e74 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
@@ -42,7 +42,11 @@ public class TSFileDescriptor {
loadProps();
}
+<<<<<<< HEAD
public static TSFileDescriptor getInstance() {
+=======
+ public static final TSFileDescriptor getInstance() {
+>>>>>>> c0830b2cb (Apply spotless and Resolve your conflict)
return TsfileDescriptorHolder.INSTANCE;
}
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
index 8baf651..8b091ab 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
@@ -104,7 +104,7 @@ public class RegularDataEncoderIntegerTest {
byte[] page = out.toByteArray();
buffer = ByteBuffer.wrap(page);
int i = 0;
- while(regularDataDecoder.hasNext(buffer)) {
+ while (regularDataDecoder.hasNext(buffer)) {
assertEquals(originalData[i++], regularDataDecoder.readInt(buffer));
}
}
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
index 34efa48..5e7748b 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
@@ -145,7 +145,7 @@ public class RegularDataEncoderLongTest {
byte[] page = out.toByteArray();
buffer = ByteBuffer.wrap(page);
int i = 0;
- while(regularDataDecoder.hasNext(buffer)) {
+ while (regularDataDecoder.hasNext(buffer)) {
assertEquals(originalData[i++], regularDataDecoder.readLong(buffer));
}
}
[iotdb] 01/02: IOTDB-1152 optimize regular data size in traversing
Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jincheng pushed a commit to branch spotless
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 91fbde0fefc8cf5c4b06ae10fb37d81ec1ddf7ae
Author: wangchao316 <57...@qq.com>
AuthorDate: Tue Feb 9 22:04:18 2021 +0800
IOTDB-1152 optimize regular data size in traversing
---
.../iotdb/tsfile/encoding/encoder/RegularDataEncoder.java | 8 ++++++--
.../decoder/regular/RegularDataEncoderIntegerTest.java | 13 +++++++++++++
.../decoder/regular/RegularDataEncoderLongTest.java | 13 +++++++++++++
3 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/RegularDataEncoder.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/RegularDataEncoder.java
index 492e8eb..19502a8 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/RegularDataEncoder.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/RegularDataEncoder.java
@@ -49,6 +49,8 @@ public abstract class RegularDataEncoder extends Encoder {
protected int writeIndex = -1;
+ protected int dataTotal;
+
/**
* constructor of RegularDataEncoder.
*
@@ -183,6 +185,7 @@ public abstract class RegularDataEncoder extends Encoder {
}
firstValue = data[0];
if (isMissingPoint) {
+ dataTotal = writeIndex;
newBlockSize = ((data[writeIndex - 1] - data[0]) / minDeltaBase) + 1;
writeIndex = newBlockSize;
}
@@ -218,7 +221,7 @@ public abstract class RegularDataEncoder extends Encoder {
bitmap = new BitSet(newBlockSize);
bitmap.flip(0, newBlockSize);
int offset = 0;
- for (int i = 1; i < missingPointData.length; i++) {
+ for (int i = 1; i < dataTotal; i++) {
int delta = missingPointData[i] - missingPointData[i - 1];
if (delta != minDeltaBase) {
int missingPointNum = (int) (delta / minDeltaBase) - 1;
@@ -309,6 +312,7 @@ public abstract class RegularDataEncoder extends Encoder {
}
firstValue = data[0];
if (isMissingPoint) {
+ dataTotal = writeIndex;
newBlockSize = (int) (((data[writeIndex - 1] - data[0]) / minDeltaBase) + 1);
writeIndex = newBlockSize;
}
@@ -344,7 +348,7 @@ public abstract class RegularDataEncoder extends Encoder {
bitmap = new BitSet(newBlockSize);
bitmap.flip(0, newBlockSize);
int offset = 0;
- for (int i = 1; i < missingPointData.length; i++) {
+ for (int i = 1; i < dataTotal; i++) {
long delta = missingPointData[i] - missingPointData[i - 1];
if (delta != minDeltaBase) {
int missingPointNum = (int) (delta / minDeltaBase) - 1;
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
index be08915..8baf651 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java
@@ -96,6 +96,19 @@ public class RegularDataEncoderIntegerTest {
shouldReadAndWrite(data, ROW_NUM);
}
+ @Test
+ public void testMissingPointsDataSize() throws IOException {
+ int[] originalData = new int[] {1000, 1100, 1200, 1300, 1500, 2000};
+ out = new ByteArrayOutputStream();
+ writeData(originalData, 6);
+ byte[] page = out.toByteArray();
+ buffer = ByteBuffer.wrap(page);
+ int i = 0;
+ while(regularDataDecoder.hasNext(buffer)) {
+ assertEquals(originalData[i++], regularDataDecoder.readInt(buffer));
+ }
+ }
+
private int[] getMissingPointData(int dataSize, int missingPointInterval) {
ROW_NUM = dataSize;
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
index aaec9a3..34efa48 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java
@@ -137,6 +137,19 @@ public class RegularDataEncoderLongTest {
shouldReadAndWrite(data, ROW_NUM);
}
+ @Test
+ public void testMissingPointsDataSize() throws IOException {
+ long[] originalData = new long[] {1000, 1100, 1200, 1300, 1500, 2000};
+ out = new ByteArrayOutputStream();
+ writeData(originalData, 6);
+ byte[] page = out.toByteArray();
+ buffer = ByteBuffer.wrap(page);
+ int i = 0;
+ while(regularDataDecoder.hasNext(buffer)) {
+ assertEquals(originalData[i++], regularDataDecoder.readLong(buffer));
+ }
+ }
+
private long[] getMissingPointData(List<String> originalData, int missingPointInterval) {
List<String> dates = originalData;