Skip to content

Commit a25881c

Browse files
committed
Add client and cluster client config descriptions
Closes: #186
1 parent 08e37a2 commit a25881c

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,51 @@ all the results, you could override this:
130130
protected void complete(TarantoolPacket packet, TarantoolOp<?> future);
131131
```
132132

133+
### Client config options
134+
135+
The client configuration options are represented through the `TarantoolClientConfig` class.
136+
137+
Supported options are follow:
138+
139+
1. `username` is used to authenticate and authorize an user in a Taratool server instance.
140+
Default value is `null` that means client will attempt to auth as a *guest*.
141+
2. `password` is used to authenticate an user in a Taratool server instance.
142+
Default value is `null`.
143+
3. `defaultRequestSize` used to be an initial binary buffer size in bytes to send requests.
144+
Default value is `4096` (4 KB).
145+
4. `predictedFutures` is used to initialize an initial capacity of hash map which stores
146+
response futures. The client is asynchronous under the hood even though it provides
147+
a synchronous operations using `java.concurrent.CompletableFuture`.
148+
Default value is `(1024 * 1024) / 0.75) + 1`.
149+
5. `writerThreadPriority` describes a priority of writer thread.
150+
Default value is `Thread.NORM_PRIORITY` (5).
151+
6. `readerThreadPriority` describes a priority of reader thread.
152+
Default value is `Thread.NORM_PRIORITY` (5).
153+
7. `sharedBufferSize` sets a shared buffer size in bytes (place where client collects
154+
requests when socket is busy on write).
155+
Default value is `8 * 1024 * 1024` (8 MB).
156+
8. `directWriteFactor` is used as a factor to calculate a threshold whether
157+
request will be accommodated in the shared buffer. If the request size exceeds
158+
`directWriteFactor * sharedBufferSize` request is sent directly.
159+
Defualt value is `0.5`.
160+
9. `writeTimeoutMillis` sets the max time in ms to perform writing and send the bytes.
161+
Default value is 60 * 1000 (1 minute).
162+
10. `useNewCall` configures whether client has to use new *CALL* request signature or old
163+
one used to be active in Tarantool 1.6.
164+
Default value is `true`.
165+
11. `initTimeoutMilli` sets a max time in ms to establish connection to the server
166+
Default values is `60 * 1000L` (1 minute).
167+
12. `connectionTimeout` is a hint and can be passed to the socket providers which
168+
implement `ConfigurableSocketChannelProvider` interface. This hint should be
169+
interpreter as a connection timeout in ms per attempt where `0` means no limit.
170+
Default value is `2 * 1000` (2 seconds).
171+
13. `retryCount` is a hint and can be passed to the socket providers which
172+
implement `ConfigurableSocketChannelProvider` interface. This hint should be
173+
interpreter as a maximal number of attempts to connect to Tarantool instance.
174+
Default value is `3`.
175+
14. `operationExpiryTimeMillis` is a default request timeout in ms.
176+
Default value is `1000` (1 second).
177+
133178
## Spring NamedParameterJdbcTemplate usage example
134179

135180
The JDBC driver uses `TarantoolClient` implementation to provide a communication with server.
@@ -348,6 +393,20 @@ client.syncOps().insert(45, Arrays.asList(1, 1));
348393
The client does its best to catch the moment when there are no pending responses
349394
and perform a reconnection.
350395
396+
### Client config options
397+
398+
In addition to the options for [the standard client](#client-config-options), cluster
399+
config provides some extra options:
400+
401+
1. `executor` defines an executor that will be used as a thread of execution to retry writes.
402+
Default values is `null` which means the cluster client will use *a single thread executor*.
403+
2. `clusterDiscoveryEntryFunction` is a name of the stored function to be used to fetch list of
404+
instances.
405+
Default value is `null` (not set).
406+
3. `clusterDiscoveryDelayMillis` describes how often in ms to poll the server for a new list of
407+
cluster nodes.
408+
Default value is `60 * 1000` (1 minute).
409+
351410
## Where to get help
352411
353412
Got problems or questions? Post them on

0 commit comments

Comments
 (0)