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
FieldsModifier and TypeFieldDescriptionprivate intprivate final intstatic final intDefault value for the amount of commits whose linegraph representations should be exported together.private ByteArrayOutputStreamFields inherited from class org.variantsync.diffdetective.analysis.strategies.AnalysisStrategy
outputPath, repo -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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 TypeMethodDescriptionvoidend()Invoked when the analysis is done for the current repository.private voidflush()Appends the given linegraph string at the end of the given file.onCommit(CommitDiff commit) Invoked before a commit is analyzed.voidstart(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.- See Also:
-
-
Method Details
-
start
Description copied from class:AnalysisStrategyInvoked when the analysis starts.- Overrides:
startin 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:AnalysisStrategyInvoked before a commit is analyzed. The returned line graph export destination is closed after processing the commit given bycommit.- Specified by:
onCommitin classAnalysisStrategy- Parameters:
commit- The commit that was just processed.- Returns:
- the line graph export destination
-
end
public void end()Description copied from class:AnalysisStrategyInvoked 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:
endin classAnalysisStrategy
-
flush
private void flush()Appends the given linegraph string at the end of the given file.
-