feat add heap top

This commit is contained in:
Xiang Li 2013-11-04 22:13:26 -08:00
parent 07b52ee24c
commit 1d49098954
2 changed files with 8 additions and 0 deletions

View File

@ -457,6 +457,10 @@ func (s *store) checkDir(parent *Node, dirName string) (*Node, *etcdErr.Error) {
return n, nil
}
func (s *store) MonitorTTLKeys() {
}
// Save function saves the static state of the store system.
// Save function will not be able to save the state of watchers.
// Save function will not save the parent field of the node. Or there will

View File

@ -48,6 +48,10 @@ func (h *ttlKeyHeap) Pop() interface{} {
return x
}
func (h *ttlKeyHeap) top() *Node {
return h.array[0]
}
func (h *ttlKeyHeap) pop() *Node {
x := heap.Pop(h)
n, _ := x.(*Node)