Class LabelEstimator.Job
java.lang.Object
io.github.jbastgen.stemma.app.label.LabelEstimator.Job
- Enclosing class:
LabelEstimator
One run over some commits. Blocking: run it on a thread of its own;
cancel() may be called from any thread.-
Constructor Summary
ConstructorsConstructorDescriptionJob(LabelEstimator.Loader loader, Function<CommitData, String> promptFor, LabelEstimator.Asker asker, List<LabelIndex.LabelDef> labels, LabelEstimator.Sink sink) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Stops after the commit that is being asked about; its answer is dropped.run(List<String> commitIds, LabelEstimator.Progress progress) Goes through the commits one by one.
-
Constructor Details
-
Job
public Job(LabelEstimator.Loader loader, Function<CommitData, String> promptFor, LabelEstimator.Asker asker, List<LabelIndex.LabelDef> labels, LabelEstimator.Sink sink) - Parameters:
loader- reads the data of a commitpromptFor- builds the question for a commitasker- sends the question to the AIlabels- the labels that can be chosensink- receives the progress and the labels
-
-
Method Details
-
cancel
public void cancel()Stops after the commit that is being asked about; its answer is dropped. -
run
Goes through the commits one by one. A commit that cannot be read is skipped; a failure of the AI (service not reachable, key wrong, ...) stops the run, because the next commit would fail the same way.
-