字节数(bytes)

原字节

(V2)

含义

(Meaning)

改动

(V3 difference)

MAGIC_STRING65473 4669 6c65TsFile
VERSION_NUMBER63030 3030 3032version: 000002version:  000003





Chunk Header

101chunk header markerMove to Chunk Header,rename to chunk type,05 means there is only one Page in a chunk without statistics
400 0000 03string长度为3int -> varInt
373 2e33s.3
40000 0053Size of Chunk is  83 bytesint -> varInt
20003Datatype is  floatshort -> byte
40000 0001Number of pages in chunkremove this field
20001Compression is Snappyshort 改成 byte
20006Encoding is GORILLAshort 改成 byte


Page Header

40000 0020Uncompressed size of page data
40000 001bCompressed size of page dataint -> varInt





Page Statistics

80000 0000 0000 0001countlong -> varInt
80000 0000 0000 0001start_time
80000 0000 0000 0001end_time
44000 0000min_value(bool, text do not has this field)
44000 0000max_value(bool, text do not has this field)
44000 0000first_value
44000 0000last_value
84000 0000 0000 0000sum(bool, text do not has this field)bool值需要支持sum,int、bool改成long类型
Page Data272004 1800 0d01 047f
ff09 0138 0000 0000
0000 0001 0000 0040
c447 f8


27 bytes of data

数据里的int类型,以及string前面的




Chunk Group Footer

100markermove to chunk group header
40000 0010size of deviceIdint → varInt
16726f 6f74 2e74 7572 6269 6e65 312e 6431deviceId
80000 0000 0000 0069chunk group data sizeremove
40000 0001chunk numberremove


MemTable Version

103MemTable version markerremove
800 0000 0000 0000 65memtable version is 101remove
Metadata Marker102the following is metadata








ChunkMetadata(N个)













40000 0003sensor名长度remove
4732e 33s.1remove
800 0000 0000 0000 0c该chunk的offset在12
20003data type is  floatremove





Chunk Statistics

80000 0000 0000 0001chunk中有1个点long -> varInt
80000 0000 0000 0001start_time
80000 0000 0000 0001end_time
44000 0000min_value
44000 0000max_value
44000 0000first_value
44000 0000last_value
84000 0000 0000 0000sum








TimeSeries Metadata(N个)















1

新增 timeseries metadata type,若为00则表示不包含statistics
400 0000 03sensor名长度int 改成 varInt
373 2e33s.1
20003数据类型为floatshort -> byte
80000 0000 0000 00a0ChunkMetadataList的offset
40000 0041ChunkMetadataList的sizeint 改成 varInt









TimeSeries Statistics

80000 0000 0000 0001该序列在file中有1个点long 改成 varInt
80000 0000 0000 0001start_time
80000 0000 0000 0001end_time
44000 0000min_value
44000 0000max_value
44000 0000first_value
44000 0000last_value
84000 0000 0000 0000sum





MetaDataIndex Node





40000 0001树的第二层,他有多少个孩子int -> varInt


MetaDataIndex Entry(N个)

40000 0003sensor名长度为3int -> varInt
3732e 33s.3
800 0000 0000 0000 e1offset of the child

800 0000 0000 0001 26endOffset of the last child

103Node type是Leaf_Measurement



MetaDataIndex Node





40000 0001树的第一层,他有多少个孩子int -> varInt



MetaDataIndex Entry(N个)

40000 0010size of deviceid is 16bytesint -> varInt
16726f 6f74 2e74 7572 6269 6e65 312e 6431name of deviceId
80000 0000 0000 0126offset of the child

80000 0000 0000 0142endOffset of the last child

102Node type是Internal_MeasurementNode type改成LEAF_DEVICE
total chunk number
40000 0001total chunk numberremove
invalid chunk number
40000 0000无效的chunk numberremove


Version Info




400 0000 01version pair的个数remove


Version Pair(N个)

800 0000 0000 0000 9foffset of current versionremove
800 0000 0000 0000 65版本是101remove




Bloom Filter





40000 001fbloom filter sizeint 改成 varInt
3100 0000 0040 0000 0000 0000 0000
0100 0000 2000 0000 0020 0000 0000 0000 0004


bloom filter data


40000 0100filter sizeint 改成 varInt
40000 0005hash function sizeint 改成 varInt
Footer40000 0078tsfile metadata size不能使用varInt,因为这个需要倒着读
MAGIC_STRING65473 4669 6c65TsFile
  • No labels

2 Comments

  1. VERSION_NUMBER: "is changed to use 1 byte to represent since version 3"

  2. 为什么索引在文件尾部,而不是先索引再数据?