Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add request_timeout setting for cassandra online store adapter #3256

Merged
merged 1 commit into from
Sep 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
)
from cassandra.policies import DCAwareRoundRobinPolicy, TokenAwarePolicy
from cassandra.query import PreparedStatement
from pydantic import StrictInt, StrictStr
from pydantic import StrictFloat, StrictInt, StrictStr
from pydantic.typing import Literal

from feast import Entity, FeatureView, RepoConfig
Expand Down Expand Up @@ -141,6 +141,9 @@ class CassandraOnlineStoreConfig(FeastConfigBaseModel):
protocol_version: Optional[StrictInt] = None
"""Explicit specification of the CQL protocol version used."""

request_timeout: Optional[StrictFloat] = None
"""Request timeout in seconds."""

class CassandraLoadBalancingPolicy(FeastConfigBaseModel):
"""
Configuration block related to the Cluster's load-balancing policy.
Expand Down Expand Up @@ -240,7 +243,10 @@ def _get_session(self, config: RepoConfig):
raise CassandraInvalidConfig(E_CASSANDRA_UNKNOWN_LB_POLICY)

# wrap it up in a map of ex.profiles with a default
exe_profile = ExecutionProfile(load_balancing_policy=lb_policy)
exe_profile = ExecutionProfile(
request_timeout=online_store_config.request_timeout,
load_balancing_policy=lb_policy,
)
execution_profiles = {EXEC_PROFILE_DEFAULT: exe_profile}
else:
execution_profiles = None
Expand Down