Kudu C++ client API
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
kudu::client::KuduClientBuilder Class Reference

A "factory" for KuduClient objects. More...

#include <client.h>

Public Member Functions

KuduClientBuilderclear_master_server_addrs ()
 
KuduClientBuildermaster_server_addrs (const std::vector< std::string > &addrs)
 
KuduClientBuilderadd_master_server_addr (const std::string &addr)
 
KuduClientBuilderdefault_admin_operation_timeout (const MonoDelta &timeout)
 
KuduClientBuilderdefault_rpc_timeout (const MonoDelta &timeout)
 
KuduClientBuilderimport_authentication_credentials (std::string authn_creds)
 
KuduClientBuildernum_reactors (int num_reactors)
 Set the number of reactors for the RPC messenger. More...
 
Status Build (sp::shared_ptr< KuduClient > *client)
 

Detailed Description

A "factory" for KuduClient objects.

This class is used to create instances of the KuduClient class with pre-set options/parameters.

Member Function Documentation

KuduClientBuilder& kudu::client::KuduClientBuilder::add_master_server_addr ( const std::string &  addr)

Add an RPC address of a master to work with.

At least one master is required.

Parameters
[in]addrRPC address of master server to add.
Returns
Reference to the updated object.
Status kudu::client::KuduClientBuilder::Build ( sp::shared_ptr< KuduClient > *  client)

Create a client object.

Note
KuduClients objects are shared amongst multiple threads and, as such, are stored in shared pointers.
Parameters
[out]clientThe newly created object wrapped in a shared pointer.
Returns
Operation status. The return value may indicate an error in the create operation, or a misuse of the builder; in the latter case, only the last error is returned.
KuduClientBuilder& kudu::client::KuduClientBuilder::clear_master_server_addrs ( )

Clear the set of master addresses.

Returns
Reference to the updated object.
KuduClientBuilder& kudu::client::KuduClientBuilder::default_admin_operation_timeout ( const MonoDelta timeout)

Set the default timeout for administrative operations.

Using this method it is possible to modify the default timeout for operations like CreateTable, AlterTable, etc. By default it is 30 seconds.

Parameters
[in]timeoutTimeout value to set.
Returns
Reference to the updated object.
KuduClientBuilder& kudu::client::KuduClientBuilder::default_rpc_timeout ( const MonoDelta timeout)

Set the default timeout for individual RPCs.

If not provided, defaults to 10 seconds.

Parameters
[in]timeoutTimeout value to set.
Returns
Reference to the updated object.
KuduClientBuilder& kudu::client::KuduClientBuilder::import_authentication_credentials ( std::string  authn_creds)

Import serialized authentication credentials from another client.

Parameters
[in]authn_credsThe serialized authentication credentials, provided by a call to KuduClient.ExportAuthenticationCredentials in the C++ client or KuduClient::exportAuthenticationCredentials in the Java client.
Returns
Reference to the updated object.
KuduClientBuilder& kudu::client::KuduClientBuilder::master_server_addrs ( const std::vector< std::string > &  addrs)

Add RPC addresses of multiple masters.

Parameters
[in]addrsRPC addresses of masters to add.
Returns
Reference to the updated object.
KuduClientBuilder& kudu::client::KuduClientBuilder::num_reactors ( int  num_reactors)

Set the number of reactors for the RPC messenger.

The reactor threads are used for sending and receiving. If not provided, the underlying messenger is created with the default number of reactor threads.

Parameters
[in]num_reactorsNumber of reactors to set.
Returns
Reference to the updated object.

The documentation for this class was generated from the following file: