Browse Source

feat add heap top

Xiang Li 12 years ago
parent
commit
1d49098954
2 changed files with 8 additions and 0 deletions
  1. 4 0
      store/store.go
  2. 4 0
      store/ttl_key_heap.go

+ 4 - 0
store/store.go

@@ -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

+ 4 - 0
store/ttl_key_heap.go

@@ -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)