From 0196375da4ee8e49de448856e0f959067f1f05d3 Mon Sep 17 00:00:00 2001 From: loveululu Date: Wed, 29 Sep 2021 15:59:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=EF=BC=9A=E5=81=8F?= =?UTF-8?q?=E7=A7=BB=E9=87=8F=E8=AE=BE=E7=BD=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/cube/cube-api/go-api/server.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/cube/cube-api/go-api/server.go b/core/cube/cube-api/go-api/server.go index 1cde8c7e..2c6c81d3 100644 --- a/core/cube/cube-api/go-api/server.go +++ b/core/cube/cube-api/go-api/server.go @@ -39,14 +39,14 @@ func (server *CubeServer) SplitKeys(keys []uint64) (splited_keys map[uint64]Inpu splited_keys = make(map[uint64]Input) offset = make(map[uint64][]uint64) - for _, key := range keys { + for i, key := range keys { shard_id := key % server.Shard temp_split, _ := splited_keys[shard_id] temp_split.Keys = append(temp_split.Keys, key) splited_keys[shard_id] = temp_split temp_offset, _ := offset[shard_id] - temp_offset = append(temp_offset, key) + temp_offset = append(temp_offset, uint64(i)) offset[shard_id] = temp_offset } @@ -73,9 +73,7 @@ func (server *CubeServer) Seek(input string, output_path string) (err error) { key_nums := len(temp_input.Keys) var output Output output.Values = make([]SingleValue, key_nums+1) - splited_keys, offset := server.SplitKeys(temp_input.Keys) - for shard_id, keys := range splited_keys { cur_output, _ := server.Post(shard_id, keys) for index, single_value := range cur_output.Values { -- GitLab