|
Kudu C++ client API
|
A "factory" for KuduClient objects. More...
#include <client.h>
Public Types | |
| enum | EncryptionPolicy { OPTIONAL, REQUIRED_REMOTE, REQUIRED } |
| Policy for on-the-wire encryption. More... | |
Public Member Functions | |
| KuduClientBuilder & | clear_master_server_addrs () |
| KuduClientBuilder & | master_server_addrs (const std::vector< std::string > &addrs) |
| KuduClientBuilder & | add_master_server_addr (const std::string &addr) |
| KuduClientBuilder & | default_admin_operation_timeout (const MonoDelta &timeout) |
| KuduClientBuilder & | default_rpc_timeout (const MonoDelta &timeout) |
| KuduClientBuilder & | connection_negotiation_timeout (const MonoDelta &timeout) |
| KuduClientBuilder & | import_authentication_credentials (std::string authn_creds) |
| KuduClientBuilder & | num_reactors (int num_reactors) |
| Set the number of reactors for the RPC messenger. More... | |
| KuduClientBuilder & | sasl_protocol_name (const std::string &sasl_protocol_name) |
| KuduClientBuilder & | require_authentication (bool require_authentication) |
| KuduClientBuilder & | encryption_policy (EncryptionPolicy encryption_policy) |
| Status | Build (sp::shared_ptr< KuduClient > *client) |
A "factory" for KuduClient objects.
This class is used to create instances of the KuduClient class with pre-set options/parameters.
Policy for on-the-wire encryption.
| 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.
| [in] | addr | RPC address of master server to add. |
| Status kudu::client::KuduClientBuilder::Build | ( | sp::shared_ptr< KuduClient > * | client | ) |
Create a client object.
| [out] | client | The newly created object wrapped in a shared pointer. |
| KuduClientBuilder& kudu::client::KuduClientBuilder::clear_master_server_addrs | ( | ) |
Clear the set of master addresses.
| KuduClientBuilder& kudu::client::KuduClientBuilder::connection_negotiation_timeout | ( | const MonoDelta & | timeout | ) |
Set the timeout for negotiating a connection to a remote server.
If not provided, the underlying messenger is created with reasonable default. The result value could be retrieved using KuduClient.connection_negotiation_timeout() after an instance of KuduClient is created. Sometimes it makes sense to customize the timeout for connection negotiation, e.g. when running on a cluster with heavily loaded tablet servers. For details on the connection negotiation, see ../../../docs/design-docs/rpc.md::negotiation.
| [in] | timeout | Timeout value to set. |
| 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.
| [in] | timeout | Timeout value to set. |
| KuduClientBuilder& kudu::client::KuduClientBuilder::default_rpc_timeout | ( | const MonoDelta & | timeout | ) |
Set the default timeout for individual RPCs.
If not provided, defaults to 10 seconds.
| [in] | timeout | Timeout value to set. |
| KuduClientBuilder& kudu::client::KuduClientBuilder::encryption_policy | ( | EncryptionPolicy | encryption_policy | ) |
Require encryption for the connection to a remote server.
If it's set to REQUIRED_REMOTE or REQUIRED, the client will require encrypting the traffic between the server and the client. If the server doesn't support encryption, or if it's disabled, the client will fail to connect.
Loopback connections are encrypted only if 'encryption_policy' is set to REQUIRED, or if it's required by the server.
The default value is OPTIONAL, which allows connecting to servers without encryption as well, but it will still attempt to use it if the server supports it.
| [in] | encryption_policy | Which encryption policy to use. |
| KuduClientBuilder& kudu::client::KuduClientBuilder::import_authentication_credentials | ( | std::string | authn_creds | ) |
Import serialized authentication credentials from another client.
| [in] | authn_creds | The serialized authentication credentials, provided by a call to KuduClient.ExportAuthenticationCredentials in the C++ client or KuduClient::exportAuthenticationCredentials in the Java client. |
| KuduClientBuilder& kudu::client::KuduClientBuilder::master_server_addrs | ( | const std::vector< std::string > & | addrs | ) |
Add RPC addresses of multiple masters.
| [in] | addrs | RPC addresses of masters to add. |
| 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.
| [in] | num_reactors | Number of reactors to set. |
| KuduClientBuilder& kudu::client::KuduClientBuilder::require_authentication | ( | bool | require_authentication | ) |
Require authentication for the connection to a remote server.
If it's set to true, the client will require mutual authentication between the server and the client. If the server doesn't support authentication, or it's disabled, the client will fail to connect.
| [in] | require_authentication | Whether to require authentication. |
| KuduClientBuilder& kudu::client::KuduClientBuilder::sasl_protocol_name | ( | const std::string & | sasl_protocol_name | ) |
Set the SASL protocol name for the connection to a remote server.
If the servers use a non-default Kerberos service principal name (other than "kudu" or "kudu/<hostname>", this needs to be set for the client to be able to connect to the servers. If unset, the client will assume the server is using the default service principal.
| [in] | sasl_protocol_name | SASL protocol name. |