mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Fix OperatorError.
This used to work with Go 1.1, but only because of a compiler bug. The bug is fixed in Go 1.2, so we have to fix our code now. Change-Id: I5a9f3a15878afd750e848be33e90b05f3aa055e1
This commit is contained in:
parent
d5ef0c64dc
commit
c342ad33a0
|
@ -50,7 +50,7 @@ func (f FilterResult) String() string {
|
||||||
type OperatorErrorType int
|
type OperatorErrorType int
|
||||||
|
|
||||||
type OperatorError struct {
|
type OperatorError struct {
|
||||||
error
|
Error error
|
||||||
Continuable bool
|
Continuable bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -369,7 +369,7 @@ func (w *watermarkScanner) Operate(key, _ interface{}) (oErr *storage.OperatorEr
|
||||||
// there was a decoding error with the entity and shouldn't be cause to stop
|
// there was a decoding error with the entity and shouldn't be cause to stop
|
||||||
// work. The process will simply start from a pessimistic work time and
|
// work. The process will simply start from a pessimistic work time and
|
||||||
// work forward. With an idempotent processor, this is safe.
|
// work forward. With an idempotent processor, this is safe.
|
||||||
return &storage.OperatorError{error: err, Continuable: true}
|
return &storage.OperatorError{Error: err, Continuable: true}
|
||||||
}
|
}
|
||||||
|
|
||||||
keySet, _ := w.sampleKeys.Get()
|
keySet, _ := w.sampleKeys.Get()
|
||||||
|
@ -400,13 +400,13 @@ func (w *watermarkScanner) Operate(key, _ interface{}) (oErr *storage.OperatorEr
|
||||||
if seeker.err != nil {
|
if seeker.err != nil {
|
||||||
glog.Warningf("Got error in state machine: %s", seeker.err)
|
glog.Warningf("Got error in state machine: %s", seeker.err)
|
||||||
|
|
||||||
return &storage.OperatorError{error: seeker.err, Continuable: !seeker.iteratorInvalid}
|
return &storage.OperatorError{Error: seeker.err, Continuable: !seeker.iteratorInvalid}
|
||||||
}
|
}
|
||||||
|
|
||||||
if seeker.iteratorInvalid {
|
if seeker.iteratorInvalid {
|
||||||
glog.Warningf("Got illegal iterator in state machine: %s", err)
|
glog.Warningf("Got illegal iterator in state machine: %s", err)
|
||||||
|
|
||||||
return &storage.OperatorError{error: errIllegalIterator, Continuable: false}
|
return &storage.OperatorError{Error: errIllegalIterator, Continuable: false}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !seeker.seriesOperable {
|
if !seeker.seriesOperable {
|
||||||
|
@ -417,7 +417,7 @@ func (w *watermarkScanner) Operate(key, _ interface{}) (oErr *storage.OperatorEr
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// We can't divine the severity of a processor error without refactoring the
|
// We can't divine the severity of a processor error without refactoring the
|
||||||
// interface.
|
// interface.
|
||||||
return &storage.OperatorError{error: err, Continuable: false}
|
return &storage.OperatorError{Error: err, Continuable: false}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = w.curationState.Update(&curationKey{
|
if err = w.curationState.Update(&curationKey{
|
||||||
|
@ -429,7 +429,7 @@ func (w *watermarkScanner) Operate(key, _ interface{}) (oErr *storage.OperatorEr
|
||||||
// Under the assumption that the processors are idempotent, they can be
|
// Under the assumption that the processors are idempotent, they can be
|
||||||
// re-run; thusly, the commitment of the curation remark is no cause
|
// re-run; thusly, the commitment of the curation remark is no cause
|
||||||
// to cease further progress.
|
// to cease further progress.
|
||||||
return &storage.OperatorError{error: err, Continuable: true}
|
return &storage.OperatorError{Error: err, Continuable: true}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -60,7 +60,7 @@ func (d *SamplesDumper) Operate(key, value interface{}) *storage.OperatorError {
|
||||||
})
|
})
|
||||||
if err := d.Error(); err != nil {
|
if err := d.Error(); err != nil {
|
||||||
return &storage.OperatorError{
|
return &storage.OperatorError{
|
||||||
error: err,
|
Error: err,
|
||||||
Continuable: false,
|
Continuable: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue