Class LocalCachedMapOptions<K,V>

java.lang.Object
org.redisson.api.MapOptions<K,V>
org.redisson.api.LocalCachedMapOptions<K,V>
Type Parameters:
K - key type
V - value type

@Deprecated public class LocalCachedMapOptions<K,V> extends MapOptions<K,V>
Deprecated.
Use org.redisson.api.options.LocalCachedMapOptions instead
Author:
Nikita Koksharov
  • Constructor Details

    • LocalCachedMapOptions

      protected LocalCachedMapOptions()
      Deprecated.
    • LocalCachedMapOptions

      protected LocalCachedMapOptions(LocalCachedMapOptions<K,V> copy)
      Deprecated.
  • Method Details

    • defaults

      public static <K, V> LocalCachedMapOptions<K,V> defaults()
      Deprecated.
      Creates a new instance of LocalCachedMapOptions with default options.

      This is equivalent to:

           new LocalCachedMapOptions()
            .cacheSize(0).timeToLive(0).maxIdle(0)
            .evictionPolicy(EvictionPolicy.NONE)
            .reconnectionStrategy(ReconnectionStrategy.NONE)
            .cacheProvider(CacheProvider.REDISSON)
            .syncStrategy(SyncStrategy.INVALIDATE)
            .storeCacheMiss(false);
       
      Type Parameters:
      K - key type
      V - value type
      Returns:
      LocalCachedMapOptions instance
    • getCacheProvider

      public LocalCachedMapOptions.CacheProvider getCacheProvider()
      Deprecated.
    • getEvictionPolicy

      public LocalCachedMapOptions.EvictionPolicy getEvictionPolicy()
      Deprecated.
    • getCacheSize

      public int getCacheSize()
      Deprecated.
    • getTimeToLiveInMillis

      public long getTimeToLiveInMillis()
      Deprecated.
    • getMaxIdleInMillis

      public long getMaxIdleInMillis()
      Deprecated.
    • cacheSize

      public LocalCachedMapOptions<K,V> cacheSize(int cacheSize)
      Deprecated.
      Defines local cache size.

      If size is 0 then local cache is unbounded.

      If size is -1 then local cache is always empty and doesn't store data.

      Parameters:
      cacheSize - size of cache
      Returns:
      LocalCachedMapOptions instance
    • getReconnectionStrategy

      public LocalCachedMapOptions.ReconnectionStrategy getReconnectionStrategy()
      Deprecated.
    • getSyncStrategy

      public LocalCachedMapOptions.SyncStrategy getSyncStrategy()
      Deprecated.
    • reconnectionStrategy

      public LocalCachedMapOptions<K,V> reconnectionStrategy(LocalCachedMapOptions.ReconnectionStrategy reconnectionStrategy)
      Deprecated.
      Defines strategy for load missed local cache updates after Redis connection failure.
      Parameters:
      reconnectionStrategy -

      CLEAR - clear local cache if map instance has been disconnected for a while.

      LOAD - store invalidated entry hash in invalidation log for 10 minutes. Cache keys for stored invalidated entry hashes will be removed if LocalCachedMap instance has been disconnected less than 10 minutes or whole cache will be cleaned otherwise

      NONE - Default. No reconnection handling

      Returns:
      LocalCachedMapOptions instance
    • syncStrategy

      public LocalCachedMapOptions<K,V> syncStrategy(LocalCachedMapOptions.SyncStrategy syncStrategy)
      Deprecated.
      Defines local cache synchronization strategy.
      Parameters:
      syncStrategy -

      INVALIDATE - Default. Invalidate cache entry across all LocalCachedMap instances on map entry change

      UPDATE - Insert/update cache entry across all LocalCachedMap instances on map entry change

      NONE - No synchronizations on map changes

      Returns:
      LocalCachedMapOptions instance
    • evictionPolicy

      public LocalCachedMapOptions<K,V> evictionPolicy(LocalCachedMapOptions.EvictionPolicy evictionPolicy)
      Deprecated.
      Defines local cache eviction policy.
      Parameters:
      evictionPolicy -

      LRU - uses local cache with LRU (least recently used) eviction policy.

      LFU - uses local cache with LFU (least frequently used) eviction policy.

      SOFT - uses local cache with soft references. The garbage collector will evict items from the local cache when the JVM is running out of memory.

      WEAK - uses local cache with weak references. The garbage collector will evict items from the local cache when it became weakly reachable.

      NONE - doesn't use eviction policy, but timeToLive and maxIdleTime params are still working.

      Returns:
      LocalCachedMapOptions instance
    • timeToLive

      public LocalCachedMapOptions<K,V> timeToLive(long timeToLiveInMillis)
      Deprecated.
      Defines time to live in milliseconds of each map entry in local cache. If value equals to 0 then timeout is not applied
      Parameters:
      timeToLiveInMillis - - time to live in milliseconds
      Returns:
      LocalCachedMapOptions instance
    • timeToLive

      public LocalCachedMapOptions<K,V> timeToLive(long timeToLive, TimeUnit timeUnit)
      Deprecated.
      Defines time to live of each map entry in local cache. If value equals to 0 then timeout is not applied
      Parameters:
      timeToLive - - time to live
      timeUnit - - time unit
      Returns:
      LocalCachedMapOptions instance
    • maxIdle

      public LocalCachedMapOptions<K,V> maxIdle(long maxIdleInMillis)
      Deprecated.
      Defines max idle time in milliseconds of each map entry in local cache. If value equals to 0 then timeout is not applied
      Parameters:
      maxIdleInMillis - - time to live in milliseconds
      Returns:
      LocalCachedMapOptions instance
    • maxIdle

      public LocalCachedMapOptions<K,V> maxIdle(long maxIdle, TimeUnit timeUnit)
      Deprecated.
      Defines max idle time of each map entry in local cache. If value equals to 0 then timeout is not applied
      Parameters:
      maxIdle - - max idle time
      timeUnit - - time unit
      Returns:
      LocalCachedMapOptions instance
    • getStoreMode

      public LocalCachedMapOptions.StoreMode getStoreMode()
      Deprecated.
    • storeMode

      Deprecated.
      Defines store mode of cache data.
      Parameters:
      storeMode -

      LOCALCACHE - store data in local cache only.

      LOCALCACHE_REDIS - store data in both Redis and local cache.

      Returns:
      LocalCachedMapOptions instance
    • cacheProvider

      public LocalCachedMapOptions<K,V> cacheProvider(LocalCachedMapOptions.CacheProvider cacheProvider)
      Deprecated.
      Defines Cache provider used as local cache store.
      Parameters:
      cacheProvider -

      REDISSON - uses Redisson own implementation.

      CAFFEINE - uses Caffeine implementation.

      Returns:
      LocalCachedMapOptions instance
    • isStoreCacheMiss

      public boolean isStoreCacheMiss()
      Deprecated.
    • storeCacheMiss

      public LocalCachedMapOptions<K,V> storeCacheMiss(boolean storeCacheMiss)
      Deprecated.
      Defines whether to store a cache miss into the local cache.
      Parameters:
      storeCacheMiss - - whether to store a cache miss into the local cache
      Returns:
      LocalCachedMapOptions instance
    • useKeyEventsPattern

      @Deprecated public LocalCachedMapOptions<K,V> useKeyEventsPattern(boolean useKeyEventsPattern)
      Deprecated.
      Parameters:
      useKeyEventsPattern - - whether to use __keyevent pattern topic
      Returns:
      LocalCachedMapOptions instance
    • expirationEventPolicy

      public LocalCachedMapOptions<K,V> expirationEventPolicy(LocalCachedMapOptions.ExpirationEventPolicy expirationEventPolicy)
      Deprecated.
      Defines how to listen expired event sent by Redis upon this instance deletion.
      Parameters:
      expirationEventPolicy - expiration policy value
      Returns:
      LocalCachedMapOptions instance
    • getExpirationEventPolicy

      public LocalCachedMapOptions.ExpirationEventPolicy getExpirationEventPolicy()
      Deprecated.
    • writeBehindBatchSize

      public LocalCachedMapOptions<K,V> writeBehindBatchSize(int writeBehindBatchSize)
      Deprecated.
      Description copied from class: MapOptions
      Sets write behind tasks batch size. All updates accumulated into a batch of specified size and written with MapWriter.

      Default is 50

      Overrides:
      writeBehindBatchSize in class MapOptions<K,V>
      Parameters:
      writeBehindBatchSize - - size of batch
      Returns:
      MapOptions instance
    • writeBehindDelay

      public LocalCachedMapOptions<K,V> writeBehindDelay(int writeBehindDelay)
      Deprecated.
      Description copied from class: MapOptions
      Sets write behind tasks execution delay. All updates written with MapWriter and lag not more than specified delay.

      Default is 1000 milliseconds

      Overrides:
      writeBehindDelay in class MapOptions<K,V>
      Parameters:
      writeBehindDelay - - delay in milliseconds
      Returns:
      MapOptions instance
    • writer

      public LocalCachedMapOptions<K,V> writer(MapWriter<K,V> writer)
      Deprecated.
      Description copied from class: MapOptions
      Defines MapWriter object which is invoked during write operation.
      Overrides:
      writer in class MapOptions<K,V>
      Parameters:
      writer - object
      Returns:
      MapOptions instance
    • writerAsync

      public LocalCachedMapOptions<K,V> writerAsync(MapWriterAsync<K,V> writer)
      Deprecated.
      Description copied from class: MapOptions
      Defines MapWriterAsync object which is invoked during write operation.
      Overrides:
      writerAsync in class MapOptions<K,V>
      Parameters:
      writer - object
      Returns:
      MapOptions instance
    • writeMode

      public LocalCachedMapOptions<K,V> writeMode(MapOptions.WriteMode writeMode)
      Deprecated.
      Description copied from class: MapOptions
      Sets write mode.

      Default is MapOptions.WriteMode.WRITE_THROUGH

      Overrides:
      writeMode in class MapOptions<K,V>
      Parameters:
      writeMode - - write mode
      Returns:
      MapOptions instance
    • loader

      public LocalCachedMapOptions<K,V> loader(MapLoader<K,V> loader)
      Deprecated.
      Description copied from class: MapOptions
      Sets MapLoader object.
      Overrides:
      loader in class MapOptions<K,V>
      Parameters:
      loader - object
      Returns:
      MapOptions instance
    • loaderAsync

      public LocalCachedMapOptions<K,V> loaderAsync(MapLoaderAsync<K,V> loaderAsync)
      Deprecated.
      Description copied from class: MapOptions
      Sets MapLoaderAsync object.
      Overrides:
      loaderAsync in class MapOptions<K,V>
      Parameters:
      loaderAsync - object
      Returns:
      MapOptions instance
    • writerRetryAttempts

      public LocalCachedMapOptions<K,V> writerRetryAttempts(int writerRetryAttempts)
      Deprecated.
      Description copied from class: MapOptions
      Sets max retry attempts for RetryableMapWriter or RetryableMapWriterAsync
      Overrides:
      writerRetryAttempts in class MapOptions<K,V>
      Parameters:
      writerRetryAttempts - object
      Returns:
      MapOptions instance
    • writerRetryInterval

      public LocalCachedMapOptions<K,V> writerRetryInterval(Duration writerRetryInterval)
      Deprecated.
      Description copied from class: MapOptions
      Sets retry interval for RetryableMapWriter or RetryableMapWriterAsync
      Overrides:
      writerRetryInterval in class MapOptions<K,V>
      Parameters:
      writerRetryInterval - Duration
      Returns:
      MapOptions instance