Module: Riak::Client::FeatureDetection
- Included in:
- HTTPBackend, ProtobuffsBackend
- Defined in:
- lib/riak/client/feature_detection.rb
Overview
Methods that can be used to determine whether certain features are supported by the Riak node to which the client backend is connected.
Backends must implement the “get_server_version” method, returning a string representing the Riak node’s version. This is implemented on HTTP using the stats resource, and on Protocol Buffers using the RpbGetServerInfoReq message.
Constant Summary collapse
- VERSION =
Constants representing Riak versions
{ 1 => Gem::Version.new("1.0.0"), 1.1 => Gem::Version.new("1.1.0"), 1.2 => Gem::Version.new("1.2.0") }.freeze
Instance Method Summary collapse
-
#get_server_version ⇒ String
abstract
The version of the Riak node.
-
#mapred_phaseless? ⇒ true, false
Whether MapReduce requests can be submitted without phases.
-
#pb_conditionals? ⇒ true, false
Whether conditional fetch/store semantics are supported over Protocol Buffers.
-
#pb_head? ⇒ true, false
Whether partial-fetches (vclock and metadata only) are supported over Protocol Buffers.
-
#pb_indexes? ⇒ true, false
Whether secondary index queries are supported over Protocol Buffers.
-
#pb_search? ⇒ true, false
Whether search queries are supported over Protocol Buffers.
-
#quorum_controls? ⇒ true, false
Whether additional quorums and FSM controls are available, e.g.
-
#server_version ⇒ Gem::Version
The version of the Riak node to which this backend is connected.
-
#tombstone_vclocks? ⇒ true, false
Whether “not found” responses might include vclocks.
Instance Method Details
#get_server_version ⇒ String
Returns the version of the Riak node.
21 22 23 |
# File 'lib/riak/client/feature_detection.rb', line 21 def get_server_version raise NotImplementedError end |
#mapred_phaseless? ⇒ true, false
Returns whether MapReduce requests can be submitted without phases.
33 34 35 |
# File 'lib/riak/client/feature_detection.rb', line 33 def mapred_phaseless? at_least? VERSION[1.1] end |
#pb_conditionals? ⇒ true, false
Returns whether conditional fetch/store semantics are supported over Protocol Buffers.
51 52 53 |
# File 'lib/riak/client/feature_detection.rb', line 51 def pb_conditionals? at_least? VERSION[1] end |
#pb_head? ⇒ true, false
Returns whether partial-fetches (vclock and metadata only) are supported over Protocol Buffers.
70 71 72 |
# File 'lib/riak/client/feature_detection.rb', line 70 def pb_head? at_least? VERSION[1] end |
#pb_indexes? ⇒ true, false
Returns whether secondary index queries are supported over Protocol Buffers.
39 40 41 |
# File 'lib/riak/client/feature_detection.rb', line 39 def pb_indexes? at_least? VERSION[1.2] end |
#pb_search? ⇒ true, false
Returns whether search queries are supported over Protocol Buffers.
45 46 47 |
# File 'lib/riak/client/feature_detection.rb', line 45 def pb_search? at_least? VERSION[1.2] end |
#quorum_controls? ⇒ true, false
Returns whether additional quorums and FSM controls are available, e.g. primary quorums, basic_quorum, notfound_ok.
58 59 60 |
# File 'lib/riak/client/feature_detection.rb', line 58 def quorum_controls? at_least? VERSION[1] end |
#server_version ⇒ Gem::Version
Returns the version of the Riak node to which this backend is connected.
27 28 29 |
# File 'lib/riak/client/feature_detection.rb', line 27 def server_version @server_version ||= Gem::Version.new(get_server_version) end |
#tombstone_vclocks? ⇒ true, false
Returns whether “not found” responses might include vclocks.
64 65 66 |
# File 'lib/riak/client/feature_detection.rb', line 64 def tombstone_vclocks? at_least? VERSION[1] end |