New creates a new distributed consistent hash ring. It shadows the cortex ring.New method so we can use our own replication strategy for repl factor = 2
(cfg ring.Config, name, key string, reg prometheus.Registerer)
| 20 | // New creates a new distributed consistent hash ring. It shadows the cortex |
| 21 | // ring.New method so we can use our own replication strategy for repl factor = 2 |
| 22 | func New(cfg ring.Config, name, key string, reg prometheus.Registerer) (*ring.Ring, error) { |
| 23 | reg = prometheus.WrapRegistererWithPrefix("tempo_", reg) |
| 24 | |
| 25 | statReplicationFactor.Set(int64(cfg.ReplicationFactor)) |
| 26 | statKvStore.Set(cfg.KVStore.Store) |
| 27 | |
| 28 | if cfg.ReplicationFactor == 2 { |
| 29 | return newEventuallyConsistentRing(cfg, name, key, reg) |
| 30 | } |
| 31 | |
| 32 | return ring.New(cfg, name, key, log.Logger, reg) |
| 33 | } |
| 34 | |
| 35 | func newEventuallyConsistentRing(cfg ring.Config, name, key string, reg prometheus.Registerer) (*ring.Ring, error) { |
| 36 | codec := ring.GetCodec() |
nothing calls this directly
no test coverage detected