mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-06 19:07:50 +00:00
adusted cas batch; removed panics
This commit is contained in:
parent
515f6ce181
commit
6b8428f64c
5 changed files with 27 additions and 20 deletions
14
core/etcd.go
14
core/etcd.go
|
|
@ -105,15 +105,13 @@ func getLightestProcess(m map[string]int) (Pair, error) {
|
|||
}
|
||||
|
||||
func (self *TopologyMapper) MakeFragments(db string, slice_int int) error {
|
||||
/*
|
||||
frames_to_create := config.GetStringArrayDefault("supported_frames", []string{"b.n", "l.n", "t.t", "d"})
|
||||
for _, frame := range frames_to_create {
|
||||
err := self.AllocateFragment(db, frame, slice_int)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
frames_to_create := config.GetStringArrayDefault("supported_frames", []string{"b.n", "l.n", "t.t", "d"})
|
||||
for _, frame := range frames_to_create {
|
||||
err := self.AllocateFragment(db, frame, slice_int)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
*/
|
||||
}
|
||||
return nil
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ func (self *WebService) HandleStats(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := encoder.Encode(m)
|
||||
if err != nil {
|
||||
panic("Error encoding stats")
|
||||
log.Fatal("Error encoding stats")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -483,7 +483,7 @@ func (self *WebService) HandleProcesses(w http.ResponseWriter, r *http.Request)
|
|||
processes := self.service.ProcessMap.GetMetadata()
|
||||
err := encoder.Encode(processes)
|
||||
if err != nil {
|
||||
panic("Error encoding stats")
|
||||
http.Error(w, "Error Encoding", http.StatusBadRequest)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,12 +123,15 @@ func (self *CassandraStorage) FlushBatch() {
|
|||
func (self *CassandraStorage) EndBatch() {
|
||||
start := time.Now()
|
||||
if self.batch != nil {
|
||||
last := time.Since(self.batch_time)
|
||||
if last.Seconds() > self.cass_time_window_secs {
|
||||
self.FlushBatch()
|
||||
} else if self.batch_counter > self.cass_flush_size {
|
||||
self.FlushBatch()
|
||||
}
|
||||
self.FlushBatch()
|
||||
/*
|
||||
last := time.Since(self.batch_time)
|
||||
if last.Seconds() > self.cass_time_window_secs {
|
||||
self.FlushBatch()
|
||||
} else if self.batch_counter > self.cass_flush_size {
|
||||
self.FlushBatch()
|
||||
}
|
||||
*/
|
||||
} else {
|
||||
log.Println("NIL BATCH")
|
||||
}
|
||||
|
|
@ -161,7 +164,7 @@ func (self *CassandraStorage) Store(id int64, db string, frame string, slice int
|
|||
|
||||
func (self *CassandraStorage) StoreBlock(id int64, db string, frame string, slice int, filter uint64, chunk int64, block_index int32, block int64) error {
|
||||
if self.batch == nil {
|
||||
panic("NIL BATCH")
|
||||
self.BeginBatch()
|
||||
}
|
||||
start := time.Now()
|
||||
self.batch.Query(self.stmt, id, db, frame, slice, int(filter), chunk, block_index, block)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package query
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"pilosa/util"
|
||||
"strconv"
|
||||
|
||||
|
|
@ -199,8 +200,9 @@ ArgLoop:
|
|||
}
|
||||
}
|
||||
default:
|
||||
spew.Dump("unexpected", token)
|
||||
panic(token)
|
||||
|
||||
log.Println(spew.Sdump("unexpected", token))
|
||||
return nil, errors.New("BAD TOKEN")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,14 @@ package query
|
|||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"math/rand"
|
||||
"pilosa/db"
|
||||
"pilosa/util"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
)
|
||||
|
||||
type PortableQueryStep interface {
|
||||
|
|
@ -390,7 +393,8 @@ func (qp *QueryPlanner) buildTree(query *Query, slice int) (QueryTree, error) {
|
|||
tree = &IntersectQueryTree{subqueries: subqueries}
|
||||
} else {
|
||||
//TODO return error gracefully
|
||||
panic("invalid operation")
|
||||
log.Println(spew.Sdump(query))
|
||||
return nil, errors.New("BuildTree Issues")
|
||||
}
|
||||
}
|
||||
return tree, nil
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue