Package org.opengrok.indexer.history
Class FileAnnotationCache
java.lang.Object
org.opengrok.indexer.history.AbstractCache
org.opengrok.indexer.history.FileAnnotationCache
- All Implemented Interfaces:
 AnnotationCache,Cache
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidclear(RepositoryInfo repository) Clear the cache for a repository.Retrieve annotation from cache.getInfo()Get a string with information about the cache.voidCreate and initialize an empty cache if one doesn't exist already.booleanisUpToDate(File file) This is potentially expensive operation as the cache entry has to be retrieved from disk in order to tell whether it is stale or not.voidoptimize()Optimize how the history is stored on disk.voidstore(File file, Annotation annotation) Store annotation for file into cache.booleansupportsRepository(Repository repository) Check whether this cache implementation can store history for the given repository.Methods inherited from class org.opengrok.indexer.history.AbstractCache
clearCache, clearFile, hasCacheForFileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opengrok.indexer.history.AnnotationCache
clearFileMethods inherited from interface org.opengrok.indexer.history.Cache
clearCache, hasCacheForFile 
- 
Constructor Details
- 
FileAnnotationCache
public FileAnnotationCache() 
 - 
 - 
Method Details
- 
initialize
public void initialize()Description copied from interface:CacheCreate and initialize an empty cache if one doesn't exist already.- Specified by:
 initializein interfaceCache
 - 
getCacheFileSuffix
- Specified by:
 getCacheFileSuffixin interfaceCache- Overrides:
 getCacheFileSuffixin classAbstractCache- Returns:
 - suffix used for the cache files
 
 - 
isUpToDate
This is potentially expensive operation as the cache entry has to be retrieved from disk in order to tell whether it is stale or not.- Specified by:
 isUpToDatein interfaceCache- Parameters:
 file- source file- Returns:
 - indication whether the cache entry is fresh
 
 - 
get
Description copied from interface:AnnotationCacheRetrieve annotation from cache.- Specified by:
 getin interfaceAnnotationCache- Parameters:
 file- file under source root to get the annotation forrev- requested revision- Returns:
 Annotationobject ornull- Throws:
 CacheException- on error
 - 
store
Description copied from interface:AnnotationCacheStore annotation for file into cache.- Specified by:
 storein interfaceAnnotationCache- Parameters:
 file- file under source root to store the annotation forannotation-Annotationobject- Throws:
 CacheException- on error
 - 
clear
Description copied from interface:CacheClear the cache for a repository. - 
optimize
public void optimize()Description copied from interface:CacheOptimize how the history is stored on disk. This method is typically called after the cache has been populated, or after large modifications to the cache. The exact effect of this method is specific to each implementation, but it may for example include compressing, compacting or reordering the disk image of the cache in order to optimize performance or space usage. - 
supportsRepository
Description copied from interface:CacheCheck whether this cache implementation can store history for the given repository.- Specified by:
 supportsRepositoryin interfaceCache- Parameters:
 repository- the repository to check- Returns:
 trueif this cache implementation can store history for the repository, orfalseotherwise
 - 
getCacheDirName
- Specified by:
 getCacheDirNamein interfaceCache- Returns:
 - directory name to be used to store cache files under data root
 
 - 
getInfo
Description copied from interface:CacheGet a string with information about the cache. 
 -