Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Sarama to version 1.30.0 #715

Merged
merged 2 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: get update fmt lint test

GO := GO111MODULE=on GOPRIVATE=github.com/linkedin GOSUMDB=off go
GO := GO111MODULE=on GOSUMDB=off go
GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG)
GOTEST := $(GO) test -gcflags='-l' -p 3 -v -race

Expand Down
43 changes: 3 additions & 40 deletions core/internal/helpers/sarama.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,9 @@ import (
"github.com/stretchr/testify/mock"
)

var kafkaVersions = map[string]sarama.KafkaVersion{
"": sarama.V0_10_2_0,
"0.8.0": sarama.V0_8_2_0,
"0.8.1": sarama.V0_8_2_1,
"0.8.2": sarama.V0_8_2_2,
"0.8": sarama.V0_8_2_0,
"0.9.0.0": sarama.V0_9_0_0,
"0.9.0.1": sarama.V0_9_0_1,
"0.9.0": sarama.V0_9_0_0,
"0.9": sarama.V0_9_0_0,
"0.10.0.0": sarama.V0_10_0_0,
"0.10.0.1": sarama.V0_10_0_1,
"0.10.0": sarama.V0_10_0_0,
"0.10.1.0": sarama.V0_10_1_0,
"0.10.1": sarama.V0_10_1_0,
"0.10.2.0": sarama.V0_10_2_0,
"0.10.2.1": sarama.V0_10_2_0,
"0.10.2": sarama.V0_10_2_0,
"0.10": sarama.V0_10_0_0,
"0.11.0.1": sarama.V0_11_0_0,
"0.11.0.2": sarama.V0_11_0_0,
"0.11.0": sarama.V0_11_0_0,
"1.0.0": sarama.V1_0_0_0,
"1.1.0": sarama.V1_1_0_0,
"1.1.1": sarama.V1_1_0_0,
"2.0.0": sarama.V2_0_0_0,
"2.0.1": sarama.V2_0_0_0,
"2.1.0": sarama.V2_1_0_0,
"2.2.0": sarama.V2_2_0_0,
"2.2.1": sarama.V2_2_0_0,
"2.3.0": sarama.V2_3_0_0,
"2.4.0": sarama.V2_4_0_0,
"2.5.0": sarama.V2_5_0_0,
"2.6.0": sarama.V2_6_0_0,
"2.7.0": sarama.V2_7_0_0,
}

func parseKafkaVersion(kafkaVersion string) sarama.KafkaVersion {
version, ok := kafkaVersions[kafkaVersion]
if !ok {
version, err := sarama.ParseKafkaVersion(kafkaVersion)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be helpful to include the error in the message so folks know what is wrong?

panic("Unknown Kafka Version: " + kafkaVersion)
}

Expand All @@ -82,7 +45,7 @@ func GetSaramaConfigFromClientProfile(profileName string) *sarama.Config {
}

viper.SetDefault(configRoot+".client-id", "burrow-lagchecker")
viper.SetDefault(configRoot+".kafka-version", "0.8")
viper.SetDefault(configRoot+".kafka-version", "2.8.0")

saramaConfig := sarama.NewConfig()
saramaConfig.ClientID = viper.GetString(configRoot + ".client-id")
Expand Down
84 changes: 54 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,45 +1,69 @@
module github.com/linkedin/Burrow

go 1.17

require (
github.com/OneOfOne/xxhash v1.2.8
github.com/Shopify/sarama v1.28.0
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20210202160940-bed99a852dfe // indirect
github.com/Shopify/sarama v1.30.0
github.com/julienschmidt/httprouter v1.3.0
github.com/karrick/goswarm v1.10.0
github.com/magiconair/properties v1.8.4 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/pborman/uuid v1.2.1
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/common v0.17.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/prometheus/client_golang v1.11.0
github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414
github.com/smartystreets/assertions v1.2.0 // indirect
github.com/spf13/afero v1.5.1 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/viper v1.9.0
github.com/stretchr/testify v1.7.0
github.com/xdg/scram v1.0.3
go.uber.org/zap v1.19.1
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/natefinch/lumberjack.v2 v2.0.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/eapache/go-resiliency v1.2.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.31.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.1
github.com/stretchr/objx v0.3.0 // indirect
github.com/stretchr/testify v1.7.0
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
golang.org/x/mod v0.4.1 // indirect
golang.org/x/net v0.0.0-20210222171744-9060382bd457 // indirect
golang.org/x/sys v0.0.0-20210223212115-eede4237b368 // indirect
google.golang.org/protobuf v1.25.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/xdg/stringprep v1.0.3 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b // indirect
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/ini.v1 v1.63.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
honnef.co/go/tools v0.1.1 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

go 1.16
Loading