Expose NewIndexReader() and cleanups

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
Goutham Veeramachaneni 2017-09-13 13:47:20 +05:30
parent 3870ec285c
commit 8919baef03
No known key found for this signature in database
GPG Key ID: F1C217E8E9023CAD
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"))