Class FileDiffCacheImpl
- java.lang.Object
- 
- com.google.gerrit.server.patch.filediff.FileDiffCacheImpl
 
- 
- All Implemented Interfaces:
- FileDiffCache
 
 public class FileDiffCacheImpl extends Object implements FileDiffCache Cache for the single file diff between two commits for a single file path. This cache adds extra Gerrit logic such as identifying edits due to rebase.If the FileDiffCacheKey.oldCommit()is equal toConstants.EMPTY_TREE_ID, the git diff will be evaluated against the empty tree.
- 
- 
Constructor SummaryConstructors Constructor Description FileDiffCacheImpl(com.google.common.cache.LoadingCache<FileDiffCacheKey,FileDiffOutput> cache)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FileDiffOutputget(FileDiffCacheKey key)Returns the file diff for a single file path identified by its key.com.google.common.collect.ImmutableMap<FileDiffCacheKey,FileDiffOutput>getAll(Iterable<FileDiffCacheKey> keys)Returns the file diff for a collection of file paths identified by their keys.static com.google.inject.Modulemodule()
 
- 
- 
- 
Constructor Detail- 
FileDiffCacheImpl@Inject public FileDiffCacheImpl(com.google.common.cache.LoadingCache<FileDiffCacheKey,FileDiffOutput> cache) 
 
- 
 - 
Method Detail- 
modulepublic static com.google.inject.Module module() 
 - 
getpublic FileDiffOutput get(FileDiffCacheKey key) throws DiffNotAvailableException Description copied from interface:FileDiffCacheReturns the file diff for a single file path identified by its key.- Specified by:
- getin interface- FileDiffCache
- Parameters:
- key- identifies two git commits, a specific file path and other diff parameters.
- Returns:
- the file diff for a single file path identified by its key.
- Throws:
- DiffNotAvailableException- if the commit IDs of the key are invalid for this project or if file contents could not be read.
 
 - 
getAllpublic com.google.common.collect.ImmutableMap<FileDiffCacheKey,FileDiffOutput> getAll(Iterable<FileDiffCacheKey> keys) throws DiffNotAvailableException Description copied from interface:FileDiffCacheReturns the file diff for a collection of file paths identified by their keys.- Specified by:
- getAllin interface- FileDiffCache
- Parameters:
- keys- identifying different file paths of different projects.
- Returns:
- a map of the input keys to their corresponding git file diffs.
- Throws:
- DiffNotAvailableException- if the diff failed to be evaluated for one or more of the input keys due to invalid commit IDs or if file contents could not be read.
 
 
- 
 
-