From ba99dece0c708cbcabc4c7ca814c6a80239f22df Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Wed, 2 Dec 2015 14:01:10 -0700 Subject: [PATCH] Wire up tsm1dev engine cursor --- tsdb/engine/tsm1/engine.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tsdb/engine/tsm1/engine.go b/tsdb/engine/tsm1/engine.go index ee77776d9d..5025637f4a 100644 --- a/tsdb/engine/tsm1/engine.go +++ b/tsdb/engine/tsm1/engine.go @@ -169,6 +169,7 @@ func (e *DevEngine) LoadMetadataIndex(shard *tsdb.Shard, index *tsdb.DatabaseInd if err == nil { return err } + s := tsdb.NewSeries(seriesKey, tags) s.InitializeShards() index.CreateSeriesIndexIfNotExists(measurement, s) @@ -213,7 +214,7 @@ func (e *DevEngine) SeriesCount() (n int, err error) { // Begin starts a new transaction on the engine. func (e *DevEngine) Begin(writable bool) (tsdb.Tx, error) { - return nil, fmt.Errorf("begin transaction not implemented") + return &devTx{engine: e}, nil } func (e *DevEngine) WriteTo(w io.Writer) (n int64, err error) { panic("not implemented") } @@ -276,6 +277,10 @@ func (t *devTx) Cursor(series string, fields []string, dec *tsdb.FieldCodec, asc ascending: ascending, } } +func (t *devTx) Rollback() error { return nil } +func (t *devTx) Size() int64 { panic("not implemented") } +func (t *devTx) Commit() error { panic("not implemented") } +func (t *devTx) WriteTo(w io.Writer) (n int64, err error) { panic("not implemented") } // devCursor is a cursor that combines both TSM and cached data. type devCursor struct {