Skip to content

Commit

Permalink
fmt the new Kafka consumer/producer code
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis-Etienne Dorval committed Feb 22, 2019
1 parent cbbd319 commit 82f14b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/ingester/app/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (o *Options) InitFromViper(v *viper.Viper) {
o.GroupID = v.GetString(KafkaConsumerConfigPrefix + SuffixGroupID)
o.Encoding = v.GetString(KafkaConsumerConfigPrefix + SuffixEncoding)

if brokers := v.GetString(DeprecatedKafkaConfigPrefix+SuffixBrokers); brokers != "" {
if brokers := v.GetString(DeprecatedKafkaConfigPrefix + SuffixBrokers); brokers != "" {
fmt.Printf("WARNING: found deprecated option %s, please use %s instead\n",
DeprecatedKafkaConfigPrefix+SuffixBrokers,
KafkaConsumerConfigPrefix+SuffixBrokers,
Expand Down
2 changes: 1 addition & 1 deletion cmd/ingester/app/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ func TestOptionsWithAllFlags(t *testing.T) {
assert.Equal(t, []string{"127.0.0.1:9092", "0.0.0:1234"}, o.Brokers)
assert.Equal(t, "group1", o.GroupID)
assert.Equal(t, kafka.EncodingProto, o.Encoding)
}
}
12 changes: 6 additions & 6 deletions plugin/storage/kafka/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ const (
// EncodingZipkinThrift is used for spans encoded as Zipkin Thrift.
EncodingZipkinThrift = "zipkin-thrift"

configPrefix = "kafka.producer"
deprecatedPrefix = "kafka"
suffixBrokers = ".brokers"
suffixTopic = ".topic"
suffixEncoding = ".encoding"
configPrefix = "kafka.producer"
deprecatedPrefix = "kafka"
suffixBrokers = ".brokers"
suffixTopic = ".topic"
suffixEncoding = ".encoding"

defaultBroker = "127.0.0.1:9092"
defaultTopic = "jaeger-spans"
Expand Down Expand Up @@ -94,7 +94,7 @@ func (opt *Options) InitFromViper(v *viper.Viper) {
opt.topic = v.GetString(configPrefix + suffixTopic)
opt.encoding = v.GetString(configPrefix + suffixEncoding)

if brokers := v.GetString(deprecatedPrefix+suffixBrokers); brokers != "" {
if brokers := v.GetString(deprecatedPrefix + suffixBrokers); brokers != "" {
fmt.Printf("WARNING: found deprecated option %s, please use %s instead\n",
deprecatedPrefix+suffixBrokers,
configPrefix+suffixBrokers,
Expand Down
2 changes: 1 addition & 1 deletion plugin/storage/kafka/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ func TestOptionsWithAllFlags(t *testing.T) {
assert.Equal(t, "topic1", opts.topic)
assert.Equal(t, []string{"127.0.0.1:9092", "0.0.0:1234"}, opts.config.Brokers)
assert.Equal(t, "protobuf", opts.encoding)
}
}

0 comments on commit 82f14b7

Please sign in to comment.