|
@@ -123,12 +123,6 @@ type lessor struct {
|
|
|
// demotec will be closed if the lessor is demoted.
|
|
// demotec will be closed if the lessor is demoted.
|
|
|
demotec chan struct{}
|
|
demotec chan struct{}
|
|
|
|
|
|
|
|
- // TODO: probably this should be a heap with a secondary
|
|
|
|
|
- // id index.
|
|
|
|
|
- // Now it is O(N) to loop over the leases to find expired ones.
|
|
|
|
|
- // We want to make Grant, Revoke, and findExpiredLeases all O(logN) and
|
|
|
|
|
- // Renew O(1).
|
|
|
|
|
- // findExpiredLeases and Renew should be the most frequent operations.
|
|
|
|
|
leaseMap map[LeaseID]*Lease
|
|
leaseMap map[LeaseID]*Lease
|
|
|
leaseHeap LeaseQueue
|
|
leaseHeap LeaseQueue
|
|
|
itemMap map[LeaseItem]LeaseID
|
|
itemMap map[LeaseItem]LeaseID
|