Skip to content

Commit

Permalink
Add basic non-distributed version of coordinator implementation to ho…
Browse files Browse the repository at this point in the history
…ok into datastore
  • Loading branch information
pauldix committed Oct 11, 2013
1 parent a6d995d commit 647d09c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/coordinator/coordinator.go
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
package coordinator

import (
"datastore"
"parser"
"protocol"
)

type CoordinatorImpl struct {
clusterConfiguration *ClusterConfiguration
raftServer *RaftServer
datastore datastore.Datastore
}

func NewCoordinatorImpl(datastore datastore.Datastore, raftServer *RaftServer, clusterConfiguration *ClusterConfiguration) Coordinator {
return &CoordinatorImpl{clusterConfiguration, raftServer, datastore}
}

func (self *CoordinatorImpl) DistributeQuery(query *parser.Query, yield func(*protocol.Series) error) error {
return self.datastore.ExecuteQuery(0, query, yield)
}

func (self *CoordinatorImpl) WriteSeriesData(series *protocol.Series) error {
return self.datastore.WriteSeriesData(0, series)
}

0 comments on commit 647d09c

Please sign in to comment.