File tree Expand file tree Collapse file tree
main/java/org/apache/iotdb/db/utils
test/java/org/apache/iotdb/db/utils
node-commons/src/main/java/org/apache/iotdb/commons/binaryallocator/arena Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -406,9 +406,10 @@ public static void rewriteAlignedChunkMetadataStatistics(
406406 Statistics <?> statistics = Statistics .getStatsByType (targetDataType );
407407 statistics = getNewStatistics (valueChunkMetadata , targetDataType , statistics );
408408
409- ChunkMetadata newChunkMetadata = ( ChunkMetadata ) valueChunkMetadata ;
409+ ChunkMetadata newChunkMetadata = new ChunkMetadata (( ChunkMetadata ) valueChunkMetadata ) ;
410410 newChunkMetadata .setTsDataType (targetDataType );
411411 newChunkMetadata .setStatistics (statistics );
412+ alignedChunkMetadata .getValueChunkMetadataList ().set (index , newChunkMetadata );
412413 } else {
413414 alignedChunkMetadata .getValueChunkMetadataList ().set (index , null );
414415 }
@@ -421,8 +422,10 @@ public static void rewriteNonAlignedChunkMetadataStatistics(
421422 Statistics <?> statistics = Statistics .getStatsByType (targetDataType );
422423 statistics = getNewStatistics (chunkMetadata , targetDataType , statistics );
423424
425+ chunkMetadata = new ChunkMetadata (chunkMetadata );
424426 chunkMetadata .setTsDataType (targetDataType );
425427 chunkMetadata .setStatistics (statistics );
428+ chunkMetadataList .set (index , chunkMetadata );
426429 } else {
427430 chunkMetadataList .set (index , null );
428431 }
Original file line number Diff line number Diff line change @@ -96,15 +96,15 @@ public void rewriteAlignedChunkMetadataStatistics() {
9696 || tsDataType == TSDataType .OBJECT ) {
9797 continue ;
9898 }
99- List <IChunkMetadata > valueChunkMetadatas =
100- Collections . singletonList (
101- new ChunkMetadata (
102- "s0" ,
103- tsDataType ,
104- TSEncoding .RLE ,
105- CompressionType .LZ4 ,
106- 0 ,
107- Statistics .getStatsByType (tsDataType )));
99+ List <IChunkMetadata > valueChunkMetadatas = new ArrayList <>( 1 );
100+ valueChunkMetadatas . add (
101+ new ChunkMetadata (
102+ "s0" ,
103+ tsDataType ,
104+ TSEncoding .RLE ,
105+ CompressionType .LZ4 ,
106+ 0 ,
107+ Statistics .getStatsByType (tsDataType )));
108108 AlignedChunkMetadata alignedChunkMetadata =
109109 new AlignedChunkMetadata (new ChunkMetadata (), valueChunkMetadatas );
110110 try {
Original file line number Diff line number Diff line change @@ -216,7 +216,12 @@ private void updateSample() {
216216
217217 private long resize () {
218218 average .update ();
219- int needRemain = (int ) Math .ceil (average .average ()) - getActiveSize ();
219+ float averageActiveSize = average .average ();
220+ if (averageActiveSize < 0.0001f ) {
221+ // avoid keeping the last binary forever
222+ averageActiveSize = 0.0f ;
223+ }
224+ int needRemain = (int ) Math .ceil (averageActiveSize ) - getActiveSize ();
220225 return evict (getQueueSize () - needRemain );
221226 }
222227
You can’t perform that action at this time.
0 commit comments