removed debug in load; fixed etcd processid compare

This commit is contained in:
Todd Gruben 2015-06-10 19:20:55 +00:00
parent 6bd377ebe2
commit 58247dabc5
6 changed files with 15 additions and 6 deletions

View file

@ -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)
}

View file

@ -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 {

View file

@ -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)
}

View file

@ -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)

View file

@ -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)

View file

@ -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) )
"
*/
}