Package org.apache.solr.blockcache
Class BlockDirectoryCache
java.lang.Object
org.apache.solr.blockcache.BlockDirectoryCache
- All Implemented Interfaces:
Cache
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorsConstructorDescriptionBlockDirectoryCache(BlockCache blockCache, String path, Metrics metrics) BlockDirectoryCache(BlockCache blockCache, String path, Metrics metrics, boolean releaseBlocks) -
Method Summary
Modifier and TypeMethodDescriptionvoidRemove a file from the cache.booleanFetch the specified cache file content.Expert: mostly for testsvoidRelease any resources associated with the cache.voidrenameCacheFile(String source, String dest) Expert: Rename the specified file in the cache.longsize()Number of entries in the cache.voidUpdate the content of the specified cache file.
-
Constructor Details
-
BlockDirectoryCache
-
BlockDirectoryCache
public BlockDirectoryCache(BlockCache blockCache, String path, Metrics metrics, boolean releaseBlocks)
-
-
Method Details
-
getBlockCache
Expert: mostly for tests- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
delete
Description copied from interface:CacheRemove a file from the cache. -
update
public void update(String name, long blockId, int blockOffset, byte[] buffer, int offset, int length) Description copied from interface:CacheUpdate the content of the specified cache file. Creates cache entry if necessary. -
fetch
public boolean fetch(String name, long blockId, int blockOffset, byte[] b, int off, int lengthToReadInBlock) Description copied from interface:CacheFetch the specified cache file content. -
size
public long size()Description copied from interface:CacheNumber of entries in the cache. -
renameCacheFile
Description copied from interface:CacheExpert: Rename the specified file in the cache. Allows a file to be moved without invalidating the cache.- Specified by:
renameCacheFilein interfaceCache- Parameters:
source- original namedest- final name
-
releaseResources
public void releaseResources()Description copied from interface:CacheRelease any resources associated with the cache.- Specified by:
releaseResourcesin interfaceCache
-