( shard int, conn net2.ManagedConn, connErr error, keys []string, resultsChannel chan map[string]GetResponse)
| 80 | } |
| 81 | |
| 82 | func (c *ShardedClient) getMultiHelper( |
| 83 | shard int, |
| 84 | conn net2.ManagedConn, |
| 85 | connErr error, |
| 86 | keys []string, |
| 87 | resultsChannel chan map[string]GetResponse) { |
| 88 | |
| 89 | var results map[string]GetResponse |
| 90 | if shard == -1 { |
| 91 | results = make(map[string]GetResponse) |
| 92 | for _, key := range keys { |
| 93 | results[key] = NewGetErrorResponse(key, c.unmappedError(key)) |
| 94 | } |
| 95 | } else if connErr != nil { |
| 96 | results = make(map[string]GetResponse) |
| 97 | for _, key := range keys { |
| 98 | results[key] = NewGetErrorResponse( |
| 99 | key, |
| 100 | c.connectionError(shard, connErr)) |
| 101 | } |
| 102 | } else if conn == nil { |
| 103 | results = make(map[string]GetResponse) |
| 104 | for _, key := range keys { |
| 105 | // NOTE: zero is an invalid version id. |
| 106 | results[key] = NewGetResponse(key, StatusKeyNotFound, 0, nil, 0) |
| 107 | } |
| 108 | } else { |
| 109 | client := c.builder(shard, conn) |
| 110 | defer c.release(client, conn) |
| 111 | |
| 112 | results = client.GetMulti(keys) |
| 113 | if client.IsValidState() { |
| 114 | getOkByAddr.Add(conn.Key().Address, 1) |
| 115 | } else { |
| 116 | getErrByAddr.Add(conn.Key().Address, 1) |
| 117 | } |
| 118 | } |
| 119 | resultsChannel <- results |
| 120 | } |
| 121 | |
| 122 | // See Client interface for documentation. |
| 123 | func (c *ShardedClient) GetMulti(keys []string) map[string]GetResponse { |
no test coverage detected