TSM文件格式及实例解析(四)——string的排列

目录

引:

数据

简析

Indexes:

blocks:

关联string

小结:


TSM文件格式现已基本明了,某些压缩算法有空再去研究一下。

引:

现在想知道未压缩的文件格式是怎样。

但是翻遍官方配置文档

https://docs.influxdata.com/influxdb/v1.6/administration/config/#data-settings-data

并没有设定不压缩数据的选项。尝试一下string的排列,在某些情况下(数据简单,彼此无关联),这些string的value是简单length-value结构。 但是做不到多个timestamps不压缩

数据

言归正传,先来一组field 为string的数据

insert cars,brand=bmw,model=x5 location="tianhe",direction="up",weather="sunny"            1535354189281013006
insert cars,brand=bmw,model=x5 location="luogang",direction="down",weather="cloudy"       1535354189281014006
insert cars,brand=bmw,model=x5 location="huangpu",direction="north",weather="rainny"       1535354189281015006
insert cars,brand=bmw,model=x5 location="panyu",direction="west",weather="overcast"     1535354189281016006
insert cars,brand=bmw,model=x5 location="nansha",direction="south",weather="shower"       1535354189281017006
insert cars,brand=bmw,model=x5 location="liwan",direction="east",weather="sleet"        1535354189281018006
insert cars,brand=bmw,model=x5 location="yuexiu",direction="fail",weather="blizzard"     1535354189281019006

TSM文件格式

 

简析

按照之前的解析方法

 

 

 

Indexes:

Indexes的起始位置为offset C8处, 0024...

blocks:

 

这三组string的values并没有被压缩成肉眼不可见,length-value 表示。

实际上这已经是snappy算法压缩后的结果,只是在这三组数据的情况下,是明码可见的。以后再去研究snappy算法,弄清楚什么样的数据会被压缩,什么情况下只是用简单length-value的形式表示。

 

关联string

再来一组有关联的,且很长的string

insert cars,brand=bmw,model=320li position="zhongguoguangdongguangzhoutianhe" 1535354189281020006
insert cars,brand=bmw,model=320li position="zhongguoguangdongguangzhouhuangpu" 1535354189281021006

得到文件是这样的

很明显,string value 是从 10 43开始的

这里的string肉眼不可见,需要解压缩后才知道了。

 

小结:

string作为value, 文件数据格式依旧保持 header, blocks ,indexes,footer这种基本结构。

block中timestamps的存储还是照旧RLE or s8b.

只有value的部分按照snappy算法进行压缩,或压缩成肉眼不可见,或只是length-value结构。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值