prometheus-junkyard / tsdb

The Prometheus time series database layer.
Apache License 2.0
835 stars 178 forks source link

docs outdated on Label offset Table? #666

Closed jiacai2050 closed 5 years ago

jiacai2050 commented 5 years ago

In both Label Offset Table and Postings Offset Table, there is a 4-byte entries field, but in ReadOffsetTable, read as following order:

  1. cnt := d.Be32()
  2. keyCount := d.Uvarint()
  3. d.UvarintStr()
  4. goto 2 if has more element

It seems that there is no entries in offset table, Am I missing anything?

codesome commented 5 years ago

cnt := d.Be32() is the #entries <4b> field. The len <4b> is gobbled up by encoding.NewDecbufAt(...).