diff --git a/commands/pilosa-cruncher/cruncher.go b/commands/pilosa-cruncher/cruncher.go index 99d6f947c..72af2a7e6 100644 --- a/commands/pilosa-cruncher/cruncher.go +++ b/commands/pilosa-cruncher/cruncher.go @@ -4,13 +4,19 @@ import ( "flag" "log" "os" + "pilosa/core" "pilosa/cruncher" "runtime/pprof" ) -var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file") +var ( + cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file") + Build string +) func main() { + core.Build = Build + flag.Parse() if *cpuprofile != "" { f, err := os.Create(*cpuprofile) diff --git a/core/service.go b/core/service.go index c3b51d80c..22e1d45dd 100644 --- a/core/service.go +++ b/core/service.go @@ -35,6 +35,8 @@ type Service struct { name string } +var Build string + func NewService() *Service { service := new(Service) service.init_id() @@ -48,7 +50,7 @@ func NewService() *Service { service.WebService = NewWebService(service) service.Index = index.NewFragmentContainer() service.Hold = hold.NewHolder() - service.version = "0.0.25" + service.version = Build service.name = "Cruncher" service.PrepareLogging() fmt.Printf("Pilosa %s\n", service.version) diff --git a/index/brand.go b/index/brand.go index 6940da3a5..041e5a258 100644 --- a/index/brand.go +++ b/index/brand.go @@ -313,12 +313,12 @@ func (self *Brand) Persist() error { asize := len(self.bitmap_cache) if asize == 0 { - log.Println("Nothing to save %s", self.getFileName()) + log.Println("Nothing to save ", self.getFileName()) return nil } w, err := util.Create(self.getFileName()) if err != nil { - log.Println("Error opening outfile %s", self.getFileName()) + log.Println("Error opening outfile ", self.getFileName()) log.Println(err) return err } diff --git a/index/fragment_container.go b/index/fragment_container.go index 2e409bd67..7253e00c6 100644 --- a/index/fragment_container.go +++ b/index/fragment_container.go @@ -252,7 +252,6 @@ func getStorage(db string, slice int, frame string, fid SUUID) Storage { } return NewCassStorage(hosts, keyspace) } - return nil } func NewFragment(frag_id SUUID, db string, slice int, frame string) *Fragment {