diff --git a/core/etcd.go b/core/etcd.go index 72faba57f..78f01e1aa 100644 --- a/core/etcd.go +++ b/core/etcd.go @@ -257,7 +257,7 @@ func (self *TopologyMapper) handlenode(node *etcd.Node) error { process = db.NewProcess(&process_uuid) fragment.SetProcess(process) - if self.service.Id.String() == process_uuid.String() { + if util.Equal(self.service.Id, &process_uuid) { self.service.Index.AddFragment(bits[1], bits[3], slice_int, fragment_id) } diff --git a/core/http.go b/core/http.go index 9afd98fe8..2ddba6b35 100644 --- a/core/http.go +++ b/core/http.go @@ -26,6 +26,7 @@ import ( notify "github.com/bitly/go-notify" "github.com/davecgh/go-spew/spew" "github.com/gorilla/websocket" + // _ "net/http/pprof" ) type WebService struct { diff --git a/core/load.go b/core/load.go index 75b96ea67..8014a517e 100644 --- a/core/load.go +++ b/core/load.go @@ -67,7 +67,6 @@ func FromApiString(service *Service, db string, frame string, api_string string, } o := copy_raw(raw.Block) chunk := &index.Chunk{raw.Key, o} - println("KEY", raw.Key) bitmap.AddChunk(chunk) } diff --git a/core/query.go b/core/query.go index 4f295c15e..bb5964163 100644 --- a/core/query.go +++ b/core/query.go @@ -231,6 +231,9 @@ func (self *Service) CatQueryStepHandler(msg *db.Message) { var e struct{} for _, pair := range val.Pairs { //merge_map[pair.Key] += pair.Count + if pair.Key == 0 { + continue //skip + } merge_map[pair.Key] += pair.Count mm, ok := slice_map[pair.Key] if !ok { @@ -267,6 +270,9 @@ func (self *Service) CatQueryStepHandler(msg *db.Message) { } else if return_type == "pair-list" { rank_list := make(index.RankList, 0, len(merge_map)) for k, v := range merge_map { + if k == 0 || v == 0 { + continue //shouldn't be getting 0 keys or values anyway + } rank := new(index.Rank) rank.Pair = &index.Pair{k, v} rank_list = append(rank_list, rank) diff --git a/index/brand.go b/index/brand.go index cfc4a2d0a..aef2add23 100644 --- a/index/brand.go +++ b/index/brand.go @@ -244,6 +244,7 @@ func dump(r RankList, n int) { } func (self *Brand) TopNAll(n int, categories []uint64) []Pair { + log.Trace("TopNAll") self.checkRank() results := make([]Pair, 0, 0) diff --git a/index/storage_cass.go b/index/storage_cass.go index 599306b2f..ddf23f102 100644 --- a/index/storage_cass.go +++ b/index/storage_cass.go @@ -44,10 +44,12 @@ func init() { func BuildSchema() { /* - "CREATE KEYSPACE IF NOT EXISTS pilosa WITH strategy_class = SimpleStrategy AND strategy_options:replication_factor = 1" - create keyspace if not exists pilosa with replication = {'class': 'SimpleStrategy', 'replication_factor' : 1} and durable_writes = true; - CREATE TABLE IF NOT EXISTS bitmap (bitmap_id bigint, db varchar, frame varchar, slice int, filter int, chunkkey bigint, blockindex int, block bigint, PRIMARY KEY ((bitmap_id, db, frame, slice), chunkkey, blockindex) ) - " + "CREATE KEYSPACE IF NOT EXISTS pilosa WITH strategy_class = SimpleStrategy AND strategy_options:replication_factor = 1" + create keyspace if not exists pilosa with replication = {'class': 'SimpleStrategy', 'replication_factor' : 1} and durable_writes = true; + CREATE KEYSPACE pilosa WITH replication = {'class': 'NetworkTopologyStrategy', 'pilpang': '2'} AND durable_writes = true; + + CREATE TABLE IF NOT EXISTS bitmap (bitmap_id bigint, db varchar, frame varchar, slice int, filter int, chunkkey bigint, blockindex int, block bigint, PRIMARY KEY ((bitmap_id, db, frame, slice), chunkkey, blockindex) ) + " */ }