Skip to content

Commit

Permalink
Merge branch 'main' of github.com:splitio/go-client into development
Browse files Browse the repository at this point in the history
  • Loading branch information
mmelograno committed Oct 12, 2022
2 parents 9e84c02 + 6de5840 commit e02c865
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 142 deletions.
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
6.1.8 (Sep 9, 2022)
- Updated BooleanMatcher logging: demoted the log message to "warning".

6.1.7 (Sep 8, 2022)
- Replaced murmur3 32 library.

6.1.6 (June 21, 2022)
- Updated the synchronization flow to be more reliable in the event of an edge case generating delay in cache purge propagation, keeping the SDK cache properly synced.

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/splitio/go-client/v6
go 1.13

require (
github.com/splitio/go-split-commons/v4 v4.1.0
github.com/splitio/go-toolkit/v5 v5.2.0
github.com/splitio/go-split-commons/v4 v4.1.3
github.com/splitio/go-toolkit/v5 v5.2.1
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/splitio/go-split-commons/v4 v4.1.0 h1:bERGPdxHbjPFRy0SCiwqZzPRo51hleP3yHpzuPimlDQ=
github.com/splitio/go-split-commons/v4 v4.1.0/go.mod h1:ycM23TPERljz7Anp6W4nwxPNoaIqY2d4n/UWYV0V0PE=
github.com/splitio/go-toolkit/v5 v5.2.0 h1:9bej4sMHVdcc+aB8IXQYEK9OjJ44H/jYFYRkbRwKsu4=
github.com/splitio/go-toolkit/v5 v5.2.0/go.mod h1:SYi/svhhtEgdMSb5tNcDcMjOSUH/7XVkvjp5dPL+nBE=
github.com/splitio/go-split-commons/v4 v4.1.3 h1:Aal1SF4GvmSP25P29oSLL6N9UMUhvFN/LURIxX2rACk=
github.com/splitio/go-split-commons/v4 v4.1.3/go.mod h1:E6yZiXwcjOdV5B7pHrBDbCsl4ju1YgYokRISZ9bYjgY=
github.com/splitio/go-toolkit/v5 v5.2.1 h1:WiAu7DD4Rl+Ly7Yz/8IDjhqAIySnlXlH6d7cG9KgoOY=
github.com/splitio/go-toolkit/v5 v5.2.1/go.mod h1:SYi/svhhtEgdMSb5tNcDcMjOSUH/7XVkvjp5dPL+nBE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
2 changes: 1 addition & 1 deletion splitio/conf/sdkconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func Default() *SplitSdkConfig {
SdkURL: "",
StreamingServiceURL: "",
TelemetryServiceURL: "",
HTTPTimeout: 0,
HTTPTimeout: defaultHTTPTimeout,
ImpressionListener: nil,
SegmentQueueSize: 500,
SegmentWorkers: 10,
Expand Down
3 changes: 2 additions & 1 deletion splitio/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/splitio/go-client/v6/splitio/engine/evaluator/impressionlabels"
"github.com/splitio/go-client/v6/splitio/engine/grammar"
"github.com/splitio/go-client/v6/splitio/engine/hash"
"github.com/splitio/go-toolkit/v5/hasher"
"github.com/splitio/go-toolkit/v5/logging"
)

Expand Down Expand Up @@ -53,7 +54,7 @@ func (e *Engine) calculateBucket(algo int, bucketingKey string, seed int64) int
var hashedKey uint32
switch algo {
case grammar.SplitAlgoMurmur:
hashedKey = hash.Murmur3_32([]byte(bucketingKey), uint32(seed))
hashedKey = hasher.Sum32WithSeed([]byte(bucketingKey), uint32(seed))
case grammar.SplitAlgoLegacy:
fallthrough
default:
Expand Down
5 changes: 3 additions & 2 deletions splitio/engine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (
"github.com/splitio/go-client/v6/splitio/engine/grammar"
"github.com/splitio/go-client/v6/splitio/engine/hash"
"github.com/splitio/go-split-commons/v4/dtos"
"github.com/splitio/go-toolkit/v5/hasher"
"github.com/splitio/go-toolkit/v5/logging"
)

func TestProperHashFunctionIsUsed(t *testing.T) {
eng := Engine{}

murmurHash := hash.Murmur3_32([]byte("SOME_TEST"), 12345)
murmurHash := hasher.Sum32WithSeed([]byte("SOME_TEST"), 12345)
murmurBucket := int(math.Abs(float64(murmurHash%100)) + 1)
if murmurBucket != eng.calculateBucket(2, "SOME_TEST", 12345) {
t.Error("Incorrect hash!")
Expand All @@ -32,7 +33,7 @@ func TestProperHashFunctionIsUsed(t *testing.T) {
func TestProperHashFunctionIsUsedWithConstants(t *testing.T) {
eng := Engine{}

murmurHash := hash.Murmur3_32([]byte("SOME_TEST"), 12345)
murmurHash := hasher.Sum32WithSeed([]byte("SOME_TEST"), 12345)
murmurBucket := int(math.Abs(float64(murmurHash%100)) + 1)
if murmurBucket != eng.calculateBucket(grammar.SplitAlgoMurmur, "SOME_TEST", 12345) {
t.Error("Incorrect hash!")
Expand Down
3 changes: 2 additions & 1 deletion splitio/engine/grammar/matchers/boolean.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package matchers

import (
"fmt"
"reflect"
"strconv"
"strings"
Expand All @@ -16,7 +17,7 @@ type BooleanMatcher struct {
func (m *BooleanMatcher) Match(key string, attributes map[string]interface{}, bucketingKey *string) bool {
matchingKey, err := m.matchingKey(key, attributes)
if err != nil {
m.logger.Error("BooleanMatcher: Couldn't parse matching key to a boolean")
m.logger.Warning(fmt.Sprintf("BooleanMatcher: %s", err.Error()))
return false
}

Expand Down
66 changes: 0 additions & 66 deletions splitio/engine/hash/murmur.go

This file was deleted.

64 changes: 0 additions & 64 deletions splitio/engine/hash/murmur_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion splitio/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package splitio

// Version contains a string with the split sdk version
const Version = "6.1.6"
const Version = "6.1.8"

0 comments on commit e02c865

Please sign in to comment.