public class Session extends Object implements AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
Session.SecurityOptions
Optional configuration for establishing a secure connection.
|
Constructor and Description |
---|
Session()
Initialize a new Session without security settings.
|
Session(Session.SecurityOptions securityOptions)
Initialize a new Session with security settings.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
static Session |
connect(Session.SecurityOptions options,
String uri)
Establishes a secure connection
|
static Session |
connect(String uri)
Establishes a connection
|
protected void |
finalize() |
long |
getClientMaxParallelism()
Returns the current input buffer size (in bytes).
|
long |
getInputBufferSize()
Returns the current input buffer size (in bytes).
|
long |
handle() |
boolean |
isClosed() |
void |
setClientMaxParallelism(long threadCount)
Set maximum client parallelism for this session.
|
void |
setInputBufferSize(long size)
Set input buffer size for this session.
|
void |
setTimeout(int timeoutMillis)
Set network timeout for this session.
|
void |
throwIfClosed() |
void |
waitForStabilization(int timeoutMillis)
Wait for all nodes of the cluster to be stabilized.
|
public Session()
public Session(Session.SecurityOptions securityOptions)
public static Session connect(String uri)
uri
- Fully qualified quasardb cluster uri, e.g. qdb://127.0.0.1:2836public static Session connect(Session.SecurityOptions options, String uri)
options
- Security options for authenticating with clusteruri
- Fully qualified quasardb cluster uri, e.g. qdb://127.0.0.1:2836public void close()
close
in interface AutoCloseable
public boolean isClosed()
public void throwIfClosed()
protected void finalize() throws Throwable
public long handle()
public void setTimeout(int timeoutMillis) throws ClusterClosedException
timeoutMillis
- The timeout of the operation, in millisecondsClusterClosedException
- If QdbCluster.close() has been called.public void setInputBufferSize(long size) throws ClusterClosedException
InputBufferTooSmallException
while retrieving data from the server.size
- The desired size (in bytes) of the input buffer.ClusterClosedException
- If the connection to the cluster is currently closed.public long getInputBufferSize() throws ClusterClosedException
ClusterClosedException
- If the connection to the cluster is currently closed.public void setClientMaxParallelism(long threadCount) throws ClusterClosedException
threadCount
- The desired maximum number of threads to use for query execution, or 0ClusterClosedException
- If the connection to the cluster is currently closed.public long getClientMaxParallelism() throws ClusterClosedException
ClusterClosedException
- If the connection to the cluster is currently closed.public void waitForStabilization(int timeoutMillis) throws ClusterClosedException
timeoutMillis
- The timeout of the operation, in millisecondsClusterClosedException
- If the connection to the cluster is currently closed.Copyright © 2021. All rights reserved.