public class JCacheBucketBuilder extends AbstractBucketBuilder<JCacheBucketBuilder>
| Constructor and Description |
|---|
JCacheBucketBuilder()
Creates the new instance of
JCacheBucketBuilder |
| Modifier and Type | Method and Description |
|---|---|
<K extends Serializable> |
build(javax.cache.Cache<K,GridBucketState> cache,
K key,
RecoveryStrategy recoveryStrategy)
Constructs an instance of
GridBucket which state actually stored inside in-memory data-grid,
the bucket stored in the grid immediately, so one network request will be issued to grid. |
addLimit, buildConfigurationpublic JCacheBucketBuilder()
JCacheBucketBuilderpublic <K extends Serializable> Bucket build(javax.cache.Cache<K,GridBucketState> cache, K key, RecoveryStrategy recoveryStrategy)
GridBucket which state actually stored inside in-memory data-grid,
the bucket stored in the grid immediately, so one network request will be issued to grid.
Due to this method performs network IO, returned result must not be treated as light-weight entity,
it will be a performance anti-pattern to use this method multiple times for same key,
you need to cache result somewhere and reuse between invocations,
else performance of all operation with bucket will be 2-x times slower.
Use this method if and only if you need to full control over bucket lifecycle(especially specify RecoveryStrategy),
and you have clean caching strategy which suitable for storing buckets,
else it would be better to work through ProxyManager,
which does not require any caching, because ProxyManager operates with light-weight versions of buckets.
cache - distributed cache which will hold bucket inside cluster.
Feel free to store inside single cache as mush buckets as you need.key - for storing bucket inside cache.
If you plan to store multiple buckets inside single cache, then each bucket should has own unique key.recoveryStrategy - specifies the reaction which should be applied in case of previously saved state of bucket has been lost.Copyright © 2021. All rights reserved.