docs updated

pull/6272/head
Nikita Koksharov 3 months ago
parent 0d6fb4b301
commit 6e7076aa5d

@ -640,7 +640,8 @@ List<SimpleValue> oldValues = map.replaceValues(new SimpleKey("0"), newValues);
List<SimpleValue> removedValues = map.removeAll(new SimpleKey("0"));
```
### Multimap eviction
### Eviction
Multimap distributed object for Java with eviction support implemented by separated MultimapCache object. There are [RSetMultimapCache](https://static.javadoc.io/org.redisson/redisson/latest/org/redisson/api/RSetMultimapCache.html) and [RListMultimapCache](https://static.javadoc.io/org.redisson/redisson/latest/org/redisson/api/RListMultimapCache.html) objects for Set and List based Multimaps respectively.
Eviction task is started once per unique object name at the moment of getting Multimap instance. If instance isn't used and has expired entries it should be get again to start the eviction process. This leads to extra Redis or Valkey calls and eviction task per unique map object name.
@ -663,6 +664,50 @@ multimap.expireKey("2", 10, TimeUnit.MINUTES);
multimap.destroy();
```
### Listeners
Redisson allows binding listeners per `RSetMultimap` or `RListMultimap` object. This requires the `notify-keyspace-events` setting to be enabled on Redis or Valkey side.
`RSetMultimap` listeners:
|Listener class name|Event description | Valkey or Redis<br/>`notify-keyspace-events` value|
|:--:|:--:|:--:|
|org.redisson.api.ExpiredObjectListener|`RSetMultimap` object expired| Ex|
|org.redisson.api.DeletedObjectListener|`RSetMultimap` object deleted| Eg|
|org.redisson.api.listener.SetAddListener|Element added to entry| Es|
|org.redisson.api.listener.SetRemoveListener|Element removed from entry| Es|
|org.redisson.api.listener.MapPutListener|Entry created|Eh|
|org.redisson.api.listener.MapRemoveListener|Entry removed|Eh|
`RListMultimap` listeners:
|Listener class name|Event description | Valkey or Redis<br/>`notify-keyspace-events` value|
|:--:|:--:|:--:|
|org.redisson.api.ExpiredObjectListener|`RListMultimap` object expired| Ex|
|org.redisson.api.DeletedObjectListener|`RListMultimap` object deleted| Eg|
|org.redisson.api.listener.ListAddListener|Element added to entry| Es|
|org.redisson.api.listener.ListRemoveListener|Element removed from entry| Es|
|org.redisson.api.listener.MapPutListener|Entry created|Eh|
|org.redisson.api.listener.MapRemoveListener|Entry removed|Eh|
Usage example:
```java
RListMultimap<Integer, Integer> lmap = redisson.getListMultimap("mymap");
int listenerId = lmap.addListener(new MapPutListener() {
@Override
public void onPut(String name) {
// ...
}
});
// ...
lmap.removeListener(listenerId);
```
## JSON Store
_This feature is available only in [Redisson PRO](https://redisson.pro) edition._

@ -14,6 +14,7 @@ Codec class name| Description
`org.redisson.codec.MsgPackJacksonCodec`| [MsgPack](http://msgpack.org/) binary json codec
`org.redisson.codec.IonJacksonCodec`| [Amazon Ion](https://amzn.github.io/ion-docs/) codec
`org.redisson.codec.SerializationCodec`| JDK Serialization binary codec<br/>(**Android** compatible)
`org.redisson.codec.ZStdCodec`| [ZStandard](https://github.com/luben/zstd-jni) compression codec.<br/> Uses `Kryo5Codec` for serialization by default
`org.redisson.codec.LZ4Codec`| [LZ4](https://github.com/jpountz/lz4-java) compression codec.<br/> Uses `Kryo5Codec` for serialization by default
`org.redisson.codec.LZ4CodecV2`| [LZ4 Apache Commons](https://github.com/apache/commons-compress) compression codec.<br/> Uses `Kryo5Codec` for serialization by default
`org.redisson.codec.SnappyCodecV2` | Snappy compression codec based on [snappy-java](https://github.com/xerial/snappy-java) project.<br/> Uses `Kryo5Codec` for serialization by default

Loading…
Cancel
Save