Merge pull request #144 from Gouthamve/misc-

Expose NewIndexReader() and cleanups
pull/5805/head
Fabian Reinartz 7 years ago committed by GitHub
commit 643563068b

@ -64,11 +64,6 @@ type Appendable interface {
Appender() Appender 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. // BlockMeta provides meta information about a block.
type BlockMeta struct { type BlockMeta struct {
// Unique identifier for the block and its contents. Changes on compaction. // Unique identifier for the block and its contents. Changes on compaction.

@ -165,8 +165,7 @@ func Open(dir string, l log.Logger, r prometheus.Registerer, opts *Options) (db
return nil, err return nil, err
} }
if l == nil { if l == nil {
l = log.NewLogfmtLogger(os.Stdout) l = log.NewNopLogger()
l = log.With(l, "ts", log.DefaultTimestampUTC, "caller", log.DefaultCaller)
} }
if opts == nil { if opts == nil {
opts = DefaultOptions opts = DefaultOptions

@ -570,6 +570,9 @@ var (
errInvalidFlag = fmt.Errorf("invalid flag") 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. // newIndexReader returns a new indexReader on the given directory.
func newIndexReader(dir string) (*indexReader, error) { func newIndexReader(dir string) (*indexReader, error) {
f, err := openMmapFile(filepath.Join(dir, "index")) f, err := openMmapFile(filepath.Join(dir, "index"))

Loading…
Cancel
Save