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)
|
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) {
|
func newDiskFrontier(i iterator) (d *diskFrontier, err error) {
|
||||||
i.SeekToLast()
|
i.SeekToLast()
|
||||||
if i.Key() == nil {
|
if i.Key() == nil {
|
||||||
|
|
|
@ -365,7 +365,7 @@ func (t *tieredStorage) renderView(viewJob viewJob) (err error) {
|
||||||
)
|
)
|
||||||
|
|
||||||
// fmt.Printf("Starting scan of %s...\n", scanJob)
|
// 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)
|
// fmt.Printf("Using diskFrontier %s\n", t.diskFrontier)
|
||||||
seriesFrontier, err := newSeriesFrontier(scanJob.fingerprint, *t.diskFrontier, iterator)
|
seriesFrontier, err := newSeriesFrontier(scanJob.fingerprint, *t.diskFrontier, iterator)
|
||||||
// fmt.Printf("Using seriesFrontier %s\n", seriesFrontier)
|
// fmt.Printf("Using seriesFrontier %s\n", seriesFrontier)
|
||||||
|
|
Loading…
Reference in New Issue