lib/riak/client/http_backend/configuration.rb in riak-client-1.0.5 vs lib/riak/client/http_backend/configuration.rb in riak-client-1.1.0
- old
+ new
@@ -155,9 +155,22 @@
def new_scheme?
!riak_kv_wm_buckets.nil?
end
+ def get_server_version
+ begin
+ # Attempt to grab the server version from the stats resource
+ stats = send(:stats)
+ stats['riak_kv_version']
+ rescue FailedRequest
+ # If stats is disabled, we can't assume the Riak version
+ # is >= 1.1. However, we can assume the new URL scheme is
+ # at least version 1.0.
+ new_scheme? ? "1.0.0" : "0.14.0"
+ end
+ end
+
def riak_kv_wm_buckets
server_config[:riak_kv_wm_buckets]
end
def riak_kv_wm_raw