Class: Cassandra::Execution::Profile
- Inherits:
-
Object
- Object
- Cassandra::Execution::Profile
- Defined in:
- lib/cassandra/execution/profile.rb
Overview
Instance Attribute Summary collapse
-
#consistency ⇒ Symbol
readonly
Consistency level with which to run statements.
-
#load_balancing_policy ⇒ Cassandra::LoadBalancing::Policy
readonly
Load-balancing policy that determines which node will run the next statement.
-
#retry_policy ⇒ Cassandra::Retry::Policy
readonly
Retry policy that determines how request retries should be handled for different failure modes.
-
#timeout ⇒ Numeric
readonly
Request execution timeout in seconds.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Profile
constructor
A new instance of Profile.
Constructor Details
#initialize(options = {}) ⇒ Profile
Returns a new instance of Profile.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/cassandra/execution/profile.rb', line 58 def initialize( = {}) validate() = DEFAULT_OPTIONS.merge() @load_balancing_policy = [:load_balancing_policy] || LoadBalancing::Policies::TokenAware.new( LoadBalancing::Policies::DCAwareRoundRobin.new, true) @retry_policy = [:retry_policy] || Retry::Policies::Default.new @consistency = [:consistency] @timeout = [:timeout] end |
Instance Attribute Details
#consistency ⇒ Symbol (readonly)
Returns consistency level with which to run statements.
40 41 42 |
# File 'lib/cassandra/execution/profile.rb', line 40 def consistency @consistency end |
#load_balancing_policy ⇒ Cassandra::LoadBalancing::Policy (readonly)
Returns load-balancing policy that determines which node will run the next statement.
33 34 35 |
# File 'lib/cassandra/execution/profile.rb', line 33 def load_balancing_policy @load_balancing_policy end |
#retry_policy ⇒ Cassandra::Retry::Policy (readonly)
Returns retry policy that determines how request retries should be handled for different failure modes.
37 38 39 |
# File 'lib/cassandra/execution/profile.rb', line 37 def retry_policy @retry_policy end |
#timeout ⇒ Numeric (readonly)
Returns request execution timeout in seconds. nil
means there is no timeout.
43 44 45 |
# File 'lib/cassandra/execution/profile.rb', line 43 def timeout @timeout end |