Class: Dse::Graph::ExecutionProfile

Inherits:
Cassandra::Execution::Profile
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/dse/graph/execution_profile.rb,
lib/dse/graph/execution_profile.rb

Overview

Execution profile class that adds graph option support

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ExecutionProfile

Creates a Dse::Graph::ExecutionProfile instance, which extends Cassandra::Execution::Profile. It takes all of the same options as the Cassandra::Execution::Profile constructor and the following extra options.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :graph_name (String)

    name of graph to use in graph statements

  • :graph_source (String)

    graph traversal source

  • :graph_language (String)

    language used in graph queries

  • :graph_read_consistency (Cassandra::CONSISTENCIES)

    read consistency level for graph statements. Overrides the standard statement consistency level

  • :graph_write_consistency (Cassandra::CONSISTENCIES)

    write consistency level for graph statements. Overrides the standard statement consistency level



53
54
55
56
57
# File 'lib/dse/graph/execution_profile.rb', line 53

def initialize(options = {})
  options[:timeout] = 30 unless options[:timeout]
  super(options)
  @graph_options = Dse::Graph::Options.new(options)
end

Instance Attribute Details

#graph_languageString

Returns language used in the graph statement (default "gremlin-groovy").

Returns:

  • (String)

    language used in the graph statement (default "gremlin-groovy")



8
9
10
# File 'lib/dse/graph/execution_profile.rb', line 8

def graph_language
  @graph_language
end

#graph_nameString

Returns name of the targeted graph; required unless the statement is a system query.

Returns:

  • (String)

    name of the targeted graph; required unless the statement is a system query.



4
5
6
# File 'lib/dse/graph/execution_profile.rb', line 4

def graph_name
  @graph_name
end

#graph_read_consistencyCassandra::CONSISTENCIES

Returns read consistency level for graph statement. Overrides the standard statement consistency level. Defaults to ONE in the server, but the default may be configured differently.

Returns:

  • (Cassandra::CONSISTENCIES)

    read consistency level for graph statement. Overrides the standard statement consistency level. Defaults to ONE in the server, but the default may be configured differently.



12
13
14
# File 'lib/dse/graph/execution_profile.rb', line 12

def graph_read_consistency
  @graph_read_consistency
end

#graph_sourceString

Returns graph traversal source (default "g").

Returns:

  • (String)

    graph traversal source (default "g")



6
7
8
# File 'lib/dse/graph/execution_profile.rb', line 6

def graph_source
  @graph_source
end

#graph_write_consistencyCassandra::CONSISTENCIES

Returns write consistency level for graph statement. Overrides the standard statement consistency level. Defaults to QUORUM in the server, but the default may be configured differently.

Returns:

  • (Cassandra::CONSISTENCIES)

    write consistency level for graph statement. Overrides the standard statement consistency level. Defaults to QUORUM in the server, but the default may be configured differently.



16
17
18
# File 'lib/dse/graph/execution_profile.rb', line 16

def graph_write_consistency
  @graph_write_consistency
end