Permalink
Browse files

make waffleListener a donut.MonitoredListener

  • Loading branch information...
1 parent beab6f1 commit e99bb04d53b59e9ac0a700f73717cbe0486d78b8 @dforsyth committed Mar 31, 2012
Showing with 9 additions and 3 deletions.
  1. +4 −0 graph.go
  2. +5 −3 listener.go
View
@@ -198,3 +198,7 @@ func (g *Graph) compute() {
func (g *Graph) Write() error {
return g.job.Write(g)
}
+
+func (g *Graph) information() map[string]interface{} {
+ return make(map[string]interface{})
+}
View
@@ -11,7 +11,6 @@ type waffleListener struct {
clusterName string
- graph *Graph
done chan byte
zk *gozk.ZooKeeper
job Job
@@ -22,8 +21,7 @@ type waffleListener struct {
func (l *waffleListener) OnJoin(zk *gozk.ZooKeeper) {
log.Println("waffle onjoin")
l.zk = zk
- l.graph = newGraph(l.job, l.coordinator)
- l.coordinator.graph = l.graph
+ l.coordinator.graph = newGraph(l.job, l.coordinator)
l.coordinator.donutConfig = l.config
if err := l.coordinator.start(zk); err != nil {
l.cluster.Shutdown()
@@ -43,3 +41,7 @@ func (l *waffleListener) OnLeave() {
l.done <- 1
}()
}
+
+func (l *waffleListener) Information() map[string]interface{} {
+ return l.coordinator.graph.information()
+}

0 comments on commit e99bb04

Please sign in to comment.