Merge pull request #9649 from cosgroveb/cleanup_lease_queue_todo

lease: Clean-up old TODO around lease map and priority queue
release-3.4
Xiang Li 2018-04-27 09:24:59 -07:00 committed by GitHub
commit 5fca0ec7bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 6 deletions

View File

@ -123,12 +123,6 @@ type lessor struct {
// demotec will be closed if the lessor is demoted.
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
leaseHeap LeaseQueue
itemMap map[LeaseItem]LeaseID