mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-10 21:07:53 +00:00
more logging
This commit is contained in:
parent
83a05152c3
commit
1424d18e8b
5 changed files with 12 additions and 3 deletions
|
|
@ -48,7 +48,7 @@ func NewService() *Service {
|
|||
service.WebService = NewWebService(service)
|
||||
service.Index = index.NewFragmentContainer()
|
||||
service.Hold = hold.NewHolder()
|
||||
service.version = "0.0.19"
|
||||
service.version = "0.0.20"
|
||||
service.name = "Cruncher"
|
||||
service.PrepareLogging()
|
||||
fmt.Printf("Pilosa %s\n", service.version)
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ func (self *Brand) cache_it(bm IBitmap, bitmap_id uint64, category uint64) {
|
|||
if bm.Count() >= self.threshold_value {
|
||||
self.bitmap_cache[bitmap_id] = &Rank{&Pair{bitmap_id, bm.Count()}, bm, category}
|
||||
if len(self.bitmap_cache) > self.threshold_length {
|
||||
log.Printf("RANK: %d %d", len(self.bitmap_cache), self.threshold_length)
|
||||
self.Rank()
|
||||
self.trim()
|
||||
}
|
||||
|
|
@ -302,7 +303,13 @@ func (self *Brand) getFileName() string {
|
|||
|
||||
func (self *Brand) Persist() error {
|
||||
log.Println("Brand Persist:", self.getFileName())
|
||||
self.storage.FlushBatch()
|
||||
asize := len(self.bitmap_cache)
|
||||
|
||||
if asize == 0 {
|
||||
log.Println("Nothing to save %s", self.getFileName())
|
||||
return nil
|
||||
}
|
||||
w, err := util.Create(self.getFileName())
|
||||
if err != nil {
|
||||
log.Println("Error opening outfile %s", self.getFileName())
|
||||
|
|
@ -312,7 +319,6 @@ func (self *Brand) Persist() error {
|
|||
defer w.Close()
|
||||
defer self.storage.Close()
|
||||
|
||||
asize := len(self.bitmap_cache)
|
||||
var list RankList
|
||||
for k, item := range self.bitmap_cache {
|
||||
list = append(list, &Rank{&Pair{k, item.bitmap.Count()}, item.bitmap, item.category})
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@ type Storage interface {
|
|||
StoreBlock(id int64, db string, frame string, slice int, filter uint64, chunk int64, block_index int32, block int64) error
|
||||
BeginBatch()
|
||||
EndBatch()
|
||||
FlushBatch()
|
||||
Close()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ func (self *CassandraStorage) runBatch(batch *gocql.Batch) {
|
|||
}
|
||||
func (self *CassandraStorage) FlushBatch() {
|
||||
start := time.Now()
|
||||
go self.runBatch(self.batch) //maybe this is crazy but i'll give it a whirl
|
||||
self.runBatch(self.batch) //maybe this is crazy but i'll give it a whirl
|
||||
self.batch = nil
|
||||
self.batch_time = time.Now()
|
||||
self.batch_counter = 0
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ func (c *MemoryStorage) Close() {
|
|||
}
|
||||
func (c *MemoryStorage) EndBatch() {
|
||||
}
|
||||
func (c *MemoryStorage) FlushBatch() {
|
||||
}
|
||||
func (c *MemoryStorage) Fetch(bitmap_id uint64, db string, frame string, slice int) (IBitmap, uint64) {
|
||||
// log.Println("hello")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue