dse.cluster - Clusters and Sessions

class Cluster

Cluster extending cassandra.cluster.Cluster. The API is identical, except that it returns a dse.cluster.Session (see below).

It also uses the new Execution Profile API, so legacy parameters are disallowed.

class GraphExecutionProfile

Default execution profile for graph execution.

See ExecutionProfile for base attributes.

In addition to default parameters shown in the signature, this profile also defaults retry_policy to dse.policies.NeverRetryPolicy.

Attributes

graph_options

= None

GraphOptions to use with this execution

Default options for graph queries, initialized as follows by default:

GraphOptions(graph_source=b'g',
             graph_language=b'gremlin-groovy')

See dse.graph.GraphOptions

class GraphAnalyticsExecutionProfile

Execution profile with timeout and load balancing appropriate for graph analytics queries.

See also GraphExecutionPolicy.

In addition to default parameters shown in the signature, this profile also defaults retry_policy to dse.policies.NeverRetryPolicy, and load_balancing_policy to one that targets the current Spark master.

Module Data

dse.cluster.

EXEC_PROFILE_GRAPH_DEFAULT

Key for the default graph execution profile, used when no other profile is selected in Session.execute_graph(execution_profile).

Use this as the key in Cluster(execution_profiles) to override the default graph profile.

dse.cluster.

EXEC_PROFILE_GRAPH_SYSTEM_DEFAULT

Key for the default graph system execution profile. This can be used for graph statements using the DSE graph system API.

Selected using Session.execute_graph(execution_profile=EXEC_PROFILE_GRAPH_SYSTEM_DEFAULT).

dse.cluster.

EXEC_PROFILE_GRAPH_ANALYTICS_DEFAULT

Key for the default graph analytics execution profile. This can be used for graph statements intended to use Spark/analytics as the traversal source.

Selected using Session.execute_graph(execution_profile=EXEC_PROFILE_GRAPH_ANALYTICS_DEFAULT).

class Session

A session extension based on cassandra.cluster.Session with additional features:

  • Pre-registered DSE-specific types (geometric types)

  • Graph execution API

Methods

execute_graph

(statement[, parameters][, trace][, execution_profile])

Executes a Gremlin query string or SimpleGraphStatement synchronously, and returns a ResultSet from this execution.

parameters is dict of named parameters to bind. The values must be JSON-serializable.

execution_profile: Selects an execution profile for the request.

execute_graph_async

(statement[, parameters][, trace][, execution_profile])

Execute the graph query and return a ResponseFuture object which callbacks may be attached to for asynchronous response delivery. You may also call ResponseFuture.result() to synchronously block for results at any time.