Class ThriftClient
In: lib/thrift_client.rb
lib/thrift_client/simple.rb
lib/thrift_client.rb
lib/thrift_client/simple.rb
Parent: AbstractThriftClient

Methods

new   new  

Classes and Modules

Module ThriftClient::Simple
Class ThriftClient::NoServersAvailable

Public Class methods

Create a new ThriftClient instance. Accepts an internal Thrift client class (such as CassandraRb::Client), a list of servers with ports, and optional parameters.

Valid optional parameters are:

:protocol:Which Thrift protocol to use. Defaults to Thrift::BinaryProtocol.
:protocol_extra_params:An array of additional parameters to pass to the protocol initialization call. Defaults to [].
:transport:Which Thrift transport to use. Defaults to Thrift::Socket.
:transport_wrapper:Which Thrift transport wrapper to use. Defaults to Thrift::FramedTransport.
:exception_classes:Which exceptions to catch and retry when sending a request. Defaults to [IOError, Thrift::Exception, Thrift::ApplicationException, Thrift::TransportException, NoServersAvailable]
:raise:Whether to reraise errors if no responsive servers are found. Defaults to true.
:retries:How many times to retry a request. Defaults to 0.
:server_retry_period:How many seconds to wait before trying to reconnect to a dead server. Defaults to 1. Set to nil to disable.
:server_max_requests:How many requests to perform before moving on to the next server in the pool, regardless of error status. Defaults to nil (no limit).
:timeout:Specify the default timeout in seconds. Defaults to 1.
:timeout_overrides:Specify additional timeouts on a per-method basis, in seconds. Only works with Thrift::BufferedTransport.
:defaults:Specify default values to return on a per-method basis, if :raise is set to false.

[Source]

    # File lib/thrift_client.rb, line 33
33:   def initialize(client_class, servers, options = {})
34:     super
35:   end

Create a new ThriftClient instance. Accepts an internal Thrift client class (such as CassandraRb::Client), a list of servers with ports, and optional parameters.

Valid optional parameters are:

:protocol:Which Thrift protocol to use. Defaults to Thrift::BinaryProtocol.
:protocol_extra_params:An array of additional parameters to pass to the protocol initialization call. Defaults to [].
:transport:Which Thrift transport to use. Defaults to Thrift::Socket.
:transport_wrapper:Which Thrift transport wrapper to use. Defaults to Thrift::FramedTransport.
:exception_classes:Which exceptions to catch and retry when sending a request. Defaults to [IOError, Thrift::Exception, Thrift::ApplicationException, Thrift::TransportException, NoServersAvailable]
:raise:Whether to reraise errors if no responsive servers are found. Defaults to true.
:retries:How many times to retry a request. Defaults to 0.
:server_retry_period:How many seconds to wait before trying to reconnect to a dead server. Defaults to 1. Set to nil to disable.
:server_max_requests:How many requests to perform before moving on to the next server in the pool, regardless of error status. Defaults to nil (no limit).
:timeout:Specify the default timeout in seconds. Defaults to 1.
:timeout_overrides:Specify additional timeouts on a per-method basis, in seconds. Only works with Thrift::BufferedTransport.
:defaults:Specify default values to return on a per-method basis, if :raise is set to false.

[Source]

    # File lib/thrift_client.rb, line 33
33:   def initialize(client_class, servers, options = {})
34:     super
35:   end

[Validate]