Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartcarnie committed Aug 17, 2017
1 parent 4233763 commit 25edd7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tsdb/engine/tsm1/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ func (e *Engine) CreateIterator(measurement string, opt query.IteratorOptions) (
if err != nil {
return nil, err
}
return newMergeGuardIterator(itrs, opt)
return newMergeFinalizerIterator(itrs, opt)
}
}

Expand All @@ -1573,14 +1573,14 @@ func (e *Engine) CreateIterator(measurement string, opt query.IteratorOptions) (
} else if len(inputs) == 0 {
return nil, nil
}
return newMergeGuardIterator(inputs, opt)
return newMergeFinalizerIterator(inputs, opt)
}

itrs, err := e.createVarRefIterator(measurement, opt)
if err != nil {
return nil, err
}
return newMergeGuardIterator(itrs, opt)
return newMergeFinalizerIterator(itrs, opt)
}

func (e *Engine) createCallIterator(measurement string, call *influxql.Call, opt query.IteratorOptions) ([]query.Iterator, error) {
Expand Down
7 changes: 4 additions & 3 deletions tsdb/engine/tsm1/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ func (c cursorsAt) close() {
}
}

// newMergeGuardIterator creates a new Merge iterator from the inputs. If Merge returns an error,
// the inputs will be closed
func newMergeGuardIterator(inputs []query.Iterator, opt query.IteratorOptions) (query.Iterator, error) {
// newMergeFinalizerIterator creates a new Merge iterator from the inputs. If the call to Merge succeeds,
// the resulting Iterator will be wrapped in a finalizer iterator.
// If Merge returns an error, the inputs will be closed.
func newMergeFinalizerIterator(inputs []query.Iterator, opt query.IteratorOptions) (query.Iterator, error) {
itr, err := query.Iterators(inputs).Merge(opt)
if err != nil {
query.Iterators(inputs).Close()
Expand Down

0 comments on commit 25edd7b

Please sign in to comment.