Class AnalyzeAndExportIncrementally
java.lang.Object
org.variantsync.diffdetective.analysis.strategies.AnalysisStrategy
org.variantsync.diffdetective.analysis.strategies.AnalyzeAndExportIncrementally
- Direct Known Subclasses:
AnalyzeAllThenExport
Collects the linegraph representations generated by an analysis and exports them once a certain threshold of
representations has been stored.
The default value is 100, meaning that a linegraph file is written for every 100 processed commits.
- Author:
- Paul Bittner
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
private final int
static final int
Default value for the amount of commits whose linegraph representations should be exported together.private ByteArrayOutputStream
Fields inherited from class org.variantsync.diffdetective.analysis.strategies.AnalysisStrategy
outputPath, repo
-
Constructor Summary
ConstructorDescriptionCreates a new strategy with the default value of commits to export together.AnalyzeAndExportIncrementally
(int numberOfCommitsToExportAtOnce) Creates a new strategy that collects the linegraph representations of the given amount of commits and then exports them together. -
Method Summary
Modifier and TypeMethodDescriptionvoid
end()
Invoked when the analysis is done for the current repository.private void
flush()
Appends the given linegraph string at the end of the given file.onCommit
(CommitDiff commit) Invoked before a commit is analyzed.void
start
(Repository repo, Path outputPath) Invoked when the analysis starts.
-
Field Details
-
DEFAULT_NUMBER_OF_COMMITS_TO_EXPORT_AT_ONCE
public static final int DEFAULT_NUMBER_OF_COMMITS_TO_EXPORT_AT_ONCEDefault value for the amount of commits whose linegraph representations should be exported together.- See Also:
-
commitsToExportAtOnce
private final int commitsToExportAtOnce -
lineGraphDestination
-
collectedCommits
private int collectedCommits
-
-
Constructor Details
-
AnalyzeAndExportIncrementally
public AnalyzeAndExportIncrementally(int numberOfCommitsToExportAtOnce) Creates a new strategy that collects the linegraph representations of the given amount of commits and then exports them together.- Parameters:
numberOfCommitsToExportAtOnce
- Amount of commits whose linegraph representations should be exported together.
-
AnalyzeAndExportIncrementally
public AnalyzeAndExportIncrementally()Creates a new strategy with the default value of commits to export together.
-
-
Method Details
-
start
Description copied from class:AnalysisStrategy
Invoked when the analysis starts.- Overrides:
start
in classAnalysisStrategy
- Parameters:
repo
- The repository on which an analysis is performed.outputPath
- A directory to which output should be written.
-
onCommit
Description copied from class:AnalysisStrategy
Invoked before a commit is analyzed. The returned line graph export destination is closed after processing the commit given bycommit
.- Specified by:
onCommit
in classAnalysisStrategy
- Parameters:
commit
- The commit that was just processed.- Returns:
- the line graph export destination
-
end
public void end()Description copied from class:AnalysisStrategy
Invoked when the analysis is done for the current repository. The analysis might restart with another repository. In this case,AnalysisStrategy.start(org.variantsync.diffdetective.datasets.Repository, java.nio.file.Path)
is invoked again.- Specified by:
end
in classAnalysisStrategy
-
flush
private void flush()Appends the given linegraph string at the end of the given file.
-