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 longThe default connection timeout in milliseconds.static final longThe 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 ClusteredDatasetManagerBuilderwithClientTags(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) SetsPropertiesfor this clustered client's connection.withConnectionTimeout(long timeout, TimeUnit unit) Configures thisDatasetManagerto use a specific connection timeout.withReconnectTimeout(long timeout, TimeUnit unit) Configures thisDatasetManagerto 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 thisDatasetManagerto use a specific connection timeout.The default timeout is given by
DEFAULT_CONNECTION_TIMEOUT_MS.- Parameters:
timeout- connection timeoutunit- connection timeout unit- Returns:
- a
ClusteredDatasetManagerBuilderto allow further configuration
-
withReconnectTimeout
Configures thisDatasetManagerto 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
ClusteredDatasetManagerBuilderto allow further configuration
-
withConnectionProperties
SetsPropertiesfor this clustered client's connection.- Parameters:
properties- the clustered client's connection properties- Returns:
- a
ClusteredDatasetManagerBuilderto 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
ClusteredDatasetManagerBuilderto 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
ClusteredDatasetManagerBuilderto 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
ClusteredDatasetManagerBuilderto allow further configuration
-