Skip to content

Commit

Permalink
Removed num_connections as it is ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
acevedosharp committed Nov 26, 2024
1 parent 13b6bc8 commit 1f7cb20
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
12 changes: 0 additions & 12 deletions go/internal/feast/onlinestore/cassandraonlinestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ type CassandraConfig struct {
loadBalancingPolicy gocql.HostSelectionPolicy
connectionTimeoutMillis int64
requestTimeoutMillis int64
numConnections int
}

func extractCassandraConfig(onlineStoreConfig map[string]any) (*CassandraConfig, error) {
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions go/internal/feast/onlinestore/cassandraonlinestore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)

Expand All @@ -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) {
Expand Down

0 comments on commit 1f7cb20

Please sign in to comment.