Module: Cassie::Statements::Execution
- Extended by:
- ClassMethods
- Includes:
- Callbacks, Consistency, Instrumentation, PartitionLinking
- Included in:
- Core
- Defined in:
- lib/cassie/statements/execution.rb,
lib/cassie/statements/execution/peeking.rb,
lib/cassie/statements/execution/fetching.rb,
lib/cassie/statements/execution/callbacks.rb,
lib/cassie/statements/execution/deserialization.rb,
lib/cassie/statements/execution/instrumentation.rb,
lib/cassie/statements/execution/batched_fetching.rb,
lib/cassie/statements/execution/partition_linking.rb
Overview
Execution support for Cassandra Statements
Requires the following methods be provided:
-
statement
-
CQL
String
orCassandra::Statements:Statement
executable by aCassandra::Session
-
-
session
-
A
Cassandra::Session
scoped to an appropriate keyspace
-
Defined Under Namespace
Modules: BatchedFetching, Callbacks, ClassMethods, Consistency, Deserialization, Fetching, Instrumentation, PartitionLinking, Peeking
Instance Method Summary collapse
-
#execute ⇒ Boolean
Executes the statment and populates result.
-
#execute! ⇒ Boolean
Same as #execute.
-
#execution_options ⇒ Hash{Symbol => Object}
The session exection options configured for statement execution.
Methods included from ClassMethods
Methods included from PartitionLinking
#build_partition_linker, #partition_linker?
Methods included from Consistency
Instance Method Details
#execute ⇒ Boolean
Executes the statment and populates result
58 59 60 61 |
# File 'lib/cassie/statements/execution.rb', line 58 def execute @result = result_class.new(session.execute(statement, ), result_opts) result.success? end |
#execute! ⇒ Boolean
Same as #execute. Raises if not succesfull.
66 67 68 |
# File 'lib/cassie/statements/execution.rb', line 66 def execute! execute || (raise Cassie::Statements::ExecutionError.new(result)) end |
#execution_options ⇒ Hash{Symbol => Object}
The session exection options configured for statement execution
72 73 74 75 76 77 78 79 80 |
# File 'lib/cassie/statements/execution.rb', line 72 def {}.tap do |opts| # @todo rework consistency module to be more # abstract implementation for all execution options opts[:consistency] = consistency if consistency opts[:paging_state] = paging_state if respond_to?(:paging_state) && paging_state opts[:page_size] = stateless_page_size if respond_to?(:stateless_page_size) && stateless_page_size end end |