code: func (m *BaseShardManager) GetShardsForItems(
  	items []*Item) map[int]*ShardMapping {
  
  	m.rwMutex.RLock()
  	defer m.rwMutex.RUnlock()
  
  	numShards := len(m.shardStates)
  	results := make(map[int]*ShardMapping)
  
  	for _, item := range items {
  		shardId := m.getShardId(item.Key, numShards)
  
  		entry, inMap := results[shardId]
  		if !inMap {
  			entry = &ShardMapping{}
  			if shardId != -1 {
  				state := m.shardStates[shardId]
  				if state.State == ActiveServer {
  					m.fillEntryWithConnection(state.Address, entry)
  				} else {
  					connSkippedByAddr.Add(state.Address, 1)
  				}
  			}
  			entry.Items = make([]*Item, 0, 1)
  			entry.Keys = make([]string, 0, 1)
  			results[shardId] = entry
  		}
  		entry.Items = append(entry.Items, item)
  		entry.Keys = append(entry.Keys, item.Key)
  	}
  
  	return results
  }
docs: // See ShardManager interface for documentation.