Package com.google.gerrit.server.change
Class FileInfoJsonComparingImpl
- java.lang.Object
-
- com.google.gerrit.server.change.FileInfoJsonComparingImpl
-
- All Implemented Interfaces:
FileInfoJson
public class FileInfoJsonComparingImpl extends Object implements FileInfoJson
Implementation of FileInfoJson which usesFileInfoJsonOldImpl
, but also runsFileInfoJsonNewImpl
asynchronously and compares the results. This implementation is temporary and will be used to verify that the results are the same.
-
-
Constructor Summary
Constructors Constructor Description FileInfoJsonComparingImpl(com.google.gerrit.server.change.FileInfoJsonOldImpl oldImpl, FileInfoJsonNewImpl newImpl, ExecutorService executor, com.google.gerrit.server.change.FileInfoJsonComparingImpl.Metrics metrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,FileInfo>
getFileInfoMap(Change change, org.eclipse.jgit.lib.ObjectId objectId, PatchSet base)
Computes the list of modified files for a given change and patchset identified by itsobjectId
against a specified base patchset.Map<String,FileInfo>
getFileInfoMap(Project.NameKey project, org.eclipse.jgit.lib.ObjectId objectId, int parentNum)
Computes the list of modified files for a given project and commit against its parent.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.gerrit.server.change.FileInfoJson
getFileInfoMap, getFileInfoMap
-
-
-
-
Constructor Detail
-
FileInfoJsonComparingImpl
@Inject public FileInfoJsonComparingImpl(com.google.gerrit.server.change.FileInfoJsonOldImpl oldImpl, FileInfoJsonNewImpl newImpl, ExecutorService executor, com.google.gerrit.server.change.FileInfoJsonComparingImpl.Metrics metrics)
-
-
Method Detail
-
getFileInfoMap
public Map<String,FileInfo> getFileInfoMap(Change change, org.eclipse.jgit.lib.ObjectId objectId, PatchSet base) throws ResourceConflictException, PatchListNotAvailableException
Description copied from interface:FileInfoJson
Computes the list of modified files for a given change and patchset identified by itsobjectId
against a specified base patchset.- Specified by:
getFileInfoMap
in interfaceFileInfoJson
- Parameters:
change
- a Gerrit change.objectId
- a commit SHA-1 identifying a patchset commit.base
- a base patchset to compare the commit identified byobjectId
against.- Returns:
- a mapping of the file paths to their related diff information.
- Throws:
ResourceConflictException
PatchListNotAvailableException
-
getFileInfoMap
public Map<String,FileInfo> getFileInfoMap(Project.NameKey project, org.eclipse.jgit.lib.ObjectId objectId, int parentNum) throws ResourceConflictException, PatchListNotAvailableException
Description copied from interface:FileInfoJson
Computes the list of modified files for a given project and commit against its parent. For merge commits, callers can use 0, 1, 2, etc... to choose a specific parent. The first parent is 0. A value of -1 for parent can be passed to use the default base commit, which is the only parent for commits having only one parent, or the auto-merge otherwise.- Specified by:
getFileInfoMap
in interfaceFileInfoJson
- Parameters:
project
- a project identifying a repository.objectId
- a commit SHA-1 identifying a patchset commit.parentNum
- an integer identifying the parent number used for comparison.- Returns:
- a mapping of the file paths to their related diff information.
- Throws:
ResourceConflictException
PatchListNotAvailableException
-
-