java.lang.Object
com.gpudb.GPUdbBase.Options
Enclosing class:
A set of configurable options for the GPUdb API. May be passed into the
GPUdb constructor to override the default options.Constructor Summary
ConstructorsConstructorDescriptionOptions()No-argument constructor needed for the copy constructor.Options(GPUdbBase.Options other) Copy constructor.Method Summary
Modifier and TypeMethodDescriptionaddHttpHeader(String header, String value) Adds an HTTP header to the map of additional HTTP headers to send to GPUdb with each request.booleanGets the value of the flag indicating whether to verify the SSL certificate for HTTPS connections.Gets the client program name, ornullif none has been set.Gets the client program version, ornullif none has been set.static intDeprecated, 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.intGets the period of inactivity (in milliseconds) after which connection validity would be checked before reusing it.booleanGets the value of the flag indicating whether to disable automatic discovery of backup clusters or worker rank URLs.booleanGets the value of the flag indicating whether to disable failover upon failures.Gets theexecutor serviceused for managing threads during data encoding and decoding operations.Gets the current high availability failover order.intGets the host manager port number.Gets the regex pattern to be used to filter URLs of the servers.Gets the map of additional HTTP headers to send to GPUdb with each request.longGets the timeout used when trying to establish a connection to the database at GPUdb initialization.static longDeprecated, 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.intGets the maximum number of connections, per host, allowed at any given time.intGets the maximum number of retries for HTTP requests.intGets the maximum number of connections, across all hosts, allowed at any given time.Gets the OAuth access token to be used for authentication to GPUdb.Gets the password to be used for authentication to GPUdb.Gets the URL of the primary cluster of the HA environment.intGets 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.intGets the number of threads that will be used during data encoding and decoding operations.intGets the timeout value, in milliseconds, after which a lack of response from the GPUdb server will result in requests being aborted.Gets the value of the SSL trustStore file pathGets the SSL trustStore file passwordGets the username to be used for authentication to GPUdb.booleanGets the value of the flag indicating whether to use Snappy compression for certain GPUdb requests that potentially submit large amounts of data.setBypassSslCertCheck(boolean value) Sets the flag indicating whether to verify the SSL certificate for HTTPS connections.setClientInfo(String clientName, String clientVersion) Sets a client program name and version, which will be prepended to theUser-Agentheader sent with each request.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.setConnectionInactivityValidationTimeout(int value) Sets the period of inactivity (in milliseconds) after which connection validity would be checked before reusing it.setDisableAutoDiscovery(boolean value) Sets the value of the flag indicating whether to disable automatic discovery of backup clusters or worker rank URLs.setDisableFailover(boolean value) Sets the value of the flag indicating whether to disable failover upon failures.setExecutor(ExecutorService value) Sets theexecutor serviceused for managing threads during data encoding and decoding operations.setFailbackOptions(GPUdbBase.FailbackOptions failbackOptions) Sets the value of the enum controlling the inter-cluster (high availability) failover priority.setHostManagerPort(int value) Sets the host manager port number.setHostnameRegex(String value) Sets the IP address or hostname regex against which the server’s rank URLs would be matched when obtaining them.setHostnameRegex(Pattern value) Sets the IP address or hostname regex against which the server’s rank URLs would be matched when obtaining them.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.setInitialConnectionAttemptTimeout(long value) Sets the timeout used when trying to establish a connection to the database at GPUdb initialization.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.setMaxConnectionsPerHost(int value) Sets the maximum number of connections, per host, allowed at any given time.setMaxRetries(int value) Sets the maximum number of retries for HTTP requests.setMaxTotalConnections(int value) Sets the maximum number of connections, across all hosts, allowed at any given time.setOauthToken(String value) Sets the OAuth2 access token to be used for authentication to GPUdb.setPassword(String value) Sets the password to be used for authentication to GPUdb.setPrimaryUrl(String value) Sets the URL of the primary cluster to use amongst the HA clusters.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.setThreadCount(int value) Sets the number of threads that will be used during data encoding and decoding operations.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.setTrustStoreFilePath(String trustStoreFilePath) Sets the SSL trustStore file path.setTrustStorePassword(String trustStorePassword) Sets the SSL trustStore file password.setUsername(String value) Sets the username to be used for authentication to GPUdb.setUseSnappy(boolean value) Sets the flag indicating whether to use Snappy compression for certain GPUdb requests that potentially submit large amounts of data.toString()Returns the set of options as a JSON-style string
Constructor Details
Options
Copy constructor. Note: Member executor will get a shallow copy.
Method Details
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 flagSee Also: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 flagSee Also:getDisableFailover
public boolean getDisableFailover()Gets the value of the flag indicating whether to disable failover upon failures.Returns:the value of the failover disabling flagSee Also: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 flagSee Also:getHAFailoverOrder
Gets the current high availability failover order. Default is RANDOM.Returns:the inter-cluster failover orderSee Also:getThreadCount
public int getThreadCount()Gets the number of threads that will be used during data encoding and decoding operations.Returns:the number of threadsSee Also: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 serviceSee Also: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 portSee Also: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: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 valueSee Also: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 valueSee Also:getMaxTotalConnections
public int getMaxTotalConnections()Gets the maximum number of connections, across all hosts, allowed at any given time.Returns:the maxTotalConnections valueSee Also:getMaxConnectionsPerHost
public int getMaxConnectionsPerHost()Gets the maximum number of connections, per host, allowed at any given time.Returns:the maxConnectionsPerHost valueSee Also:getMaxRetries
public int getMaxRetries()Gets the maximum number of retries for HTTP requests.Returns:the maxRetries valueSee Also: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 valueSee Also: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 valueSee Also: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 valueSee Also:getFailbackOptions
setPrimaryUrl
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 clusterReturns:the currentGPUdbBase.OptionsinstanceSee Also:setUsername
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.setPassword
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.setOauthToken
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 authenticationReturns:the currentGPUdbBase.OptionsinstanceSee Also:setHostnameRegex
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 againstReturns:the currentGPUdbBase.OptionsinstanceThrows:See Also:setHostnameRegex
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 againstReturns:the currentGPUdbBase.OptionsinstanceSee Also:setUseSnappy
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 flagReturns:the currentGPUdbBase.OptionsinstanceSee Also:setBypassSslCertCheck
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 flagReturns:the currentGPUdbBase.OptionsinstanceSee Also:setTrustStoreFilePath
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 pathReturns:- the currentGPUdbBase.OptionsinstanceSee Also:setTrustStorePassword
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 pathReturns:- the currentGPUdbBase.OptionsinstanceSee Also:setDisableFailover
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 flagReturns:the currentGPUdbBase.OptionsinstanceSee Also:setDisableAutoDiscovery
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 flagReturns:the currentGPUdbBase.OptionsinstanceSee Also:setHAFailoverOrder
Sets the value of the enum controlling the inter-cluster (high availability) failover priority.Parameters:value- the value of the high availability failover priorityReturns:the currentGPUdbBase.OptionsinstanceSee Also:setThreadCount
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 threadsReturns:the currentGPUdbBase.OptionsinstanceThrows:IllegalArgumentException- ifvalueis less than oneSee Also:setExecutor
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.setHttpHeaders
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.addHttpHeader
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 headerReturns:the currentGPUdbBase.OptionsinstanceSee Also:setClientInfo
Sets a client program name and version, which will be prepended to theUser-Agentheader sent with each request. PassnullforclientNameto clear any previously-set client info.Parameters:clientName- the client program name; passnullto clearclientVersion- the client program version, ornullif the client does not have a versionReturns:the currentGPUdbBase.OptionsinstanceSee Also:setHostManagerPort
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 numberReturns:the currentGPUdbBase.OptionsinstanceSee Also:setTimeout
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.setServerConnectionTimeout
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 valueReturns:the currentGPUdbBase.OptionsinstanceSee Also:setConnectionInactivityValidationTimeout
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 currentGPUdbBase.OptionsinstanceSee Also:setMaxTotalConnections
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 valueReturns:the currentGPUdbBase.OptionsinstanceSee Also:setMaxConnectionsPerHost
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 valueReturns:the currentGPUdbBase.OptionsinstanceSee Also:setMaxRetries
Sets the maximum number of retries for HTTP requests. Must be 0 at a minimum.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.setInitialConnectionAttemptTimeout
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 valueReturns:the currentGPUdbBase.OptionsinstanceSee Also: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 valueReturns:the currentGPUdbBase.OptionsinstanceSee Also:setFailbackOptions