From 1f7cb20482b33f8ac0dea87cba9515d7d03e98c1 Mon Sep 17 00:00:00 2001 From: Jose Acevedo Date: Tue, 26 Nov 2024 15:45:22 -0500 Subject: [PATCH] Removed num_connections as it is ignored --- .../feast/onlinestore/cassandraonlinestore.go | 12 ------------ .../feast/onlinestore/cassandraonlinestore_test.go | 3 --- 2 files changed, 15 deletions(-) diff --git a/go/internal/feast/onlinestore/cassandraonlinestore.go b/go/internal/feast/onlinestore/cassandraonlinestore.go index d8ff636b86..5b6ffb8c55 100644 --- a/go/internal/feast/onlinestore/cassandraonlinestore.go +++ b/go/internal/feast/onlinestore/cassandraonlinestore.go @@ -43,7 +43,6 @@ type CassandraConfig struct { loadBalancingPolicy gocql.HostSelectionPolicy connectionTimeoutMillis int64 requestTimeoutMillis int64 - numConnections int } func extractCassandraConfig(onlineStoreConfig map[string]any) (*CassandraConfig, error) { @@ -159,14 +158,6 @@ func extractCassandraConfig(onlineStoreConfig map[string]any) (*CassandraConfig, } cassandraConfig.requestTimeoutMillis = int64(requestTimeoutMillis.(float64)) - // parse numConnections - numConnections, ok := onlineStoreConfig["num_connections"] - if !ok { - numConnections = 0.0 - log.Warn().Msg("num_connections not specified, using gocql default") - } - cassandraConfig.numConnections = int(numConnections.(float64)) - return &cassandraConfig, nil } @@ -200,9 +191,6 @@ func NewCassandraOnlineStore(project string, config *registry.RepoConfig, online if cassandraConfig.requestTimeoutMillis != 0 { store.clusterConfigs.Timeout = time.Millisecond * time.Duration(cassandraConfig.requestTimeoutMillis) } - if cassandraConfig.numConnections != 0 { - store.clusterConfigs.NumConns = cassandraConfig.numConnections - } store.clusterConfigs.RetryPolicy = &gocql.SimpleRetryPolicy{NumRetries: 3} store.clusterConfigs.Consistency = gocql.LocalOne diff --git a/go/internal/feast/onlinestore/cassandraonlinestore_test.go b/go/internal/feast/onlinestore/cassandraonlinestore_test.go index 0df37d12ad..67a9eea548 100644 --- a/go/internal/feast/onlinestore/cassandraonlinestore_test.go +++ b/go/internal/feast/onlinestore/cassandraonlinestore_test.go @@ -20,7 +20,6 @@ func TestExtractCassandraConfig_CorrectDefaults(t *testing.T) { assert.True(t, reflect.TypeOf(gocql.RoundRobinHostPolicy()) == reflect.TypeOf(cassandraConfig.loadBalancingPolicy)) assert.Equal(t, int64(0), cassandraConfig.connectionTimeoutMillis) assert.Equal(t, int64(0), cassandraConfig.requestTimeoutMillis) - assert.Equal(t, 0, cassandraConfig.numConnections) } func TestExtractCassandraConfig_CorrectSettings(t *testing.T) { @@ -36,7 +35,6 @@ func TestExtractCassandraConfig_CorrectSettings(t *testing.T) { }, "connection_timeout_millis": 271.0, "request_timeout_millis": 271.0, - "num_connections": 2.0, } cassandraConfig, _ := extractCassandraConfig(config) @@ -48,7 +46,6 @@ func TestExtractCassandraConfig_CorrectSettings(t *testing.T) { assert.True(t, reflect.TypeOf(gocql.DCAwareRoundRobinPolicy("aws-us-west-2")) == reflect.TypeOf(cassandraConfig.loadBalancingPolicy)) assert.Equal(t, int64(271), cassandraConfig.connectionTimeoutMillis) assert.Equal(t, int64(271), cassandraConfig.requestTimeoutMillis) - assert.Equal(t, 2, cassandraConfig.numConnections) } func TestGetFqTableName(t *testing.T) {