MCPcopy
hub / github.com/dropbox/godropbox / GetAllShards

Method GetAllShards

memcache/base_shard_manager.go:283–299  ·  view source on GitHub ↗

See ShardManager interface for documentation.

()

Source from the content-addressed store, hash-verified

281
282// See ShardManager interface for documentation.
283func (m *BaseShardManager) GetAllShards() map[int]net2.ManagedConn {
284 results := make(map[int]net2.ManagedConn)
285
286 m.rwMutex.RLock()
287 defer m.rwMutex.RUnlock()
288
289 for i, state := range m.shardStates {
290 conn, err := m.pool.Get("tcp", state.Address)
291 if err != nil {
292 m.logError(err)
293 conn = nil
294 }
295 results[i] = conn
296 }
297
298 return results
299}
300
301func (m *BaseShardManager) fillEntryWithConnection(address string, entry *ShardMapping) {
302 conn, err := m.pool.Get("tcp", address)

Callers

nothing calls this directly

Calls 3

RLockMethod · 0.65
RUnlockMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected