Class MapOptions<K,V>

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

public class MapOptions<K,V> extends Object
Configuration for Map object.
Author:
Nikita Koksharov
  • Constructor Details

    • MapOptions

      protected MapOptions()
    • MapOptions

      protected MapOptions(MapOptions<K,V> copy)
  • Method Details

    • defaults

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

      This is equivalent to:

           new MapOptions()
            .writer(null, null).loader(null);
       
      Type Parameters:
      K - key type
      V - value type
      Returns:
      MapOptions instance
    • writer

      public MapOptions<K,V> writer(MapWriter<K,V> writer)
      Sets MapWriter object.
      Parameters:
      writer - object
      Returns:
      MapOptions instance
    • getWriter

      public MapWriter<K,V> getWriter()
    • writeBehindBatchSize

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

      Default is 50

      Parameters:
      writeBehindBatchSize - - size of batch
      Returns:
      MapOptions instance
    • getWriteBehindBatchSize

      public int getWriteBehindBatchSize()
    • writeBehindDelay

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

      Default is 1000 milliseconds

      Parameters:
      writeBehindDelay - - delay in milliseconds
      Returns:
      MapOptions instance
    • getWriteBehindDelay

      public int getWriteBehindDelay()
    • writeMode

      public MapOptions<K,V> writeMode(MapOptions.WriteMode writeMode)
      Sets write mode.

      Default is MapOptions.WriteMode.WRITE_THROUGH

      Parameters:
      writeMode - - write mode
      Returns:
      MapOptions instance
    • getWriteMode

      public MapOptions.WriteMode getWriteMode()
    • loader

      public MapOptions<K,V> loader(MapLoader<K,V> loader)
      Sets MapLoader object.
      Parameters:
      loader - object
      Returns:
      MapOptions instance
    • getLoader

      public MapLoader<K,V> getLoader()