Skip to content

Commit

Permalink
Migrate github.com/spaolacci/murmur3 to github.com/twmb/murmur3 (#2539)
Browse files Browse the repository at this point in the history
* WIP: migrate github.com/spaolacci/murmur3 to github.com/twmb/murmur3

* Remove murmur3 test, which is not needed going forward
  • Loading branch information
andrewmains12 authored Aug 27, 2020
1 parent 98e9269 commit 99477fc
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ require (
github.com/satori/go.uuid v1.2.0
github.com/sergi/go-diff v1.1.0
github.com/shirou/gopsutil v2.20.5+incompatible // indirect
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72
github.com/spf13/cast v1.3.1-0.20190531151931-f31dc0aaab5a // indirect
github.com/spf13/cobra v0.0.3
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand All @@ -103,6 +102,7 @@ require (
github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25 // indirect
github.com/stretchr/testify v1.4.0
github.com/subosito/gotenv v1.2.1-0.20190917103637-de67a6614a4d // indirect
github.com/twmb/murmur3 v1.1.3
github.com/twotwotwo/sorts v0.0.0-20160814051341-bf5c1f2b8553
github.com/uber-go/atomic v0.0.0-00010101000000-000000000000 // indirect
github.com/uber-go/tally v3.3.13+incompatible
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKw
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/twmb/murmur3 v1.1.3 h1:D83U0XYKcHRYwYIpBKf3Pks91Z0Byda/9SJ8B6EMRcA=
github.com/twmb/murmur3 v1.1.3/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
github.com/twotwotwo/sorts v0.0.0-20160814051341-bf5c1f2b8553 h1:DRC1ubdb3ZmyyIeCSTxjZIQAnpLPfKVgYrLETQuOPjo=
github.com/twotwotwo/sorts v0.0.0-20160814051341-bf5c1f2b8553/go.mod h1:Rj7Csq/tZ/egz+Ltc2IVpsA5309AmSMEswjkTZmq2Xc=
github.com/uber-go/tally v3.3.13+incompatible h1:5ic2UsDwjcWsw9jvEdWEE2XsmGCLMTt5Ukg4d74fed4=
Expand Down
2 changes: 1 addition & 1 deletion src/aggregator/hash/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// were added.
package hash

import "github.com/spaolacci/murmur3"
import "github.com/twmb/murmur3"

// Hash128 is a 128-bit hash of an ID consisting of two unsigned 64-bit ints.
type Hash128 [2]uint64
Expand Down
2 changes: 1 addition & 1 deletion src/aggregator/sharding/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

"github.com/m3db/m3/src/metrics/metric/id"

"github.com/spaolacci/murmur3"
"github.com/twmb/murmur3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion src/dbnode/client/connection_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"github.com/m3db/m3/src/dbnode/topology"
xclose "github.com/m3db/m3/src/x/close"

"github.com/spaolacci/murmur3"
"github.com/twmb/murmur3"
"github.com/uber/tchannel-go/thrift"
"go.uber.org/zap"
)
Expand Down
Empty file.
5 changes: 2 additions & 3 deletions src/dbnode/sharding/shardset.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import (

"github.com/m3db/m3/src/cluster/shard"
"github.com/m3db/m3/src/x/ident"

"github.com/spaolacci/murmur3"
twmbmurmur3 "github.com/twmb/murmur3"
)

var (
Expand Down Expand Up @@ -161,6 +160,6 @@ func NewHashGenWithSeed(seed uint32) HashGen {
// NewHashFn generates a HashFN based on murmur32 with a given seed
func NewHashFn(length int, seed uint32) HashFn {
return func(id ident.ID) uint32 {
return murmur3.Sum32WithSeed(id.Bytes(), seed) % uint32(length)
return twmbmurmur3.SeedSum32(seed, id.Bytes()) % uint32(length)
}
}
1 change: 0 additions & 1 deletion src/dbnode/sharding/shardset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (

"github.com/m3db/m3/src/cluster/shard"
"github.com/m3db/m3/src/x/ident"

"github.com/stretchr/testify/require"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import (
"github.com/leanovate/gopter"
"github.com/leanovate/gopter/gen"
"github.com/leanovate/gopter/prop"
"github.com/spaolacci/murmur3"
"github.com/twmb/murmur3"
"github.com/stretchr/testify/require"
)

Expand Down

0 comments on commit 99477fc

Please sign in to comment.