public class ConfigCacheService extends Object
| 构造器和说明 |
|---|
ConfigCacheService() |
| 限定符和类型 | 方法和说明 |
|---|---|
static List<String> |
checkMd5()
Check md5.
|
static boolean |
dump(String dataId,
String group,
String tenant,
String content,
long lastModifiedTs,
String type)
Save config file and update md5 value in cache.
|
static boolean |
dumpBeta(String dataId,
String group,
String tenant,
String content,
long lastModifiedTs,
String betaIps)
Save config file and update md5 value in cache.
|
static boolean |
dumpChange(String dataId,
String group,
String tenant,
String content,
long lastModifiedTs)
Save config file and update md5 value in cache.
|
static boolean |
dumpTag(String dataId,
String group,
String tenant,
String tag,
String content,
long lastModifiedTs)
Save config file and update md5 value in cache.
|
static List<String> |
getBetaIps(String groupKey)
Get and return beta ip list.
|
static String |
getContentBetaMd5(String groupKey)
Get and return beta md5 value from cache.
|
static CacheItem |
getContentCache(String groupKey)
Get and return content cache.
|
static String |
getContentMd5(String groupKey)
Get and return content md5 value from cache.
|
static String |
getContentMd5(String groupKey,
String ip,
String tag) |
static String |
getContentTagMd5(String groupKey,
String tag)
Get and return tag md5 value from cache.
|
static long |
getLastModifiedTs(String groupKey) |
static int |
groupCount() |
static boolean |
hasGroupKey(String groupKey) |
static boolean |
isUptodate(String groupKey,
String md5) |
static boolean |
isUptodate(String groupKey,
String md5,
String ip,
String tag) |
static void |
releaseReadLock(String groupKey)
Release readLock.
|
static void |
reloadConfig()
Reload config.
|
static boolean |
remove(String dataId,
String group,
String tenant)
Delete config file, and delete cache.
|
static boolean |
removeBeta(String dataId,
String group,
String tenant)
Delete beta config file, and delete cache.
|
static boolean |
removeTag(String dataId,
String group,
String tenant,
String tag)
Delete tag config file, and delete cache.
|
static int |
tryReadLock(String groupKey)
Try to add read lock.
|
static void |
updateBetaMd5(String groupKey,
String md5,
List<String> ips4Beta,
long lastModifiedTs)
Update Beta md5 value.
|
static void |
updateMd5(String groupKey,
String md5,
long lastModifiedTs)
Update md5 value.
|
static void |
updateTagMd5(String groupKey,
String tag,
String md5,
long lastModifiedTs)
Update tag md5 value.
|
public static int groupCount()
public static boolean hasGroupKey(String groupKey)
public static boolean dump(String dataId, String group, String tenant, String content, long lastModifiedTs, String type)
dataId - dataId string value.group - group string value.tenant - tenant string value.content - content string value.lastModifiedTs - lastModifiedTs.type - file type.public static boolean dumpBeta(String dataId, String group, String tenant, String content, long lastModifiedTs, String betaIps)
dataId - dataId string value.group - group string value.tenant - tenant string value.content - content string value.lastModifiedTs - lastModifiedTs.betaIps - betaIps string value.public static boolean dumpTag(String dataId, String group, String tenant, String tag, String content, long lastModifiedTs)
dataId - dataId string value.group - group string value.tenant - tenant string value.content - content string value.lastModifiedTs - lastModifiedTs.tag - tag string value.public static boolean dumpChange(String dataId, String group, String tenant, String content, long lastModifiedTs)
dataId - dataId string value.group - group string value.tenant - tenant string value.content - content string value.lastModifiedTs - lastModifiedTs.public static void reloadConfig()
public static boolean remove(String dataId, String group, String tenant)
dataId - dataId string value.group - group string value.tenant - tenant string value.public static boolean removeBeta(String dataId, String group, String tenant)
dataId - dataId string value.group - group string value.tenant - tenant string value.public static boolean removeTag(String dataId, String group, String tenant, String tag)
dataId - dataId string value.group - group string value.tenant - tenant string value.tag - tag string value.public static void updateMd5(String groupKey, String md5, long lastModifiedTs)
groupKey - groupKey string value.md5 - md5 string value.lastModifiedTs - lastModifiedTs long value.public static void updateBetaMd5(String groupKey, String md5, List<String> ips4Beta, long lastModifiedTs)
groupKey - groupKey string value.md5 - md5 string value.ips4Beta - ips4Beta List.lastModifiedTs - lastModifiedTs long value.public static void updateTagMd5(String groupKey, String tag, String md5, long lastModifiedTs)
groupKey - groupKey string value.tag - tag string value.md5 - md5 string value.lastModifiedTs - lastModifiedTs long value.public static String getContentMd5(String groupKey)
public static String getContentBetaMd5(String groupKey)
public static String getContentTagMd5(String groupKey, String tag)
groupKey - groupKey string value.tag - tag string value.public static List<String> getBetaIps(String groupKey)
groupKey - groupKey string value.public static CacheItem getContentCache(String groupKey)
groupKey - groupKey string value.public static long getLastModifiedTs(String groupKey)
public static int tryReadLock(String groupKey)
releaseWriteLock(String).And it won't call if
failed.groupKey - groupKey string value.public static void releaseReadLock(String groupKey)
groupKey - groupKey string value.Copyright © 2018–2022 Alibaba Group. All rights reserved.