Package org.miaixz.bus.core.cache.file
Class LFUFileCache
java.lang.Object
org.miaixz.bus.core.cache.file.AbstractFileCache
org.miaixz.bus.core.cache.file.LFUFileCache
- All Implemented Interfaces:
Serializable
使用LFU缓存文件,以解决频繁读取文件引起的性能问题
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Field Summary
Fields inherited from class org.miaixz.bus.core.cache.file.AbstractFileCache
cache, capacity, maxFileSize, timeout, usedSize -
Constructor Summary
ConstructorsConstructorDescriptionLFUFileCache(int capacity) 构造 最大文件大小为缓存容量的一半 默认无超时LFUFileCache(int capacity, int maxFileSize) 构造 默认无超时LFUFileCache(int capacity, int maxFileSize, long timeout) 构造 -
Method Summary
Methods inherited from class org.miaixz.bus.core.cache.file.AbstractFileCache
capacity, clear, getCachedFilesCount, getFileBytes, getFileBytes, getUsedSize, maxFileSize, timeout
-
Constructor Details
-
LFUFileCache
public LFUFileCache(int capacity) 构造 最大文件大小为缓存容量的一半 默认无超时- Parameters:
capacity- 缓存容量
-
LFUFileCache
public LFUFileCache(int capacity, int maxFileSize) 构造 默认无超时- Parameters:
capacity- 缓存容量maxFileSize- 最大文件大小
-
LFUFileCache
public LFUFileCache(int capacity, int maxFileSize, long timeout) 构造- Parameters:
capacity- 缓存容量maxFileSize- 文件最大大小timeout- 默认超时时间,0表示无默认超时
-
-
Method Details
-
initCache
Description copied from class:AbstractFileCache初始化实现文件缓存的缓存对象- Specified by:
initCachein classAbstractFileCache- Returns:
Cache
-