diff --git a/index/scorch/introducer.go b/index/scorch/introducer.go index e5f00f80e..64ca969bd 100644 --- a/index/scorch/introducer.go +++ b/index/scorch/introducer.go @@ -45,13 +45,7 @@ type epochWatcher struct { notifyCh notificationChan } -type snapshotReversion struct { - snapshot *IndexSnapshot - applied chan error - persisted chan error -} - -func (s *Scorch) mainLoop() { +func (s *Scorch) introducerLoop() { var epochWatchers []*epochWatcher OUTER: for { diff --git a/index/scorch/persister.go b/index/scorch/persister.go index 30e75df77..ffa656693 100644 --- a/index/scorch/persister.go +++ b/index/scorch/persister.go @@ -780,12 +780,6 @@ func (s *Scorch) loadSegment(segmentBucket *bolt.Bucket) (*SegmentSnapshot, erro return rv, nil } -type uint64Descending []uint64 - -func (p uint64Descending) Len() int { return len(p) } -func (p uint64Descending) Less(i, j int) bool { return p[i] > p[j] } -func (p uint64Descending) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - func (s *Scorch) removeOldData() { removed, err := s.removeOldBoltSnapshots() if err != nil { diff --git a/index/scorch/snapshot_rollback.go b/index/scorch/rollback.go similarity index 100% rename from index/scorch/snapshot_rollback.go rename to index/scorch/rollback.go diff --git a/index/scorch/snapshot_rollback_test.go b/index/scorch/rollback_test.go similarity index 100% rename from index/scorch/snapshot_rollback_test.go rename to index/scorch/rollback_test.go diff --git a/index/scorch/scorch.go b/index/scorch/scorch.go index 80f9e3a79..698aaf16a 100644 --- a/index/scorch/scorch.go +++ b/index/scorch/scorch.go @@ -181,7 +181,7 @@ func (s *Scorch) Open() error { } s.asyncTasks.Add(1) - go s.mainLoop() + go s.introducerLoop() if !s.readOnly && s.path != "" { s.asyncTasks.Add(1)