K - type for map keyV - type for map valuepublic interface ConsistentMapBuilder<K,V>
| Modifier and Type | Method and Description |
|---|---|
ConsistentMap<K,V> |
build()
Builds an consistent map based on the configuration options
supplied to this builder.
|
AsyncConsistentMap<K,V> |
buildAsyncMap()
Builds an async consistent map based on the configuration options
supplied to this builder.
|
ConsistentMapBuilder<K,V> |
withName(String name)
Sets the name of the map.
|
ConsistentMapBuilder<K,V> |
withPartitionsDisabled()
Disables distribution of map entries across multiple database partitions.
|
ConsistentMapBuilder<K,V> |
withSerializer(Serializer serializer)
Sets a serializer that can be used to serialize
both the keys and values inserted into the map.
|
ConsistentMapBuilder<K,V> |
withUpdatesDisabled()
Disables map updates.
|
ConsistentMapBuilder<K,V> withName(String name)
Each consistent map is identified by a unique map name.
Note: This is a mandatory parameter.
name - name of the consistent mapConsistentMapBuilder<K,V> withSerializer(Serializer serializer)
Note: This is a mandatory parameter.
serializer - serializerConsistentMapBuilder<K,V> withPartitionsDisabled()
When partitioning is disabled, the returned map will have a single partition that spans the entire cluster. Furthermore, the changes made to the map are ephemeral and do not survive a full cluster restart.
Disabling partitions is more appropriate when the returned map is used for coordination activities such as leader election and not for long term data persistence.
Note: By default partitions are enabled and entries in the map are durable.
ConsistentMapBuilder<K,V> withUpdatesDisabled()
Attempt to update the built map will throw UnsupportedOperationException.
ConsistentMap<K,V> build()
RuntimeException - if a mandatory parameter is missingAsyncConsistentMap<K,V> buildAsyncMap()
RuntimeException - if a mandatory parameter is missingCopyright © 2015. All rights reserved.