public static class PooledQldbDriver.PooledQldbDriverBuilder extends Object
PooledQldbSession
, allowing for configuration of the parameters of construction.Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_READAHEAD |
protected ExecutorService |
executorService |
protected int |
readAhead |
protected static String |
VERSION |
Modifier | Constructor and Description |
---|---|
protected |
PooledQldbDriverBuilder()
Restricted constructor.
|
Modifier and Type | Method and Description |
---|---|
TypeToBuild |
build()
Build a
TypeToBuild instance using the current configuration set with the builder. |
protected PooledQldbDriver |
createDriver()
Create a new driver instance using the current configuration.
|
protected Subclass |
getSubclass()
Helper method to returned a type cast version of this builder as the subclass type.
|
protected String |
getVersion()
Retrieve the version string for the driver.
|
Subclass |
withIonSystem(com.amazon.ion.IonSystem ionSystem)
Specify the
IonSystem that should be used for the driver's sessions. |
Subclass |
withLedger(String ledgerName)
Specify the ledger that should be used for the driver's sessions.
|
PooledQldbDriver.PooledQldbDriverBuilder |
withPoolLimit(int poolLimit)
Specify the limit to the pool of available sessions.
|
PooledQldbDriver.PooledQldbDriverBuilder |
withPoolTimeout(int timeout)
Specify the timeout to wait for an available session to return to the pool in milliseconds.
|
B |
withReadAhead(int readAhead)
Specify the number of read-ahead buffers, determining the amount of sets of results buffered in memory,
for each open result set, created within the driver.
|
B |
withReadAhead(int readAhead,
ExecutorService executorService)
Specify the number of read-ahead buffers, determining the amount of sets of results buffered in memory,
for each open result set, created within the driver.
|
Subclass |
withRetryLimit(int retryLimit)
Specify the retry limit that any convenience execute methods provided by sessions created from the driver will attempt.
|
Subclass |
withSessionClientBuilder(com.amazonaws.services.qldbsession.AmazonQLDBSessionClientBuilder clientBuilder)
Specify the low level session builder that should be used for creating the low level session used for
communication in the driver.
|
protected static final String VERSION
protected static final int DEFAULT_READAHEAD
protected int readAhead
protected ExecutorService executorService
protected PooledQldbDriverBuilder()
PooledQldbDriver.builder()
to retrieve an instance of this class.public PooledQldbDriver.PooledQldbDriverBuilder withPoolLimit(int poolLimit)
poolLimit
- The maximum number of sessions that can be created from the pool at any one time. This amount cannot
exceed the amount set in the ClientConfiguration
of the
AmazonQLDBSessionClientBuilder
used for this builder.public PooledQldbDriver.PooledQldbDriverBuilder withPoolTimeout(int timeout)
PooledQldbDriver.getSession()
will wait until the timeout before throwing an exception if an available session is still
not returned to the pool.timeout
- The maximum amount of time to wait, in milliseconds.protected PooledQldbDriver createDriver()
public B withReadAhead(int readAhead)
ExecutorService
for the threads, see withReadAhead(int, ExecutorService)
.
When the executor is not provided, a new Thread
is created to perform the retrieval.readAhead
- The number of read-ahead buffers for each open result set, 0 for no asynchronous read-ahead.public B withReadAhead(int readAhead, ExecutorService executorService)
ExecutorService
will be used to
asynchronously retrieved results. To simply start new threads, see withReadAhead(int)
.readAhead
- The number of read-ahead buffers for each open result set, 0 for no asynchronous read-ahead.executorService
- The executor to be used by the retrieval thread.protected String getVersion()
public TypeToBuild build()
TypeToBuild
instance using the current configuration set with the builder.TypeToBuild
.public Subclass withIonSystem(com.amazon.ion.IonSystem ionSystem)
IonSystem
that should be used for the driver's sessions.ionSystem
- The IonSystem
to use.public Subclass withLedger(String ledgerName)
ledgerName
- The name of the ledger to create a driver with.public Subclass withRetryLimit(int retryLimit)
retryLimit
- The number of retry attempts to be made by the session.public Subclass withSessionClientBuilder(com.amazonaws.services.qldbsession.AmazonQLDBSessionClientBuilder clientBuilder)
clientBuilder
- The builder used to create the low-level session.protected Subclass getSubclass()