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

allow customizing cluster options using an init file #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dolsem
Copy link

@dolsem dolsem commented Feb 3, 2024

Currently cassandra-migrate does not provide a way to customize cluster options, such as policies for load balancing, address translation (crucial when the cluster is in a private subnet and you need to map internal ips to external hostnames), etc.

This PR adds a way to override cluster options by defining an init file, e.g. cassandra-migrate.init.py, with contents like:

from cassandra.cluster import Cluster
from cassandra.policies import WhiteListRoundRobinPolicy

def create_cluster(**kwargs):
  kwargs['load_balancing_policy'] = WhiteListRoundRobinPolicy(['127.0.0.1'])
  return Cluster(**kwargs)

I'd like to know if there is interest in merging this PR. If there is, I will add tests and documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant