Skip to content

PYTHON-569 - optional execution profiles in core driver#594

Merged
aholmberg merged 26 commits into
masterfrom
569
Jun 9, 2016
Merged

PYTHON-569 - optional execution profiles in core driver#594
aholmberg merged 26 commits into
masterfrom
569

Conversation

@aholmberg
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread docs/execution_profiles.rst Outdated
especially as the database platform evolves more complex workloads.

The Execution Profile API is being introduced now, in an experimental capacity in order to take advantage of it in
existing projects, and to guage interest and feedback in the community. For now, the legacy configuration remains
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guage gauge interest

@aboudreault
Copy link
Copy Markdown
Contributor

+1 Awesome work \o/

@aholmberg aholmberg merged commit d51f71c into master Jun 9, 2016
@aholmberg aholmberg deleted the 569 branch June 9, 2016 21:12
Comment thread cassandra/cluster.py
if not isinstance(profile, ExecutionProfile):
raise TypeError("profile must be an instance of ExecutionProfile")
if self._config_mode == _ConfigMode.LEGACY:
raise ValueError("Cannot add execution profiles when legacy parameters are set explicitly. TODO: link to doc")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have a stray TODO in the error message. Maybe make that into a comment above instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just put the link in :)
Thanks

Comment thread cassandra/cluster.py
row_factory = self.row_factory
load_balancing_policy = self.cluster.load_balancing_policy
else:
execution_profile = self._get_execution_profile(execution_profile)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies that the execution_profile could be a string (e.g. the name of a profile) or an ExecutionProfile instance. If the latter, isn't it possible that the ExecutionProfile is not configured with available hosts, not registered in the profile-manager, etc. Wouldn't it be safer to require the arg to be a registered profile name only?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's useful for one-off executions, intended for after we remove legacy execute parameters. See http://datastax.github.io/python-driver/api/cassandra/cluster.html#cassandra.cluster.Session.execution_profile_clone_update, as mentioned in the docstring.

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.

4 participants