Package com.gpudb
Class GPUdbBase.Options
- java.lang.Object
-
- com.gpudb.GPUdbBase.Options
-
- Enclosing class:
- GPUdbBase
public static final class GPUdbBase.Options extends Object
A set of configurable options for the GPUdb API. May be passed into theGPUdb constructorto override the default options.
-
-
Constructor Summary
Constructors Constructor Description Options()No-argument constructor needed for the copy constructor.Options(GPUdbBase.Options other)Copy constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GPUdbBase.OptionsaddHttpHeader(String header, String value)Adds an HTTP header to the map of additional HTTP headers to send to GPUdb with each request.booleangetBypassSslCertCheck()Gets the value of the flag indicating whether to verify the SSL certificate for HTTPS connections.static intgetClusterReconnectCount()Deprecated, for removal: This API element is subject to removal in a future version.Gets the number of times the API tries to reconnect to the same cluster (when a failover event has been triggered), before actually failing over to any available backup cluster.intgetConnectionInactivityValidationTimeout()Gets the period of inactivity (in milliseconds) after which connection validity would be checked before reusing it.booleangetDisableAutoDiscovery()Gets the value of the flag indicating whether to disable automatic discovery of backup clusters or worker rank URLs.booleangetDisableFailover()Gets the value of the flag indicating whether to disable failover upon failures.ExecutorServicegetExecutor()Gets theexecutor serviceused for managing threads during data encoding and decoding operations.GPUdbBase.FailbackOptionsgetFailbackOptions()GPUdbBase.HAFailoverOrdergetHAFailoverOrder()Gets the current high availability failover order.intgetHostManagerPort()Gets the host manager port number.PatterngetHostnameRegex()Gets the regex pattern to be used to filter URLs of the servers.Map<String,String>getHttpHeaders()Gets the map of additional HTTP headers to send to GPUdb with each request.longgetInitialConnectionAttemptTimeout()Gets the timeout used when trying to establish a connection to the database at GPUdb initialization.static longgetIntraClusterFailoverTimeout()Deprecated, for removal: This API element is subject to removal in a future version.Gets the timeout used when trying to recover from an intra-cluster failover event.intgetMaxConnectionsPerHost()Gets the maximum number of connections, per host, allowed at any given time.intgetMaxTotalConnections()Gets the maximum number of connections, across all hosts, allowed at any given time.StringgetOauthToken()Gets the OAuth access token to be used for authentication to GPUdb.StringgetPassword()Gets the password to be used for authentication to GPUdb.StringgetPrimaryUrl()Gets the URL of the primary cluster of the HA environment.intgetServerConnectionTimeout()Gets the server connection timeout value, in milliseconds, after which an inability to establish a connection with the GPUdb server will result in requests being aborted.intgetThreadCount()Gets the number of threads that will be used during data encoding and decoding operations.intgetTimeout()Gets the timeout value, in milliseconds, after which a lack of response from the GPUdb server will result in requests being aborted.StringgetTrustStoreFilePath()Gets the value of the SSL trustStore file pathStringgetTrustStorePassword()Gets the SSL trustStore file passwordStringgetUsername()Gets the username to be used for authentication to GPUdb.booleangetUseSnappy()Gets the value of the flag indicating whether to use Snappy compression for certain GPUdb requests that potentially submit large amounts of data.GPUdbBase.OptionssetBypassSslCertCheck(boolean value)Sets the flag indicating whether to verify the SSL certificate for HTTPS connections.GPUdbBase.OptionssetClusterReconnectCount(int value)Deprecated, for removal: This API element is subject to removal in a future version.Sets the number of times the API tries to reconnect to the same cluster (when a failover event has been triggered), before actually failing over to any available backup cluster.GPUdbBase.OptionssetConnectionInactivityValidationTimeout(int value)Sets the period of inactivity (in milliseconds) after which connection validity would be checked before reusing it.GPUdbBase.OptionssetDisableAutoDiscovery(boolean value)Sets the value of the flag indicating whether to disable automatic discovery of backup clusters or worker rank URLs.GPUdbBase.OptionssetDisableFailover(boolean value)Sets the value of the flag indicating whether to disable failover upon failures.GPUdbBase.OptionssetExecutor(ExecutorService value)Sets theexecutor serviceused for managing threads during data encoding and decoding operations.GPUdbBase.OptionssetFailbackOptions(GPUdbBase.FailbackOptions failbackOptions)GPUdbBase.OptionssetHAFailoverOrder(GPUdbBase.HAFailoverOrder value)Sets the value of the enum controlling the inter-cluster (high availability) failover priority.GPUdbBase.OptionssetHostManagerPort(int value)Sets the host manager port number.GPUdbBase.OptionssetHostnameRegex(String value)Sets the IP address or hostname regex against which the server's rank URLs would be matched when obtaining them.GPUdbBase.OptionssetHostnameRegex(Pattern value)Sets the IP address or hostname regex against which the server's rank URLs would be matched when obtaining them.GPUdbBase.OptionssetHttpHeaders(Map<String,String> value)Replaces the contents of the map of additional HTTP headers to send to GPUdb with each request with the contents of the specified map.GPUdbBase.OptionssetInitialConnectionAttemptTimeout(long value)Sets the timeout used when trying to establish a connection to the database at GPUdb initialization.GPUdbBase.OptionssetIntraClusterFailoverTimeout(long value)Deprecated, for removal: This API element is subject to removal in a future version.Sets the timeout used when trying to recover from an intra-cluster failover event.GPUdbBase.OptionssetMaxConnectionsPerHost(int value)Sets the maximum number of connections, per host, allowed at any given time.GPUdbBase.OptionssetMaxTotalConnections(int value)Sets the maximum number of connections, across all hosts, allowed at any given time.GPUdbBase.OptionssetOauthToken(String value)Sets the OAuth2 access token to be used for authentication to GPUdb.GPUdbBase.OptionssetPassword(String value)Sets the password to be used for authentication to GPUdb.GPUdbBase.OptionssetPrimaryUrl(String value)Sets the URL of the primary cluster to use amongst the HA clusters.GPUdbBase.OptionssetServerConnectionTimeout(int value)Gets the server connection timeout value, in milliseconds, after which an inability to establish a connection with the GPUdb server will result in requests being aborted.GPUdbBase.OptionssetThreadCount(int value)Sets the number of threads that will be used during data encoding and decoding operations.GPUdbBase.OptionssetTimeout(int value)Sets the timeout value, in milliseconds, after which a lack of response from the GPUdb server will result in requests being aborted.GPUdbBase.OptionssetTrustStoreFilePath(String trustStoreFilePath)Sets the SSL trustStore file path.GPUdbBase.OptionssetTrustStorePassword(String trustStorePassword)Sets the SSL trustStore file password.GPUdbBase.OptionssetUsername(String value)Sets the username to be used for authentication to GPUdb.GPUdbBase.OptionssetUseSnappy(boolean value)Sets the flag indicating whether to use Snappy compression for certain GPUdb requests that potentially submit large amounts of data.StringtoString()Returns the set of options as a JSON-style string
-
-
-
Constructor Detail
-
Options
public Options()
No-argument constructor needed for the copy constructor.
-
Options
public Options(GPUdbBase.Options other)
Copy constructor. Note: Member executor will get a shallow copy.
-
-
Method Detail
-
toString
public String toString()
Returns the set of options as a JSON-style string
-
getPrimaryUrl
public String getPrimaryUrl()
Gets the URL of the primary cluster of the HA environment.- Returns:
- the primary URL
- See Also:
setPrimaryUrl(String)
-
getUsername
public String getUsername()
Gets the username to be used for authentication to GPUdb.- Returns:
- the username
- See Also:
setUsername(String)
-
getPassword
public String getPassword()
Gets the password to be used for authentication to GPUdb.- Returns:
- the password
- See Also:
setPassword(String)
-
getOauthToken
public String getOauthToken()
Gets the OAuth access token to be used for authentication to GPUdb.- Returns:
- the OAuth access token
- See Also:
setOauthToken(String)
-
getHostnameRegex
public Pattern getHostnameRegex()
Gets the regex pattern to be used to filter URLs of the servers. If null, then the first URL encountered per rank will be used.- Returns:
- the IP or hostname regex to match URLs against
- See Also:
setHostnameRegex(Pattern)
-
getUseSnappy
public boolean getUseSnappy()
Gets the value of the flag indicating whether to use Snappy compression for certain GPUdb requests that potentially submit large amounts of data.- Returns:
- the value of the Snappy compression flag
- See Also:
setUseSnappy(boolean)
-
getBypassSslCertCheck
public boolean getBypassSslCertCheck()
Gets the value of the flag indicating whether to verify the SSL certificate for HTTPS connections.- Returns:
- the value of the SSL certificate verification bypass flag
- See Also:
setBypassSslCertCheck(boolean)
-
getTrustStoreFilePath
public String getTrustStoreFilePath()
Gets the value of the SSL trustStore file path- Returns:
- - a String - SSL trustStore file path
-
getTrustStorePassword
public String getTrustStorePassword()
Gets the SSL trustStore file password- Returns:
- - a String - trustStore file password
-
getDisableFailover
public boolean getDisableFailover()
Gets the value of the flag indicating whether to disable failover upon failures.- Returns:
- the value of the failover disabling flag
- See Also:
setDisableFailover(boolean)
-
getDisableAutoDiscovery
public boolean getDisableAutoDiscovery()
Gets the value of the flag indicating whether to disable automatic discovery of backup clusters or worker rank URLs. If set to true, then the GPUdb object will not connect to the database at initialization time, and will only work with the URLs given. Default is false.- Returns:
- the value of the automatic discovery disabling flag
- See Also:
setDisableAutoDiscovery(boolean)
-
getHAFailoverOrder
public GPUdbBase.HAFailoverOrder getHAFailoverOrder()
Gets the current high availability failover order. Default is RANDOM.- Returns:
- the inter-cluster failover order
- See Also:
setHAFailoverOrder(GPUdbBase.HAFailoverOrder)
-
getThreadCount
public int getThreadCount()
Gets the number of threads that will be used during data encoding and decoding operations.- Returns:
- the number of threads
- See Also:
setThreadCount(int),setExecutor(ExecutorService)
-
getExecutor
public ExecutorService getExecutor()
Gets theexecutor serviceused for managing threads during data encoding and decoding operations. Ifnull, threads will be created on demand; not used ifthread countequals 1.- Returns:
- the executor service
- See Also:
setExecutor(ExecutorService),setThreadCount(int)
-
getHttpHeaders
public Map<String,String> getHttpHeaders()
Gets the map of additional HTTP headers to send to GPUdb with each request. If empty, no additional headers will be sent.- Returns:
- the map
- See Also:
addHttpHeader(String, String),setHttpHeaders(Map)
-
getHostManagerPort
public int getHostManagerPort()
Gets the host manager port number. Some endpoints are supported only at the host manager, rather than the head node of the database.- Returns:
- the host manager port
- See Also:
setHostManagerPort(int)
-
getConnectionInactivityValidationTimeout
public int getConnectionInactivityValidationTimeout()
Gets the period of inactivity (in milliseconds) after which connection validity would be checked before reusing it. This is for fine-tuning server connection parameters. Using the default of 100ms should suffice for most users.- Returns:
- the connection inactivity period (in milliseconds)
- See Also:
setConnectionInactivityValidationTimeout(int)
-
getTimeout
public int getTimeout()
Gets the timeout value, in milliseconds, after which a lack of response from the GPUdb server will result in requests being aborted. A timeout of zero is interpreted as an infinite timeout. Note that this applies independently to various stages of communication, so overall a request may run for longer than this without being aborted.- Returns:
- the timeout value
- See Also:
setTimeout(int),getServerConnectionTimeout()
-
getServerConnectionTimeout
public int getServerConnectionTimeout()
Gets the server connection timeout value, in milliseconds, after which an inability to establish a connection with the GPUdb server will result in requests being aborted. This serves to limit both the time waiting to initially connect to the server and the time waiting for a response from the server when performing a status check. A timeout of zero is interpreted as an infinite timeout. Note that this is different from the request timeout for requests other than a system status check.- Returns:
- the connection timeout value
- See Also:
getTimeout(),setServerConnectionTimeout(int)
-
getMaxTotalConnections
public int getMaxTotalConnections()
Gets the maximum number of connections, across all hosts, allowed at any given time.- Returns:
- the maxTotalConnections value
- See Also:
setMaxTotalConnections(int)
-
getMaxConnectionsPerHost
public int getMaxConnectionsPerHost()
Gets the maximum number of connections, per host, allowed at any given time.- Returns:
- the maxConnectionsPerHost value
- See Also:
setMaxConnectionsPerHost(int)
-
getClusterReconnectCount
@Deprecated(since="7.1.9", forRemoval=true) public static int getClusterReconnectCount()
Deprecated, for removal: This API element is subject to removal in a future version.Gets the number of times the API tries to reconnect to the same cluster (when a failover event has been triggered), before actually failing over to any available backup cluster.- Returns:
- the clusterReconnectCount value
- See Also:
setClusterReconnectCount(int)
-
getInitialConnectionAttemptTimeout
public long getInitialConnectionAttemptTimeout()
Gets the timeout used when trying to establish a connection to the database at GPUdb initialization. The value is given in milliseconds and the default is 0. 0 indicates no retry will be done; instead, the user given URLs will be stored without farther discovery. If multiple URLs are given by the user, then API will try all of them once before retrying or giving up. When this timeout is set to a non-zero value, and the first attempt failed, then the API will wait (sleep) for a certain amount of time and try again. Upon consecutive failures, the sleep amount will be doubled. So, before the first retry (i.e. the second attempt), the API will sleep for one minute. Before the second retry, the API will sleep for two minutes, the next sleep interval would be four minutes, and onward.- Returns:
- the initialConnectionAttemptTimeout value
- See Also:
setInitialConnectionAttemptTimeout(long)
-
getIntraClusterFailoverTimeout
@Deprecated(since="7.1.9", forRemoval=true) public static long getIntraClusterFailoverTimeout()
Deprecated, for removal: This API element is subject to removal in a future version.Gets the timeout used when trying to recover from an intra-cluster failover event. The value is given in milliseconds. Returns 0.- Returns:
- the intraClusterFailoverTimeout value
- See Also:
setIntraClusterFailoverTimeout( long )
-
getFailbackOptions
public GPUdbBase.FailbackOptions getFailbackOptions()
-
setPrimaryUrl
public GPUdbBase.Options setPrimaryUrl(String value)
Sets the URL of the primary cluster to use amongst the HA clusters. This cluster will always be used first. It can be part of the URLs used to create the GPUdb object, or be a different one. In either case, this URL will always be chosen first to work against. Also, theGPUdbconstructors will ensure that no duplicate of this URL exists in the full set of URLs to use. If this is not set, then all available clusters will be treated with equal probability (unless only a single URL is given for the Kinetica server, in which case it will also be treated as the primary cluster). Can be given in the form of 'http[s]://X.X.X.X:PORT[/httpd-path]' or just the IP address or the hostname.- Parameters:
value- the URL of the primary cluster- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getPrimaryUrl()
-
setUsername
public GPUdbBase.Options setUsername(String value)
Sets the username to be used for authentication to GPUdb. This username will be sent with every GPUdb request made via the API along with thepasswordand may be used for authorization decisions by the server if it is so configured. If both the username and password arenull(the default) or empty strings, no authentication will be performed.- Parameters:
value- the username- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getUsername(),setPassword(String)
-
setPassword
public GPUdbBase.Options setPassword(String value)
Sets the password to be used for authentication to GPUdb. This password will be sent with every GPUdb request made via the API along with theusernameand may be used for authorization decisions by the server if it is so configured. If both the username and password arenull(the default) or empty strings, no authentication will be performed.- Parameters:
value- the password- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getPassword(),setUsername(String)
-
setOauthToken
public GPUdbBase.Options setOauthToken(String value)
Sets the OAuth2 access token to be used for authentication to GPUdb. This token will be sent with every GPUdb request made via the API and may be used for authorization decisions by the server if it is so configured. If set, OAuth2 authentication will be attempted; if not, basic username/password authentication will be attempted.- Parameters:
value- the OAuth access token to be used for authentication- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getOauthToken()
-
setHostnameRegex
public GPUdbBase.Options setHostnameRegex(String value) throws GPUdbException
Sets the IP address or hostname regex against which the server's rank URLs would be matched when obtaining them. If null, then the first URL for any given rank would be used (if multiple are available in the system properties). Note that the regex MUST NOT have the protocol or the port; it should be a regular expression ONLY for the hostname/IP address. Note also that the regex must match all servers in all clusters of the ring, as there is only one in use per connection.- Parameters:
value- the IP or hostname regex to match URLs against- Returns:
- the current
GPUdbBase.Optionsinstance - Throws:
GPUdbException- See Also:
getHostnameRegex()
-
setHostnameRegex
public GPUdbBase.Options setHostnameRegex(Pattern value)
Sets the IP address or hostname regex against which the server's rank URLs would be matched when obtaining them. If null, then the first URL for any given rank would be used (if multiple are available in the system properties). Note that the regex MUST have an **optional** [http://] or [https://] part to it since the regex would be applied in various scenarios (where the protocol is sometimes present and sometimes not). Note also that the regex must match all servers in all clusters of the ring, as there is only one in use per connection.- Parameters:
value- the IP or hostname regex to match URLs against- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getHostnameRegex()
-
setUseSnappy
public GPUdbBase.Options setUseSnappy(boolean value)
Sets the flag indicating whether to use Snappy compression for certain GPUdb requests that potentially submit large amounts of data. Iftrue, such requests will be automatically compressed before being sent to the server; the default isfalse.- Parameters:
value- the new value for the Snappy compression flag- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getUseSnappy()
-
setBypassSslCertCheck
public GPUdbBase.Options setBypassSslCertCheck(boolean value)
Sets the flag indicating whether to verify the SSL certificate for HTTPS connections. Iftrue, then the SSL certificate sent by the server during HTTPS connection handshake will not be verified; the public key sent by the server will be blindly trusted and used to encrypt the packets. The default isfalse.- Parameters:
value- the value of the SSL certificate verification bypass flag- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getBypassSslCertCheck()
-
setTrustStoreFilePath
public GPUdbBase.Options setTrustStoreFilePath(String trustStoreFilePath)
Sets the SSL trustStore file path. This is useful if the user wants to pass in a self-signed certificate. If this is passed in then the corresponding password for the file must also be set.GPUdbBase.Options m_gpudbOptions = new GPUdbBase.Options(); m_gpudbOptions = m_gpudbOptions.setTrustStoreFilePath(m_trustStoreFileName); m_gpudbOptions = m_gpudbOptions.setTrustStorePassword(m_trustStorePassword);
- Parameters:
trustStoreFilePath- - String indicating the full file path- Returns:
- - the current
GPUdbBase.Optionsinstance - See Also:
setTrustStorePassword(String)
-
setTrustStorePassword
public GPUdbBase.Options setTrustStorePassword(String trustStorePassword)
Sets the SSL trustStore file password. This is useful if the user wants to pass in a self-signed certificate.GPUdbBase.Options m_gpudbOptions = new GPUdbBase.Options(); m_gpudbOptions = m_gpudbOptions.setTrustStoreFilePath(m_trustStoreFileName); m_gpudbOptions = m_gpudbOptions.setTrustStorePassword(m_trustStorePassword);
- Parameters:
trustStorePassword- - String indicating the full file path- Returns:
- - the current
GPUdbBase.Optionsinstance - See Also:
(String)
-
setDisableFailover
public GPUdbBase.Options setDisableFailover(boolean value)
Sets the value of the flag indicating whether to disable failover upon failures. Iftrue, then no failover would be attempted upon triggering events regardless of the availability of a high availability cluster. The default isfalse.- Parameters:
value- the value of the failover disabling flag- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getDisableFailover()
-
setDisableAutoDiscovery
public GPUdbBase.Options setDisableAutoDiscovery(boolean value)
Sets the value of the flag indicating whether to disable automatic discovery of backup clusters or worker rank URLs. If set to true, then the GPUdb object will not connect to the database at initialization time, and will only work with the URLs given.- Parameters:
value- the value of the automatic discovery disabling flag- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getDisableAutoDiscovery()
-
setHAFailoverOrder
public GPUdbBase.Options setHAFailoverOrder(GPUdbBase.HAFailoverOrder value)
Sets the value of the enum controlling the inter-cluster (high availability) failover priority.- Parameters:
value- the value of the high availability failover priority- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getHAFailoverOrder()
-
setThreadCount
public GPUdbBase.Options setThreadCount(int value)
Sets the number of threads that will be used during data encoding and decoding operations. If set to one (the default), all encoding and decoding will be performed in the calling thread. If anexecutor serviceis provided, it will be used for thread management, and up to this many operations will be submitted to it at a time for execution. (Note that if the provided executor service supports fewer than this many threads, fewer operations will actually be executed simultaneously.) If no executor service is provided, any required threads will be created on demand.- Parameters:
value- the number of threads- Returns:
- the current
GPUdbBase.Optionsinstance - Throws:
IllegalArgumentException- ifvalueis less than one- See Also:
getThreadCount(),setExecutor(ExecutorService)
-
setExecutor
public GPUdbBase.Options setExecutor(ExecutorService value)
Sets theexecutor serviceused for managing threads during data encoding and decoding operations. Ifnull, threads will be created on demand; not used ifthread countequals 1. If the provided executor service supports fewer threads than thethread count, fewer operations will actually be executed simultaneously.- Parameters:
value- the executor service- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getExecutor(),setThreadCount(int)
-
setHttpHeaders
public GPUdbBase.Options setHttpHeaders(Map<String,String> value)
Replaces the contents of the map of additional HTTP headers to send to GPUdb with each request with the contents of the specified map. If empty, no additional headers will be sent.- Parameters:
value- the map- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
addHttpHeader(String, String),getHttpHeaders()
-
addHttpHeader
public GPUdbBase.Options addHttpHeader(String header, String value)
Adds an HTTP header to the map of additional HTTP headers to send to GPUdb with each request. If the header is already in the map, its value is replaced with the specified value.- Parameters:
header- the HTTP headervalue- the value of the HTTP header- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getHttpHeaders(),setHttpHeaders(Map)
-
setHostManagerPort
public GPUdbBase.Options setHostManagerPort(int value)
Sets the host manager port number. Some endpoints are supported only at the host manager, rather than the head node of the database.- Parameters:
value- the host manager port number- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getHostManagerPort()
-
setTimeout
public GPUdbBase.Options setTimeout(int value)
Sets the timeout value, in milliseconds, after which a lack of response from the GPUdb server will result in requests being aborted. A timeout of zero is interpreted as an infinite timeout. Note that this applies independently to various stages of communication, so overall a request may run for longer than this without being aborted.- Parameters:
value- the timeout value- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getTimeout()
-
setServerConnectionTimeout
public GPUdbBase.Options setServerConnectionTimeout(int value)
Gets the server connection timeout value, in milliseconds, after which an inability to establish a connection with the GPUdb server will result in requests being aborted. This serves to limit both the time waiting to initially connect to the server and the time waiting for a response from the server when performing a status check. A timeout of zero is interpreted as an infinite timeout. Note that this is different from the request timeout for requests other than a system status check. Sets the server connection timeout value, in milliseconds, after which an inability to establish a connection with the GPUdb server will result in requests being aborted. This serves to limit both the time waiting to initially connect to the server and the time waiting for a response from the server when performing a status check. A timeout of zero is interpreted as an infinite timeout. Note that this is different from the request timeout for requests other than a system status check. The default is 5000, which is equivalent to 5 seconds.- Parameters:
value- the server connection timeout value- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getServerConnectionTimeout()
-
setConnectionInactivityValidationTimeout
public GPUdbBase.Options setConnectionInactivityValidationTimeout(int value)
Sets the period of inactivity (in milliseconds) after which connection validity would be checked before reusing it. This is for fine-tuning server connection parameters. Using the default of 200ms should suffice for most users. The default is 100 (in milliseconds). *Note*: Non-positive value passed to this method disables connection validation. So, use with great caution!- Parameters:
value- the connection inactivity timeout (in milliseconds)- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getServerConnectionTimeout()
-
setMaxTotalConnections
public GPUdbBase.Options setMaxTotalConnections(int value)
Sets the maximum number of connections, across all hosts, allowed at any given time. Must be 1 at a minimum. The default value is 40.- Parameters:
value- the maxTotalConnections value- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getMaxTotalConnections()
-
setMaxConnectionsPerHost
public GPUdbBase.Options setMaxConnectionsPerHost(int value)
Sets the maximum number of connections, per host, allowed at any given time. Must be 1 at a minimum. The default value is 10.- Parameters:
value- the maxConnectionsPerHost value- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getMaxConnectionsPerHost()
-
setClusterReconnectCount
@Deprecated(since="7.1.9", forRemoval=true) public GPUdbBase.Options setClusterReconnectCount(int value)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the number of times the API tries to reconnect to the same cluster (when a failover event has been triggered), before actually failing over to any available backup cluster.- Parameters:
value- the clusterReconnectCount value- Returns:
- the current
GPUdbBase.Optionsinstance
-
setInitialConnectionAttemptTimeout
public GPUdbBase.Options setInitialConnectionAttemptTimeout(long value)
Sets the timeout used when trying to establish a connection to the database at GPUdb initialization. The value is given in milliseconds. 0 indicates no retry will be done; instead, the user given URLs will be stored without farther discovery. If multiple URLs are given by the user, then the API will try all of them once before retrying or giving up. When this timeout is set to a non-zero value, and the first attempt failed, then the API will wait (sleep) for a certain amount of time and try again. Upon consecutive failures, the sleep amount will be doubled. So, before the first retry (i.e. the second attempt), the API will sleep for one minute. Before the second retry, the API will sleep for two minutes, the next sleep interval would be four minutes, and onward. The default is 0, meaning the connection will NOT be re-attempted upon failure.- Parameters:
value- the initialConnectionAttemptTimeout value- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getInitialConnectionAttemptTimeout()
-
setIntraClusterFailoverTimeout
@Deprecated(since="7.1.9", forRemoval=true) public GPUdbBase.Options setIntraClusterFailoverTimeout(long value)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the timeout used when trying to recover from an intra-cluster failover event. The value is given in milliseconds.- Parameters:
value- the intraClusterFailoverTimeout value- Returns:
- the current
GPUdbBase.Optionsinstance - See Also:
getIntraClusterFailoverTimeout()
-
setFailbackOptions
public GPUdbBase.Options setFailbackOptions(GPUdbBase.FailbackOptions failbackOptions)
-
-