dianfu commented on code in PR #20120: URL: https://github.com/apache/flink/pull/20120#discussion_r911791239
########## flink-python/pyflink/datastream/connectors/cassandra.py: ########## @@ -126,14 +132,340 @@ def if_not_exists(self, enabled: bool) -> 'MapperOptions': return self +# ---- Classes introduced to construct the ClusterBuilder ---- + + +class LoadBalancingPolicy(object): + """ + The policy that decides which Cassandra hosts to contact for each new query. + + The LoadBalancingPolicy is informed of hosts up/down events. For efficiency purposes, the policy + is expected to exclude down hosts from query plans. + """ + + def __init__(self, j_load_balancing_policy): + self._j_load_balancing_policy = j_load_balancing_policy + + @staticmethod + def dc_aware_round_robin_policy() -> 'LoadBalancingPolicy': Review Comment: Could we also investigate whether it's possible to support the following policy: - WhiteListPolicy: See WhiteListPolicy.ofHosts for more details on how to create WhiteListPolicy - HostFilterPolicy: See HostFilterPolicy.fromDCWhiteList and HostFilterPolicy.fromDCBlackList for more details - LatencyAwarePolicy - TokenAwarePolicy ########## flink-python/pyflink/datastream/connectors/cassandra.py: ########## @@ -126,14 +132,340 @@ def if_not_exists(self, enabled: bool) -> 'MapperOptions': return self +# ---- Classes introduced to construct the ClusterBuilder ---- + + +class LoadBalancingPolicy(object): + """ + The policy that decides which Cassandra hosts to contact for each new query. + + The LoadBalancingPolicy is informed of hosts up/down events. For efficiency purposes, the policy + is expected to exclude down hosts from query plans. + """ + + def __init__(self, j_load_balancing_policy): + self._j_load_balancing_policy = j_load_balancing_policy + + @staticmethod + def dc_aware_round_robin_policy() -> 'LoadBalancingPolicy': + """ + The default load balancing policy. Review Comment: The doc could be updated to the following: ``` A DCAwareRoundRobinPolicy with token awareness. This is also the default load balancing policy. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org