Kudu C++ client API
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)
 
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::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.

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