This commit is contained in:
Redkale
2017-11-09 10:21:16 +08:00
parent eabdc13c53
commit 5e13575e84
2 changed files with 1 additions and 16 deletions

View File

@@ -75,11 +75,6 @@ public class CacheMemorySource<V extends Object> extends AbstractService impleme
this.needStore = !flag;
}
@Override
public boolean isSupportQueryList() {
return true;
}
@Override
public void init(AnyValue conf) {
if (this.convert == null) this.convert = this.defaultConvert;
@@ -160,7 +155,7 @@ public class CacheMemorySource<V extends Object> extends AbstractService impleme
}
if (remoteSource != null && !Sncp.isRemote(this)) {
SncpClient client = Sncp.getSncpClient((Service) remoteSource);
if (client != null && client.getRemoteGroupTransport() != null && remoteSource.isSupportQueryList()) {
if (client != null && client.getRemoteGroupTransport() != null) {
super.runAsync(() -> {
try {
CompletableFuture<List<CacheEntry<Object>>> listFuture = remoteSource.queryListAsync();

View File

@@ -30,11 +30,6 @@ public interface CacheSource<V extends Object> {
return true;
}
//是否支持queryList 或 queryListAsync 方法
default boolean isSupportQueryList() {
return false;
}
public boolean exists(final String key);
public V get(final String key);
@@ -112,11 +107,6 @@ public interface CacheSource<V extends Object> {
return CompletableFuture.completedFuture(isOpen());
}
//是否支持queryList 或 queryListAsync 方法
default CompletableFuture<Boolean> isSupportQueryListAsync() {
return CompletableFuture.completedFuture(isSupportQueryList());
}
public static enum CacheEntryType {
OBJECT, SET, LIST;
}