Package org.redisson.api
Class MapOptions<K,V>
- java.lang.Object
-
- org.redisson.api.MapOptions<K,V>
-
- Type Parameters:
K
- key typeV
- value type
- Direct Known Subclasses:
LocalCachedMapOptions
public class MapOptions<K,V> extends Object
Configuration for Map object.- Author:
- Nikita Koksharov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MapOptions.WriteMode
-
Constructor Summary
Constructors Modifier Constructor Description protected
MapOptions()
protected
MapOptions(MapOptions<K,V> copy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K,V>
MapOptions<K,V>defaults()
Creates a new instance of MapOptions with default options.MapLoader<K,V>
getLoader()
int
getWriteBehindBatchSize()
int
getWriteBehindDelay()
MapOptions.WriteMode
getWriteMode()
MapWriter<K,V>
getWriter()
MapOptions<K,V>
loader(MapLoader<K,V> loader)
SetsMapLoader
object.MapOptions<K,V>
writeBehindBatchSize(int writeBehindBatchSize)
Sets write behind tasks batch size.MapOptions<K,V>
writeBehindDelay(int writeBehindDelay)
Sets write behind tasks execution delay.MapOptions<K,V>
writeMode(MapOptions.WriteMode writeMode)
Sets write mode.MapOptions<K,V>
writer(MapWriter<K,V> writer)
SetsMapWriter
object.
-
-
-
Constructor Detail
-
MapOptions
protected MapOptions()
-
MapOptions
protected MapOptions(MapOptions<K,V> copy)
-
-
Method Detail
-
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 typeV
- value type- Returns:
- MapOptions instance
-
writer
public MapOptions<K,V> writer(MapWriter<K,V> writer)
SetsMapWriter
object.- Parameters:
writer
- object- Returns:
- MapOptions instance
-
writeBehindBatchSize
public MapOptions<K,V> writeBehindBatchSize(int writeBehindBatchSize)
Sets write behind tasks batch size. During MapWriter methods execution all updates accumulated into a batch of specified size.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 would be applied with 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)
SetsMapLoader
object.- Parameters:
loader
- object- Returns:
- MapOptions instance
-
-