|
|
@@ -93,6 +93,9 @@ type Lessor interface {
|
|
|
// ExpiredLeasesC returns a chan that is used to receive expired leases.
|
|
|
ExpiredLeasesC() <-chan []*Lease
|
|
|
|
|
|
+ // Recover recovers the lessor state from the given backend and RangeDeleter.
|
|
|
+ Recover(b backend.Backend, rd RangeDeleter)
|
|
|
+
|
|
|
// Stop stops the lessor for managing leases. The behavior of calling Stop multiple
|
|
|
// times is undefined.
|
|
|
Stop()
|
|
|
@@ -476,8 +479,7 @@ func int64ToBytes(n int64) []byte {
|
|
|
|
|
|
// FakeLessor is a fake implementation of Lessor interface.
|
|
|
// Used for testing only.
|
|
|
-type FakeLessor struct {
|
|
|
-}
|
|
|
+type FakeLessor struct{}
|
|
|
|
|
|
func (fl *FakeLessor) SetRangeDeleter(dr RangeDeleter) {}
|
|
|
|
|
|
@@ -499,4 +501,6 @@ func (le *FakeLessor) Lookup(id LeaseID) *Lease { return nil }
|
|
|
|
|
|
func (fl *FakeLessor) ExpiredLeasesC() <-chan []*Lease { return nil }
|
|
|
|
|
|
+func (fl *FakeLessor) Recover(b backend.Backend, rd RangeDeleter) {}
|
|
|
+
|
|
|
func (fl *FakeLessor) Stop() {}
|