Skip to content

Commit

Permalink
Clarify 'implements ChunkStore' doc comments (grafana#3270)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Wells <b.v.wells@gmail.com>
  • Loading branch information
bvwells authored Oct 5, 2020
1 parent df60cd2 commit 0919468
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions chunk_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (cfg *StoreConfig) RegisterFlags(f *flag.FlagSet) {
f.Var(&cfg.MaxLookBackPeriod, "store.max-look-back-period", "Limit how long back data can be queried")
}

// Validate validates the store config.
func (cfg *StoreConfig) Validate() error {
if err := cfg.ChunkCacheConfig.Validate(); err != nil {
return err
Expand Down Expand Up @@ -138,7 +139,7 @@ func newStore(cfg StoreConfig, schema StoreSchema, index IndexClient, chunks Cli
}, nil
}

// Put implements ChunkStore
// Put implements Store
func (c *store) Put(ctx context.Context, chunks []Chunk) error {
for _, chunk := range chunks {
if err := c.PutOne(ctx, chunk.From, chunk.Through, chunk); err != nil {
Expand All @@ -148,7 +149,7 @@ func (c *store) Put(ctx context.Context, chunks []Chunk) error {
return nil
}

// PutOne implements ChunkStore
// PutOne implements Store
func (c *store) PutOne(ctx context.Context, from, through model.Time, chunk Chunk) error {
log, ctx := spanlogger.New(ctx, "ChunkStore.PutOne")
defer log.Finish()
Expand Down
4 changes: 2 additions & 2 deletions series_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func (c *seriesStore) lookupLabelNamesBySeries(ctx context.Context, from, throug
return result.Strings(), nil
}

// Put implements ChunkStore
// Put implements Store
func (c *seriesStore) Put(ctx context.Context, chunks []Chunk) error {
for _, chunk := range chunks {
if err := c.PutOne(ctx, chunk.From, chunk.Through, chunk); err != nil {
Expand All @@ -418,7 +418,7 @@ func (c *seriesStore) Put(ctx context.Context, chunks []Chunk) error {
return nil
}

// PutOne implements ChunkStore
// PutOne implements Store
func (c *seriesStore) PutOne(ctx context.Context, from, through model.Time, chunk Chunk) error {
log, ctx := spanlogger.New(ctx, "SeriesStore.PutOne")
defer log.Finish()
Expand Down

0 comments on commit 0919468

Please sign in to comment.