update docs, rename docs folder, add error condition

This commit is contained in:
Shubheksha Jalan 2018-01-11 14:06:49 +05:30
parent 7b27dc2109
commit faecfac2fa
4 changed files with 5 additions and 5 deletions

View file

@ -65,7 +65,7 @@ Strings are referenced by pointing to the beginning of their length field. The s
### Series
The section contains a sequence of series that hold the label set of the series as well as its chunks within the block. The series are sorted lexicographically by their label sets.
The file offset to the beginning of a series serves as the series' ID in all subsequent references. Thereby, a sorted list of series IDs implies a lexicographically sorted list of series label sets.
Each series section is aligned to 16 bytes. The ID for a series is the `offset/16`. This serves as the series' ID in all subsequent references. Thereby, a sorted list of series IDs implies a lexicographically sorted list of series label sets.
```
┌───────────────────────────────────────┐

View file

@ -575,12 +575,12 @@ func NewReader(b ByteSlice, version int) (*Reader, error) {
return newReader(b, nil, version)
}
func NewReaderV1(b ByteSlice, c io.Closer, version int) (*Reader, error) {
return newReader(b, c, version)
}
// NewFileReader returns a new index reader against the given index file.
func NewFileReader(path string, version int) (*Reader, error) {
if version != 1 && version != 2 {
return nil, errors.Errorf("unexpected file version %d", version)
}
f, err := fileutil.OpenMmapFile(path)
if err != nil {
return nil, err