Package com.terracottatech.store.manager
Interface ClusteredDatasetManagerBuilder
public interface ClusteredDatasetManagerBuilder
A ClusteredDatasetManagerBuilder allows configuration of the interaction with a cluster.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
The default connection timeout in milliseconds.static final long
The default reconnect timeout in milliseconds. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates the DatasetManager that has been configured using this ClusteredDatasetManagerBuilderwithClientAlias
(String alias) Sets an alias to identify this clustered client.default ClusteredDatasetManagerBuilder
withClientTags
(String... tags) Sets some tags to categorize this clustered client.withClientTags
(Set<String> tags) Sets some tags to categorize this clustered client.withConnectionProperties
(Properties properties) SetsProperties
for this clustered client's connection.withConnectionTimeout
(long timeout, TimeUnit unit) Configures thisDatasetManager
to use a specific connection timeout.withReconnectTimeout
(long timeout, TimeUnit unit) Configures thisDatasetManager
to use the specific reconnect timeout.
-
Field Details
-
DEFAULT_CONNECTION_TIMEOUT_MS
static final long DEFAULT_CONNECTION_TIMEOUT_MSThe default connection timeout in milliseconds.- See Also:
-
DEFAULT_RECONNECT_TIMEOUT_MS
static final long DEFAULT_RECONNECT_TIMEOUT_MSThe default reconnect timeout in milliseconds. A value of zero indicates no timeout.- See Also:
-
-
Method Details
-
build
Creates the DatasetManager that has been configured using this ClusteredDatasetManagerBuilder- Returns:
- a DatasetManager instance
- Throws:
StoreException
- if the creation of the DatasetManager fails
-
withConnectionTimeout
Configures thisDatasetManager
to use a specific connection timeout.The default timeout is given by
DEFAULT_CONNECTION_TIMEOUT_MS
.- Parameters:
timeout
- connection timeoutunit
- connection timeout unit- Returns:
- a
ClusteredDatasetManagerBuilder
to allow further configuration
-
withReconnectTimeout
Configures thisDatasetManager
to use the specific reconnect timeout. This is used, instead of thewithConnectionTimeout(long, java.util.concurrent.TimeUnit)
value when attempting to reconnect to a server following discovery of a dropped connection.The default timeout is given by
DEFAULT_RECONNECT_TIMEOUT_MS
. A value of zero indicates reconnection attempts do not time out.- Parameters:
timeout
- reconnect timeoutunit
- reconnect timeout unit- Returns:
- a
ClusteredDatasetManagerBuilder
to allow further configuration
-
withConnectionProperties
SetsProperties
for this clustered client's connection.- Parameters:
properties
- the clustered client's connection properties- Returns:
- a
ClusteredDatasetManagerBuilder
to allow further configuration
-
withClientAlias
Sets an alias to identify this clustered client. By default, one is randomly generated.- Parameters:
alias
- the clustered client's alias- Returns:
- a
ClusteredDatasetManagerBuilder
to allow further configuration
-
withClientTags
Sets some tags to categorize this clustered client. Replaces any previously set tags.- Parameters:
tags
- a list of tags- Returns:
- a
ClusteredDatasetManagerBuilder
to allow further configuration
-
withClientTags
Sets some tags to categorize this clustered client. Replaces any previously set tags.- Parameters:
tags
- a list of tags- Returns:
- a
ClusteredDatasetManagerBuilder
to allow further configuration
-