数据写入流程分析
本篇不涉及存储层的写入,只分析写入请求的处理流程
Influxdb名词介绍
如果想搞清楚Influxdb数据写入流程,Influxdb本身的用法和其一些主要的专用词还是要明白是什么意思...,比如measurement, field key,field value, tag key, tag value, tag set, line protocol, point, series, query..., retention policy等;
相关的专用名词解释可参考: InfluxDB glossary of terms
分析入口
我们还是以http写请求为入口来分析,在httpd/handler.go...将http body解析成Points是写入前的最主要的一步, 相关内容定义在 models/points.go中;
我们先来看一下一条写入语句是什么样子的: insert test_mea_1,tag1...PointsWriter分析
定义在coordinator/points_writer.go中
主要负责将数据写入到本地的存储,我们重点分析下WritePointsPrivileged
func (w