diff --git a/redisson/src/main/java/org/redisson/Redisson.java b/redisson/src/main/java/org/redisson/Redisson.java index a87b3cb6b..9f991391f 100755 --- a/redisson/src/main/java/org/redisson/Redisson.java +++ b/redisson/src/main/java/org/redisson/Redisson.java @@ -345,12 +345,12 @@ public final class Redisson implements RedissonClient { @Override public RLocalCachedMapCache getLocalCachedMapCache(String name, LocalCachedMapCacheOptions options) { - throw new UnsupportedOperationException("This feature is implemented in the Redisson PRO version -> https://redisson.pro"); + throw new UnsupportedOperationException("This feature is implemented in the Redisson PRO version. Visit https://redisson.pro"); } @Override public RLocalCachedMapCache getLocalCachedMapCache(String name, Codec codec, LocalCachedMapCacheOptions options) { - throw new UnsupportedOperationException("This feature is implemented in the Redisson PRO version -> https://redisson.pro"); + throw new UnsupportedOperationException("This feature is implemented in the Redisson PRO version. Visit https://redisson.pro"); } @Override diff --git a/redisson/src/main/java/org/redisson/RedissonReactive.java b/redisson/src/main/java/org/redisson/RedissonReactive.java index 686525038..d164b00ac 100644 --- a/redisson/src/main/java/org/redisson/RedissonReactive.java +++ b/redisson/src/main/java/org/redisson/RedissonReactive.java @@ -1188,6 +1188,16 @@ public class RedissonReactive implements RedissonReactiveClient { new RedissonMapReactive<>(map, ca), RLocalCachedMapReactive.class); } + @Override + public RLocalCachedMapCacheReactive getLocalCachedMapCache(String name, LocalCachedMapCacheOptions options) { + throw new UnsupportedOperationException("This feature is implemented in the Redisson PRO version. Visit https://redisson.pro"); + } + + @Override + public RLocalCachedMapCacheReactive getLocalCachedMapCache(String name, Codec codec, LocalCachedMapCacheOptions options) { + throw new UnsupportedOperationException("This feature is implemented in the Redisson PRO version. Visit https://redisson.pro"); + } + @Override public RTransactionReactive createTransaction(TransactionOptions options) { return new RedissonTransactionReactive(commandExecutor, options); diff --git a/redisson/src/main/java/org/redisson/RedissonRx.java b/redisson/src/main/java/org/redisson/RedissonRx.java index 6d78ff0b8..98269c153 100644 --- a/redisson/src/main/java/org/redisson/RedissonRx.java +++ b/redisson/src/main/java/org/redisson/RedissonRx.java @@ -1166,6 +1166,16 @@ public class RedissonRx implements RedissonRxClient { new RedissonMapRx<>(map, ce), RLocalCachedMapRx.class); } + @Override + public RLocalCachedMapCacheRx getLocalCachedMapCache(String name, LocalCachedMapCacheOptions options) { + throw new UnsupportedOperationException("This feature is implemented in the Redisson PRO version. Visit https://redisson.pro"); + } + + @Override + public RLocalCachedMapCacheRx getLocalCachedMapCache(String name, Codec codec, LocalCachedMapCacheOptions options) { + throw new UnsupportedOperationException("This feature is implemented in the Redisson PRO version. Visit https://redisson.pro"); + } + @Override public RTransactionRx createTransaction(TransactionOptions options) { return new RedissonTransactionRx(commandExecutor, options); diff --git a/redisson/src/main/java/org/redisson/api/RLocalCachedMapCacheReactive.java b/redisson/src/main/java/org/redisson/api/RLocalCachedMapCacheReactive.java new file mode 100644 index 000000000..e41181a00 --- /dev/null +++ b/redisson/src/main/java/org/redisson/api/RLocalCachedMapCacheReactive.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2013-2024 Nikita Koksharov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.redisson.api; + +/** + * Map object with local entry cache support. + *

+ * Each instance maintains local cache to achieve fast read operations. + * Suitable for maps which used mostly for read operations and network roundtrip delays are undesirable. + * + * @author Nikita Koksharov + * + * @param map key + * @param map value + */ +public interface RLocalCachedMapCacheReactive extends RMapCacheReactive, RLocalCachedMapReactive { + +} diff --git a/redisson/src/main/java/org/redisson/api/RLocalCachedMapCacheRx.java b/redisson/src/main/java/org/redisson/api/RLocalCachedMapCacheRx.java new file mode 100644 index 000000000..b3216e2b6 --- /dev/null +++ b/redisson/src/main/java/org/redisson/api/RLocalCachedMapCacheRx.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2013-2024 Nikita Koksharov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.redisson.api; + +/** + * Map object with local entry cache support. + *

+ * Each instance maintains local cache to achieve fast read operations. + * Suitable for maps which used mostly for read operations and network roundtrip delays are undesirable. + * + * @author Nikita Koksharov + * + * @param map key + * @param map value + */ +public interface RLocalCachedMapCacheRx extends RMapCacheRx, RLocalCachedMapRx { + +} diff --git a/redisson/src/main/java/org/redisson/api/RedissonReactiveClient.java b/redisson/src/main/java/org/redisson/api/RedissonReactiveClient.java index 82faad550..c39930578 100644 --- a/redisson/src/main/java/org/redisson/api/RedissonReactiveClient.java +++ b/redisson/src/main/java/org/redisson/api/RedissonReactiveClient.java @@ -1029,6 +1029,31 @@ public interface RedissonReactiveClient { */ RLocalCachedMapReactive getLocalCachedMap(org.redisson.api.options.LocalCachedMapOptions options); + /** + * Returns local cached map cache instance by name. + * Configured by parameters of options-object. + * + * @param type of key + * @param type of value + * @param name - name of object + * @param options - local map options + * @return LocalCachedMapCache object + */ + RLocalCachedMapCacheReactive getLocalCachedMapCache(String name, LocalCachedMapCacheOptions options); + + /** + * Returns local cached map cache instance by name using provided codec. + * Configured by parameters of options-object. + * + * @param type of key + * @param type of value + * @param name - name of object + * @param codec - codec for keys and values + * @param options - local map options + * @return LocalCachedMap object + */ + RLocalCachedMapCacheReactive getLocalCachedMapCache(String name, Codec codec, LocalCachedMapCacheOptions options); + /** * Returns set instance by name. * diff --git a/redisson/src/main/java/org/redisson/api/RedissonRxClient.java b/redisson/src/main/java/org/redisson/api/RedissonRxClient.java index 205e24af6..e3944539d 100644 --- a/redisson/src/main/java/org/redisson/api/RedissonRxClient.java +++ b/redisson/src/main/java/org/redisson/api/RedissonRxClient.java @@ -1020,6 +1020,31 @@ public interface RedissonRxClient { */ RLocalCachedMapRx getLocalCachedMap(org.redisson.api.options.LocalCachedMapOptions options); + /** + * Returns local cached map cache instance by name. + * Configured by parameters of options-object. + * + * @param type of key + * @param type of value + * @param name - name of object + * @param options - local map options + * @return LocalCachedMapCache object + */ + RLocalCachedMapCacheRx getLocalCachedMapCache(String name, LocalCachedMapCacheOptions options); + + /** + * Returns local cached map cache instance by name using provided codec. + * Configured by parameters of options-object. + * + * @param type of key + * @param type of value + * @param name - name of object + * @param codec - codec for keys and values + * @param options - local map options + * @return LocalCachedMap object + */ + RLocalCachedMapCacheRx getLocalCachedMapCache(String name, Codec codec, LocalCachedMapCacheOptions options); + /** * Returns set instance by name. *