From 7a80c004396911a728f7c47d0879453da89dd58d Mon Sep 17 00:00:00 2001 From: Redkale <8730487+redkale@users.noreply.github.com> Date: Fri, 17 Jul 2020 12:13:45 +0800 Subject: [PATCH] --- src/org/redkale/source/CacheMemorySource.java | 10 ++++++++++ src/org/redkale/source/CacheSource.java | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/org/redkale/source/CacheMemorySource.java b/src/org/redkale/source/CacheMemorySource.java index 102508070..22e2bf8cd 100644 --- a/src/org/redkale/source/CacheMemorySource.java +++ b/src/org/redkale/source/CacheMemorySource.java @@ -454,6 +454,11 @@ public final class CacheMemorySource extends AbstractService i @Override public Map hmap(final String key, final Type type, int offset, int limit) { + return hmap(key, type, offset, limit, null); + } + + @Override + public Map hmap(final String key, final Type type, int offset, int limit, String pattern) { if (key == null) return new HashMap(); CacheEntry entry = container.get(key); if (entry == null || entry.isExpired() || entry.mapValue == null) return new HashMap(); @@ -606,6 +611,11 @@ public final class CacheMemorySource extends AbstractService i return CompletableFuture.supplyAsync(() -> hmap(key, type, offset, limit), getExecutor()); } + @Override + public CompletableFuture> hmapAsync(final String key, final Type type, int offset, int limit, String pattern) { + return CompletableFuture.supplyAsync(() -> hmap(key, type, offset, limit, pattern), getExecutor()); + } + @Override public CompletableFuture hgetAsync(final String key, final String field, final Type type) { return CompletableFuture.supplyAsync(() -> hget(key, field, type), getExecutor()); diff --git a/src/org/redkale/source/CacheSource.java b/src/org/redkale/source/CacheSource.java index 02e2f7125..61b4aa8f7 100644 --- a/src/org/redkale/source/CacheSource.java +++ b/src/org/redkale/source/CacheSource.java @@ -101,6 +101,8 @@ public interface CacheSource { public Map hmap(final String key, final Type type, int offset, int limit); + public Map hmap(final String key, final Type type, int offset, int limit, String pattern); + public T hget(final String key, final String field, final Type type); public String hgetString(final String key, final String field); @@ -336,6 +338,8 @@ public interface CacheSource { public CompletableFuture> hmapAsync(final String key, final Type type, int offset, int limit); + public CompletableFuture> hmapAsync(final String key, final Type type, int offset, int limit, String pattern); + public CompletableFuture hgetAsync(final String key, final String field, final Type type); public CompletableFuture hgetStringAsync(final String key, final String field);