Skip to content

Commit

Permalink
misc cleanup while reviewing chans/goroutines (#1375)
Browse files Browse the repository at this point in the history
- renamed snapshot_rollback.go and snapshot_rollback_test.go to
  rollback.go and rollback_test.go, the snapshot_ prefix
  should be limited to code that relates directly to either
  an index snapshot or segment snapshot.  rollback can be seen
  as operating on the index as a whole.

- renamed mainLoop to introducerLoop, consistent with
  persisterLoop and mergerLoop

- remove snapshotReversion this is no longer used

- remove type uint64Descending and related methods, no longer used
  • Loading branch information
mschoch authored Apr 20, 2020
1 parent 4dc1310 commit b658b02
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions index/scorch/introducer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions index/scorch/persister.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion index/scorch/scorch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b658b02

Please sign in to comment.