mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-29 22:27:33 +00:00
[Update] HotDataCacheStore, Cleanable 更新Javadoc;
This commit is contained in:
parent
b4e9fdab7d
commit
ef70ac77cb
@ -1,10 +1,13 @@
|
||||
package net.lamgc.cgj.bot.cache;
|
||||
|
||||
/**
|
||||
* 可清理接口, 实现该接口代表该类拥有清理动作.
|
||||
* 可清理接口, 实现该接口代表该类具有清理动作.
|
||||
*/
|
||||
public interface Cleanable {
|
||||
|
||||
/**
|
||||
* 该方法需要CacheStore完成对过期Entry的清除.
|
||||
*/
|
||||
void clean() throws Exception;
|
||||
|
||||
}
|
||||
|
@ -133,6 +133,10 @@ public class HotDataCacheStore<T> implements CacheStore<T>, Cleanable {
|
||||
return current.supportedList() && parent.supportedList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查并清理已过期的Entry.
|
||||
* <p>该方法仅清理Current缓存库, 不会对上游缓存库造成影响.</p>
|
||||
*/
|
||||
@Override
|
||||
public void clean() {
|
||||
for(String key : this.current.keys()) {
|
||||
|
Loading…
Reference in New Issue
Block a user