public class ClientConfig
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
ENABLE_SSL_FOR_TEST |
Constructor and Description |
---|
ClientConfig()
Configuration for a client with no authentication credentials that will
work with a server with security disabled.
|
ClientConfig(java.lang.String username,
java.lang.String password)
Configuration for a client that specifies authentication credentials.
|
ClientConfig(java.lang.String username,
java.lang.String password,
boolean cleartext,
ClientStatusListenerExt listener)
Configuration for a client that specifies authentication credentials.
|
ClientConfig(java.lang.String username,
java.lang.String password,
boolean cleartext,
ClientStatusListenerExt listener,
org.voltdb.client.ClientAuthScheme scheme)
Configuration for a client that specifies authentication credentials.
|
ClientConfig(java.lang.String username,
java.lang.String password,
ClientStatusListener listener,
org.voltdb.client.ClientAuthScheme scheme)
Deprecated.
ClientStatusListener deprecated in favor of ClientStatusListenerExt |
ClientConfig(java.lang.String username,
java.lang.String password,
ClientStatusListenerExt listener)
Configuration for a client that specifies authentication credentials.
|
ClientConfig(java.lang.String username,
java.lang.String password,
ClientStatusListenerExt listener,
org.voltdb.client.ClientAuthScheme scheme)
Configuration for a client that specifies authentication credentials.
|
ClientConfig(javax.security.auth.Subject subject,
ClientStatusListenerExt listener)
Configuration for a client that specifies an already authenticated
Subject . |
Modifier and Type | Method and Description |
---|---|
void |
enableAutoTune()
Deprecated.
|
void |
enableKerberosAuthentication(java.lang.String loginContextEntryKey)
Use the provided JAAS login context entry key to get the authentication
credentials held by the caller
|
void |
enableKerberosAuthentication(javax.security.auth.Subject subject)
Enable Kerberos authentication with the provided subject credentials
|
void |
enableSSL()
Configure ssl from the provided properties file.
|
void |
setAutoTuneTargetInternalLatency(int targetLatency)
Deprecated.
|
void |
setClientAffinity(boolean on)
Deprecated.
client affinity is always
true : transactions are always
routed to the correct master partition improving latency and throughput. |
void |
setConnectionResponseTimeout(long ms)
Set the timeout for reading from a connection.
|
void |
setExpectedOutgoingMessageSize(int size)
Deprecated.
Has no effect.
|
void |
setHeavyweight(boolean heavyweight)
By default a single network thread is created and used to do IO and invoke callbacks.
|
void |
setInitialConnectionRetryInterval(long ms)
Set the initial connection retry interval.
|
void |
setMaxArenaSizes(int[] maxArenaSizes)
Deprecated.
Deprecated because memory pooling no longer uses arenas. Has no effect.
|
void |
setMaxConnectionRetryInterval(long ms)
Set the max connection retry interval.
|
void |
setMaxOutstandingTxns(int maxOutstanding)
Set the maximum number of outstanding requests that will be submitted before
blocking.
|
void |
setMaxTransactionsPerSecond(int maxTxnsPerSecond)
Set the maximum number of transactions that can be run in 1 second.
|
void |
setProcedureCallTimeout(long ms)
Set the timeout for procedure call.
|
void |
setReconnectOnConnectionLoss(boolean on)
Attempts to reconnect to a node with retry after connection loss.
|
static void |
setRoundingConfig(boolean isEnabled,
java.math.RoundingMode mode)
Enable or disable the rounding mode in the client.
|
void |
setSendReadsToReplicasByDefault(boolean on)
Deprecated.
no longer meaningful: reads are always sent
to the leader; sending to a replica would not have resulted
in better performance.
|
void |
setTopologyChangeAware(boolean enabled)
Attempts to connect to all nodes in the cluster
|
void |
setTrustStore(java.lang.String pathToTrustStore,
java.lang.String trustStorePassword)
Configure trust store
|
void |
setTrustStoreConfigFromDefault() |
void |
setTrustStoreConfigFromPropertyFile(java.lang.String propFN)
Configure trust store
|
public ClientConfig()
Configuration for a client with no authentication credentials that will work with a server with security disabled. Also specifies no status listener.
public ClientConfig(java.lang.String username, java.lang.String password)
Configuration for a client that specifies authentication credentials. The username and password can be null or the empty string.
username
- Cleartext username.password
- Cleartext password.@Deprecated public ClientConfig(java.lang.String username, java.lang.String password, ClientStatusListener listener, org.voltdb.client.ClientAuthScheme scheme)
ClientStatusListener
deprecated in favor of ClientStatusListenerExt
Configuration for a client that specifies authentication credentials. The username and password can be null or the empty string. Also specifies a status listener.
username
- Cleartext username.password
- Cleartext password.scheme
- Client password hash schemelistener
- ClientStatusListener
implementation to receive callbacks.public ClientConfig(java.lang.String username, java.lang.String password, ClientStatusListenerExt listener)
Configuration for a client that specifies authentication credentials. The username and password can be null or the empty string. Also specifies a status listener.
username
- Cleartext username.password
- Cleartext password.listener
- ClientStatusListenerExt
implementation to receive callbacks.public ClientConfig(java.lang.String username, java.lang.String password, ClientStatusListenerExt listener, org.voltdb.client.ClientAuthScheme scheme)
Configuration for a client that specifies authentication credentials. The username and password can be null or the empty string. Also specifies a status listener.
username
- Cleartext username.password
- Cleartext password.listener
- ClientStatusListenerExt
implementation to receive callbacks.scheme
- Client password hash schemepublic ClientConfig(java.lang.String username, java.lang.String password, boolean cleartext, ClientStatusListenerExt listener)
Configuration for a client that specifies authentication credentials. The username and password can be null or the empty string. Also specifies a status listener.
username
- Cleartext username.password
- A cleartext or hashed passowrd.listener
- ClientStatusListenerExt
implementation to receive callbacks.cleartext
- Whether the password is hashed.public ClientConfig(javax.security.auth.Subject subject, ClientStatusListenerExt listener)
Configuration for a client that specifies an already authenticated Subject
.
Also specifies a status listener.
subject
- an authenticated Subject
listener
- ClientStatusListenerExt
implementation to receive callbacks.public ClientConfig(java.lang.String username, java.lang.String password, boolean cleartext, ClientStatusListenerExt listener, org.voltdb.client.ClientAuthScheme scheme)
Configuration for a client that specifies authentication credentials. The username and password can be null or the empty string. Also specifies a status listener.
username
- Cleartext username.password
- A cleartext or hashed passowrd.listener
- ClientStatusListenerExt
implementation to receive callbacks.cleartext
- Whether the password is hashed.scheme
- Client password hash schemepublic void setProcedureCallTimeout(long ms)
Set the timeout for procedure call. If the timeout expires before the call returns,
the procedure callback will be called with status ClientResponse.CONNECTION_TIMEOUT
.
Synchronous procedures will throw an exception. If a response comes back after the
expiration has triggered, then a callback method
ClientStatusListenerExt.lateProcedureResponse(ClientResponse, String, int)
will be called.
Default value is 2 minutes if not set. Value of 0 means forever.
Note that while specified in MS, this timeout is only accurate to within a second or so.
ms
- Timeout value in milliseconds.public void setConnectionResponseTimeout(long ms)
Set the timeout for reading from a connection. If a connection receives no responses, either from procedure calls or &Pings, for the timeout time in milliseconds, then the connection will be assumed dead and the closed connection callback will be called.
Default value is 2 minutes if not set. Value of 0 means forever.
Note that while specified in MS, this timeout is only accurate to within a second or so.
ms
- Timeout value in milliseconds.@Deprecated public void setMaxArenaSizes(int[] maxArenaSizes)
Set the maximum size of memory pool arenas before falling back to using heap byte buffers.
maxArenaSizes
- Maximum size of each arena.public void setHeavyweight(boolean heavyweight)
By default a single network thread is created and used to do IO and invoke callbacks. When set to true, Runtime.getRuntime().availableProcessors() / 2 threads are created. Multiple server connections are required for more threads to be involved, a connection is assigned exclusively to a connection.
heavyweight
- Whether to create additional threads for high IO or
high processing workloads.@Deprecated public void setExpectedOutgoingMessageSize(int size)
Provide a hint indicating how large messages will be once serialized. Ensures efficient message buffer allocation.
size
- The expected size of the outgoing message.public void setMaxOutstandingTxns(int maxOutstanding)
Set the maximum number of outstanding requests that will be submitted before blocking. Similar to the number of concurrent connections in a traditional synchronous API. Defaults to 2k.
maxOutstanding
- The maximum outstanding transactions before calls to
Client.callProcedure(ProcedureCallback, String, Object...)
will block
or return false (depending on settings).public void setMaxTransactionsPerSecond(int maxTxnsPerSecond)
Set the maximum number of transactions that can be run in 1 second. Note this specifies a rate, not a ceiling. If the limit is set to 10, you can't send 10 in the first half of the second and 5 in the later half; the client will let you send about 1 transaction every 100ms. Default is {link Integer#MAX_VALUE}.
maxTxnsPerSecond
- Requested ceiling on rate of call in transaction per second.@Deprecated public void enableAutoTune()
Enable the Auto Tuning feature, which dynamically adjusts the maximum allowable transaction number with the goal of maintaining a target latency. The latency value used is the internal latency as reported by the servers. The internal latency is a good measure of system saturation.
See setAutoTuneTargetInternalLatency(int)
.
@deprecated in V10.2.5; functionality to be removed in V11.
@Deprecated public void setClientAffinity(boolean on)
true
: transactions are always
routed to the correct master partition improving latency and throughput.on
- unusedpublic void setTopologyChangeAware(boolean enabled)
Attempts to connect to all nodes in the cluster
Defaults to false.
enabled
- Enable or disable the topology awareness feature.@Deprecated public void setSendReadsToReplicasByDefault(boolean on)
on
- unusedpublic void setReconnectOnConnectionLoss(boolean on)
Attempts to reconnect to a node with retry after connection loss. See the ReconnectStatusListener
.
on
- Enable or disable the reconnection feature. Default is off.public void setInitialConnectionRetryInterval(long ms)
Set the initial connection retry interval. Only takes effect if m_reconnectOnConnectionLoss
is turned on.
ms
- initial connection retry interval in milliseconds.public void setMaxConnectionRetryInterval(long ms)
Set the max connection retry interval. Only takes effect if m_reconnectOnConnectionLoss
is turned on.
ms
- max connection retry interval in milliseconds.@Deprecated public void setAutoTuneTargetInternalLatency(int targetLatency)
Set the target latency for the Auto Tune feature. Note this represents internal latency as reported by the server(s), not round-trip latency measured by the client. Default value is 5 if this is not called.
@deprecated in V10.2.5; functionality to be removed in V11.
targetLatency
- New target latency in milliseconds.public void enableKerberosAuthentication(javax.security.auth.Subject subject)
Enable Kerberos authentication with the provided subject credentials
subject
- Identity of the authenticated user.public void enableKerberosAuthentication(java.lang.String loginContextEntryKey)
Use the provided JAAS login context entry key to get the authentication credentials held by the caller
loginContextEntryKey
- JAAS login context config entry designationpublic static void setRoundingConfig(boolean isEnabled, java.math.RoundingMode mode)
isEnabled
- True iff rounding is enabled.mode
- The rounding mode, with values taken from java.math.RoundingMode.public void setTrustStore(java.lang.String pathToTrustStore, java.lang.String trustStorePassword)
pathToTrustStore
- file specification for the trust storetrustStorePassword
- trust store key file passwordpublic void setTrustStoreConfigFromPropertyFile(java.lang.String propFN)
propFN
- property file name containing trust store properties:
trustStore
trust store file specification
trustStorePassword
trust store password
public void enableSSL()
public void setTrustStoreConfigFromDefault()