public class Caches extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
IN_MEMORY
内存型
|
static String |
REDIS
redis型
|
static String |
SEMANTIC_CSS
语义缓存(CSS)
|
static String |
SEMANTIC_REDIS
语义缓存(Redis)
|
static String |
SQL
sql 关系型
|
| Constructor and Description |
|---|
Caches() |
| Modifier and Type | Method and Description |
|---|---|
static Cache |
of(CacheStoreConfig storeConfig)
获取一个Cache实例
|
static Cache |
of(String cacheName)
获取一个Cache实例
|
static Cache |
of(String cacheName,
CacheStoreConfig cacheStoreConfig)
获取一个Cache实例
|
static <T extends Cache,C extends ServerInfo> |
register(Class<T> clazz,
String cacheName,
Class<C> clazzConf)
注册
|
public static final String IN_MEMORY
public static final String REDIS
public static final String SQL
public static final String SEMANTIC_REDIS
public static final String SEMANTIC_CSS
public static <T extends Cache,C extends ServerInfo> void register(Class<T> clazz, String cacheName, Class<C> clazzConf)
T - 模板类, 缓存C - 模板类, 配置clazz - Cache类cacheName - 名称clazzConf - 配置类public static Cache of(CacheStoreConfig storeConfig)
storeConfig - StoreConfig,必须包含cacheName字段public static Cache of(String cacheName)
cacheName - 模型名称public static Cache of(String cacheName, CacheStoreConfig cacheStoreConfig)
cacheName - 模型名称cacheStoreConfig - 存储配置PanguDevSDKException - 构造函数不存在Copyright © 2024. All rights reserved.