naming
parent
4233763321
commit
25edd7bfdf
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue