RegisterFlags adds the flags required to config this to the given FlagSet.
(prefix string, f *flag.FlagSet)
| 27 | |
| 28 | // RegisterFlags adds the flags required to config this to the given FlagSet. |
| 29 | func (cfg *PartitionRingConfig) RegisterFlags(prefix string, f *flag.FlagSet) { |
| 30 | cfg.KVStore.Store = "memberlist" // Override default value. |
| 31 | cfg.KVStore.RegisterFlagsWithPrefix(prefix+".partition-ring.", "collectors/", f) |
| 32 | |
| 33 | f.IntVar(&cfg.MinOwnersCount, prefix+".partition-ring.min-partition-owners-count", 1, "Minimum number of owners to wait before a PENDING partition gets switched to ACTIVE.") |
| 34 | f.DurationVar(&cfg.MinOwnersDuration, prefix+".partition-ring.min-partition-owners-duration", 10*time.Second, "How long the minimum number of owners are enforced before a PENDING partition gets switched to ACTIVE.") |
| 35 | f.DurationVar(&cfg.DeleteInactivePartitionAfter, prefix+".partition-ring.delete-inactive-partition-after", 13*time.Hour, "How long to wait before an INACTIVE partition is eligible for deletion. The partition is deleted only if it has been in INACTIVE state for at least the configured duration and it has no owners registered. A value of 0 disables partitions deletion.") |
| 36 | } |
| 37 | |
| 38 | func (cfg *PartitionRingConfig) ToLifecyclerConfig(partitionID int32, instanceID string) ring.PartitionInstanceLifecyclerConfig { |
| 39 | return ring.PartitionInstanceLifecyclerConfig{ |
nothing calls this directly
no test coverage detected