| | |
| | | |
| | | "basic.com/pubsub/cache.git/esutil" |
| | | "basic.com/pubsub/cache.git/shardmap" |
| | | "test/cache/esutil" |
| | | "test/cache/shardmap" |
| | | |
| | | "basic.com/valib/gosdk.git" |
| | | ) |
| | |
| | | fmt.Println() |
| | | } |
| | | |
| | | //func main(){ |
| | | // Init() |
| | | // Getdbpersonmsg("") |
| | | //} |
| | | func Getdbpersonmsg(tableid string, teststring []byte, IsCompare bool) (map[string]float32) { |
| | | |
| | | func Getdbpersonmsg(tableid string, teststring []byte, IsCompare bool) ([]byte) { |
| | | |
| | | var buf []byte |
| | | totalmap := make(map[string]float32) |
| | | |
| | | if !IsCompare { |
| | | return nil |
| | |
| | | } |
| | | |
| | | if tableid == "" { |
| | | for _, val := range Cmap.cam{ |
| | | tmpbuf := val.Walk(Printest, teststring) |
| | | buf =append(buf, tmpbuf...) |
| | | for id, val := range Cmap.cam{ |
| | | fmt.Println("the id is: ", id) |
| | | tmpmap := val.Walk(Printest, teststring) |
| | | for key, sec := range tmpmap { |
| | | totalmap[key] = sec |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | |
| | | for id, value := range Cmap.cam{ |
| | | if id == tableid{ |
| | | fmt.Println(id) |
| | | buf =value.Walk(Printest, teststring) |
| | | fmt.Println("the id is: ", id) |
| | | tmpmap :=value.Walk(Printest, teststring) |
| | | for key, sec := range tmpmap { |
| | | totalmap[key]= sec |
| | | } |
| | | break |
| | | } |
| | | } |
| | |
| | | |
| | | firsttime := time.Now() |
| | | fmt.Println(time.Since(firsttime)) |
| | | return buf |
| | | return totalmap |
| | | } |
| | | |
| | | func Printest(ci []byte, co string ) (float32){ |