From 8919baef037dbad69ec719334b68dbc186ba26c5 Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Wed, 13 Sep 2017 13:47:20 +0530 Subject: [PATCH] Expose NewIndexReader() and cleanups Signed-off-by: Goutham Veeramachaneni --- block.go | 5 ----- db.go | 3 +-- index.go | 3 +++ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/block.go b/block.go index 67cd57491..232e64e67 100644 --- a/block.go +++ b/block.go @@ -64,11 +64,6 @@ type Appendable interface { Appender() Appender } -// Queryable defines an entity which provides a Querier. -type Queryable interface { - Querier(mint, maxt int64) Querier -} - // BlockMeta provides meta information about a block. type BlockMeta struct { // Unique identifier for the block and its contents. Changes on compaction. diff --git a/db.go b/db.go index c9745cfc6..87b5ed253 100644 --- a/db.go +++ b/db.go @@ -165,8 +165,7 @@ func Open(dir string, l log.Logger, r prometheus.Registerer, opts *Options) (db return nil, err } if l == nil { - l = log.NewLogfmtLogger(os.Stdout) - l = log.With(l, "ts", log.DefaultTimestampUTC, "caller", log.DefaultCaller) + l = log.NewNopLogger() } if opts == nil { opts = DefaultOptions diff --git a/index.go b/index.go index fd9b25162..3cdaad74d 100644 --- a/index.go +++ b/index.go @@ -570,6 +570,9 @@ var ( errInvalidFlag = fmt.Errorf("invalid flag") ) +// NewIndexReader returns a new IndexReader on the given directory. +func NewIndexReader(dir string) (IndexReader, error) { return newIndexReader(dir) } + // newIndexReader returns a new indexReader on the given directory. func newIndexReader(dir string) (*indexReader, error) { f, err := openMmapFile(filepath.Join(dir, "index"))