Add basic non-distributed version of coordinator implementation to hook into datastore

pull/17/head
Paul Dix 2013-10-11 13:32:02 -04:00
parent a6d995dcd4
commit 647d09cbd6
1 changed files with 24 additions and 0 deletions

View File

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