mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-09 20:37:52 +00:00
43 lines
835 B
Go
43 lines
835 B
Go
package cruncher
|
|
|
|
import (
|
|
"pilosa/core"
|
|
"pilosa/dispatch"
|
|
"pilosa/executor"
|
|
"pilosa/transport"
|
|
)
|
|
|
|
type Cruncher struct {
|
|
*core.Service
|
|
close_chan chan bool
|
|
// api *index.FragmentContainer
|
|
}
|
|
|
|
func (cruncher *Cruncher) Run() {
|
|
// go cruncher.Cleanup()
|
|
cruncher.Service.Run()
|
|
}
|
|
|
|
/*
|
|
func (cruncher *Cruncher) Cleanup() {
|
|
exit, done := cruncher.Service.GetExitChannels()
|
|
for {
|
|
select {
|
|
case <-exit:
|
|
spew.Dump(cruncher)
|
|
cruncher.api.Shutdown()
|
|
done <- 1
|
|
}
|
|
}
|
|
}
|
|
*/
|
|
|
|
func NewCruncher() *Cruncher {
|
|
service := core.NewService()
|
|
//fragment_container := index.NewFragmentContainer()
|
|
cruncher := Cruncher{service, make(chan bool)}
|
|
cruncher.Transport = transport.NewTcpTransport(service)
|
|
cruncher.Dispatch = dispatch.NewDispatch(service)
|
|
cruncher.Executor = executor.NewExecutor(service)
|
|
return &cruncher
|
|
}
|