mirror of https://github.com/prometheus/prometheus
Doc fixes
parent
d578b10d5c
commit
ac5bd71d8f
|
@ -322,11 +322,11 @@ func newChunkReader(bs []ByteSlice, cs []io.Closer, pool chunks.Pool) (*chunkRea
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewChunkReader returns a new chunk reader against the given byte slices.
|
// NewChunkReader returns a new chunk reader against the given byte slices.
|
||||||
func NewChunkReader(bs []ByteSlice, pool chunks.Pool) ChunkReader {
|
func NewChunkReader(bs []ByteSlice, pool chunks.Pool) (ChunkReader, error) {
|
||||||
if pool == nil {
|
if pool == nil {
|
||||||
pool = chunks.NewPool()
|
pool = chunks.NewPool()
|
||||||
}
|
}
|
||||||
return &chunkReader{bs: bs, pool: pool}
|
return newChunkReader(bs, nil, pool)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDirChunkReader returns a new ChunkReader against sequentially numbered files in the
|
// NewDirChunkReader returns a new ChunkReader against sequentially numbered files in the
|
||||||
|
|
8
index.go
8
index.go
|
@ -605,11 +605,12 @@ func (b realByteSlice) Sub(start, end int) ByteSlice {
|
||||||
return b[start:end]
|
return b[start:end]
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewIndexReader returns a new IndexReader on the given directory.
|
// NewIndexReader returns a new IndexReader on the given byte slice.
|
||||||
func NewIndexReader(b ByteSlice) (IndexReader, error) {
|
func NewIndexReader(b ByteSlice) (IndexReader, error) {
|
||||||
return newIndexReader(b, nil)
|
return newIndexReader(b, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewFileIndexReader returns a new index reader against the given index file.
|
||||||
func NewFileIndexReader(path string) (IndexReader, error) {
|
func NewFileIndexReader(path string) (IndexReader, error) {
|
||||||
f, err := openMmapFile(path)
|
f, err := openMmapFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -618,7 +619,6 @@ func NewFileIndexReader(path string) (IndexReader, error) {
|
||||||
return newIndexReader(realByteSlice(f.b), f)
|
return newIndexReader(realByteSlice(f.b), f)
|
||||||
}
|
}
|
||||||
|
|
||||||
// newIndexReader returns a new indexReader on the given directory.
|
|
||||||
func newIndexReader(b ByteSlice, c io.Closer) (*indexReader, error) {
|
func newIndexReader(b ByteSlice, c io.Closer) (*indexReader, error) {
|
||||||
r := &indexReader{
|
r := &indexReader{
|
||||||
b: b,
|
b: b,
|
||||||
|
@ -660,7 +660,7 @@ func (r *indexReader) readTOC() error {
|
||||||
d := decbuf{b: b[:len(b)-4]}
|
d := decbuf{b: b[:len(b)-4]}
|
||||||
|
|
||||||
if d.crc32() != expCRC {
|
if d.crc32() != expCRC {
|
||||||
return (errInvalidChecksum)
|
return errInvalidChecksum
|
||||||
}
|
}
|
||||||
|
|
||||||
r.toc.symbols = d.be64()
|
r.toc.symbols = d.be64()
|
||||||
|
@ -697,7 +697,7 @@ func (r *indexReader) decbufAt(off int) decbuf {
|
||||||
return dec
|
return dec
|
||||||
}
|
}
|
||||||
|
|
||||||
// decbufAt returns a new decoding buffer. It expects the first bytes
|
// decbufUvarintAt returns a new decoding buffer. It expects the first bytes
|
||||||
// after offset to hold the uvarint-encoded buffers length, followed by the contents and the expected
|
// after offset to hold the uvarint-encoded buffers length, followed by the contents and the expected
|
||||||
// checksum.
|
// checksum.
|
||||||
func (r *indexReader) decbufUvarintAt(off int) decbuf {
|
func (r *indexReader) decbufUvarintAt(off int) decbuf {
|
||||||
|
|
Loading…
Reference in New Issue