From eb4f3669884b1d0aa0968b360f46dea4363652f6 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Thu, 29 Dec 2016 11:03:39 +0100 Subject: [PATCH] Add return error to Appender.Add --- db.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db.go b/db.go index 2d7e21501..d43cbd00f 100644 --- a/db.go +++ b/db.go @@ -113,7 +113,7 @@ type Appender interface { // AddSeries(Labels) uint64 // Add adds a sample pair for the referenced series. - Add(lset labels.Labels, t int64, v float64) + Add(lset labels.Labels, t int64, v float64) error // Commit submits the collected samples and purges the batch. Commit() error @@ -132,7 +132,7 @@ type bucketAppender struct { buckets [][]hashedSample } -func (ba *bucketAppender) Add(lset labels.Labels, t int64, v float64) { +func (ba *bucketAppender) Add(lset labels.Labels, t int64, v float64) error { h := lset.Hash() s := h >> (64 - shardShift) @@ -142,6 +142,8 @@ func (ba *bucketAppender) Add(lset labels.Labels, t int64, v float64) { t: t, v: v, }) + + return nil } func (ba *bucketAppender) reset() {