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> |
withApplicationId(ApplicationId id)
Sets the owner applicationId for the map.
|
ConsistentMapBuilder<K,V> |
withMeteringDisabled()
Instantiates Metering service to gather usage and performance metrics.
|
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> |
withPurgeOnUninstall()
Purges map contents when the application owning the map is uninstalled.
|
ConsistentMapBuilder<K,V> |
withRelaxedReadConsistency()
Provides weak consistency for map gets.
|
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> withApplicationId(ApplicationId id)
Note: If purgeOnUninstall option is enabled, applicationId
must be specified.
id - applicationId owning 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.
ConsistentMapBuilder<K,V> withPurgeOnUninstall()
When this option is enabled, the caller must provide a applicationId via
the withAppliationId builder method.
By default map entries will NOT be purged when owning application is uninstalled.
ConsistentMapBuilder<K,V> withMeteringDisabled()
ConsistentMapBuilder<K,V> withRelaxedReadConsistency()
While this can lead to improved read performance, it can also make the behavior heard to reason. Only turn this on if you know what you are doing. By default reads are strongly consistent.
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.