Skip to content

Commit

Permalink
Merge pull request #34 from heetch/add-murmur2-partitioner
Browse files Browse the repository at this point in the history
  • Loading branch information
sixstone-qq committed May 7, 2021
2 parents 55f7085 + 8760cda commit 51e52b5
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 43 deletions.
9 changes: 5 additions & 4 deletions consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ func parseConsumerPartitioners(ps []string, defaultPartitioner sarama.Partitione
switch p {
case "all":
cp.all = true
case "sarama", "std":
case "murmur2", "sarama", "std":
cp.partitioners = append(cp.partitioners, partitionerFunc(partitioners[p]))
default:
return nil, fmt.Errorf("unknown partitioner %q", p)
Expand Down Expand Up @@ -575,9 +575,10 @@ clients may have chosen. This is specified with the "-partitioners" flag,
which should be set to all the possible partitioners used by producers
to the topic. Possible partitioners are:
sarama - used by default with the Sarama Go client.
std - used by the Java clients
all - all partitions will be read
murmur2 - used by default on Java clients
sarama - used by default with the Sarama Go client. (Default)
std - used by Java clients
all - all partitions will be tried
As the number of partitions can change over time, this technique will
only work correctly if they haven't changed over the range of messages
Expand Down
2 changes: 1 addition & 1 deletion consume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,8 @@ func (reg *testRegistry) fakeServerHandler(w http.ResponseWriter, r *http.Reques
panic(err)
}
}
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "application/vnd.schemaregistry.v1+json")
w.WriteHeader(http.StatusOK)
w.Write(body)
}

Expand Down
21 changes: 12 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
module github.com/heetch/hkt

require (
github.com/Shopify/sarama v1.24.0
github.com/frankban/quicktest v1.10.0
github.com/google/go-cmp v0.4.0
github.com/heetch/avro v0.2.6
github.com/klauspost/cpuid v1.2.3 // indirect
github.com/linkedin/goavro/v2 v2.9.7
github.com/rogpeppe/go-internal v1.5.2
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
github.com/Shopify/sarama v1.28.0
github.com/avast/retry-go v3.0.0+incompatible // indirect
github.com/burdiyan/kafkautil v0.0.0-20190131162249-eaf83ed22d5b
github.com/frankban/quicktest v1.12.1
github.com/google/go-cmp v0.5.5
github.com/heetch/avro v0.2.7
github.com/linkedin/goavro/v2 v2.10.0
github.com/lovoo/goka v1.0.6 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rogpeppe/go-internal v1.8.0
golang.org/x/crypto v0.0.0-20210505212654-3497b51f5e64
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
gopkg.in/retry.v1 v1.0.3
)

Expand Down
Loading

0 comments on commit 51e52b5

Please sign in to comment.