| | |
| | | import ( |
| | | "sync" |
| | | "fmt" |
| | | |
| | | "basic.com/pubsub/protomsg.git" |
| | | ) |
| | | |
| | | const ( |
| | |
| | | } |
| | | |
| | | // modify by long. |
| | | func (s *ShardMap) Walk(wf wfOp, cfrom string) []interface{} { |
| | | func (s *ShardMap) Walk(wf wfOp, cfrom string) []protomsg.Baseinfo{ |
| | | var wg sync.WaitGroup |
| | | var second float32 |
| | | |
| | | var baseinfos []interface{} |
| | | var baseinfos []protomsg.Baseinfo |
| | | |
| | | for _, si := range s.shards { |
| | | wg.Add(1) |
| | |
| | | if second == -1 { |
| | | continue |
| | | } |
| | | fmt.Println("比对分数: ", second) |
| | | baseinfos = append(baseinfos, value ) |
| | | if info, ok := value.(protomsg.Baseinfo) ;ok { |
| | | fmt.Println("比对分数: ", second) |
| | | info.CompareScore = second |
| | | baseinfos = append(baseinfos,info) |
| | | } |
| | | } |
| | | s.RUnlock() |
| | | }(si,wf, cfrom) |
| | | |
| | | } |
| | | wg.Wait() |
| | | return baseinfos |