mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 21:54:10 -08:00
Encapsulate fingerprint frontier checks in renderView().
This commit is contained in:
parent
1a1cba1bb2
commit
ce4f560e48
|
@ -38,6 +38,10 @@ func (f *diskFrontier) String() string {
|
|||
return fmt.Sprintf("diskFrontier from %s at %s to %s at %s", f.firstFingerprint.ToRowKey(), f.firstSupertime, f.lastFingerprint.ToRowKey(), f.lastSupertime)
|
||||
}
|
||||
|
||||
func (f *diskFrontier) ContainsFingerprint(fingerprint model.Fingerprint) bool {
|
||||
return fingerprint.Less(f.firstFingerprint) || f.lastFingerprint.Less(fingerprint)
|
||||
}
|
||||
|
||||
func newDiskFrontier(i iterator) (d *diskFrontier, err error) {
|
||||
i.SeekToLast()
|
||||
if i.Key() == nil {
|
||||
|
|
|
@ -365,7 +365,7 @@ func (t *tieredStorage) renderView(viewJob viewJob) (err error) {
|
|||
)
|
||||
|
||||
// fmt.Printf("Starting scan of %s...\n", scanJob)
|
||||
if !(t.diskFrontier == nil || scanJob.fingerprint.Less(t.diskFrontier.firstFingerprint) || t.diskFrontier.lastFingerprint.Less(scanJob.fingerprint)) {
|
||||
if t.diskFrontier != nil || t.diskFrontier.ContainsFingerprint(scanJob.fingerprint) {
|
||||
// fmt.Printf("Using diskFrontier %s\n", t.diskFrontier)
|
||||
seriesFrontier, err := newSeriesFrontier(scanJob.fingerprint, *t.diskFrontier, iterator)
|
||||
// fmt.Printf("Using seriesFrontier %s\n", seriesFrontier)
|
||||
|
|
Loading…
Reference in a new issue