Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0b2b286

Browse files
committedMay 20, 2018
cleanup
1 parent e3c1aed commit 0b2b286

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed
 

‎mdata/cache/ccache.go

+9-10
Original file line numberDiff line numberDiff line change
@@ -204,22 +204,21 @@ func (c *CCache) evict(target *accnt.EvictTarget) {
204204
func (c *CCache) Search(ctx context.Context, metric schema.AMKey, from, until uint32) (*CCSearchResult, error) {
205205
ctx, span := tracing.NewSpan(ctx, c.tracer, "CCache.Search")
206206
defer span.Finish()
207-
var hit chunk.IterGen
208-
var cm *CCacheMetric
209-
var ok bool
210-
res := &CCSearchResult{
211-
From: from,
212-
Until: until,
213-
}
214207

215208
if from >= until {
216209
return nil, ErrInvalidRange
217210
}
218211

212+
res := &CCSearchResult{
213+
From: from,
214+
Until: until,
215+
}
216+
219217
c.RLock()
220218
defer c.RUnlock()
221219

222-
if cm, ok = c.metricCache[metric]; !ok {
220+
cm, ok := c.metricCache[metric]
221+
if !ok {
223222
span.SetTag("cache", "miss")
224223
accnt.CacheMetricMiss.Inc()
225224
return res, nil
@@ -233,10 +232,10 @@ func (c *CCache) Search(ctx context.Context, metric schema.AMKey, from, until ui
233232

234233
accnt.CacheChunkHit.Add(len(res.Start) + len(res.End))
235234
go func() {
236-
for _, hit = range res.Start {
235+
for _, hit := range res.Start {
237236
c.accnt.HitChunk(metric, hit.Ts)
238237
}
239-
for _, hit = range res.End {
238+
for _, hit := range res.End {
240239
c.accnt.HitChunk(metric, hit.Ts)
241240
}
242241
}()

‎store/cassandra/store_cassandra.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const Month_sec = 60 * 60 * 24 * 28
3333
const Table_name_format = `metric_%d`
3434

3535
var (
36-
errChunkTooSmall = errors.New("unpossibly small chunk in cassandra")
36+
errChunkTooSmall = errors.New("impossibly small chunk in cassandra")
3737
errInvalidRange = errors.New("CassandraStore: invalid range: from must be less than to")
3838
errReadQueueFull = errors.New("the read queue is full")
3939
errReadTooOld = errors.New("the read is too old")

0 commit comments

Comments
 (0)
This repository has been archived.