Class: Riak::Client::NetHTTPBackend

Inherits:
HTTPBackend show all
Defined in:
lib/riak/client/net_http_backend.rb

Overview

Uses the Ruby standard library Net::HTTP to connect to Riak. Conforms to the Riak::Client::HTTPBackend interface.

Constant Summary

Constants included from FeatureDetection

FeatureDetection::VERSION

Instance Attribute Summary

Attributes inherited from HTTPBackend

#client, #node

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from HTTPBackend

#delete_file, #delete_object, #fetch_object, #file_exists?, #get_bucket_props, #get_file, #get_index, #initialize, #link_walk, #list_buckets, #list_keys, #mapred, #ping, #reload_object, #search, #set_bucket_props, #stats, #store_file, #store_object, #update_search_index

Methods included from HTTPBackend::Configuration

#bucket_list_path, #bucket_properties_path, #index_eq_path, #index_range_path, #key_list_path, #link_walk_path, #luwak_path, #mapred_path, #object_path, #ping_path, #solr_select_path, #solr_update_path, #stats_path

Methods included from HTTPBackend::ObjectMethods

#load_object, #reload_headers, #store_headers

Methods included from HTTPBackend::TransportMethods

#basic_auth_header, #client_id, #default_headers, #delete, #get, #head, #path, #post, #put, #return_body?, #root_uri, #valid_response?, #verify_body!

Methods included from FeatureDetection

#get_server_version, #mapred_phaseless?, #pb_conditionals?, #pb_head?, #pb_indexes?, #pb_search?, #quorum_controls?, #server_version, #tombstone_vclocks?

Methods included from Util::Translation

#i18n_scope, #t

Methods included from Util::Escape

#escape, #maybe_escape, #maybe_unescape, #unescape

Constructor Details

This class inherits a constructor from Riak::Client::HTTPBackend

Class Method Details

.configured?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
18
# File 'lib/riak/client/net_http_backend.rb', line 10

def self.configured?
  begin
    require 'net/http'
    require 'openssl'
    true
  rescue LoadError, NameError
    false
  end
end

.read_timeoutObject



26
27
28
# File 'lib/riak/client/net_http_backend.rb', line 26

def self.read_timeout
  @read_timeout ||= 4096
end

.read_timeout=(timeout) ⇒ Object

Sets the read_timeout applied to Net::HTTP connections Increase this if you have very long request times.



22
23
24
# File 'lib/riak/client/net_http_backend.rb', line 22

def self.read_timeout=(timeout)
  @read_timeout = timeout
end

Instance Method Details

#teardownObject

Net::HTTP doesn’t use persistent connections, so there’s no work to do here.



32
# File 'lib/riak/client/net_http_backend.rb', line 32

def teardown; end