Skip to content

Commit

Permalink
make waffleListener a donut.MonitoredListener
Browse files Browse the repository at this point in the history
  • Loading branch information
dforsyth committed Mar 31, 2012
1 parent beab6f1 commit e99bb04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
}
8 changes: 5 additions & 3 deletions listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type waffleListener struct {

clusterName string

graph *Graph
done chan byte
zk *gozk.ZooKeeper
job Job
Expand All @@ -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()
Expand All @@ -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.