Merge pull request #144 from Gouthamve/misc-

Expose NewIndexReader() and cleanups
This commit is contained in:
Fabian Reinartz 2017-09-13 10:23:07 +02:00 committed by GitHub
commit 643563068b
3 changed files with 4 additions and 7 deletions

View file

@ -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.

3
db.go
View file

@ -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

View file

@ -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"))