Interface BulkProgress


public interface BulkProgress
Where a bulk run has got to.

Callbacks arrive on whichever pool thread the entry finished on, so a host that draws from them marshals onto its own thread first.

Reported per entry rather than as a percentage on purpose: a bar tells a user how long to wait, while the thing they actually need to know is which alt failed and why.

A RuntimeException a callback throws is ignored by the run: completed(int, int, BulkEntryResult) and finished(BulkReport) failing changes nothing (the entry stays recorded, the report still completes), and started(int, int, String) failing only fails the entry it announced, as that method says. An Error a callback throws cuts the run short instead: the entry being reported keeps its result, and every remaining entry is reported as AltsFailure.Kind.CANCELLED.

Since:
0.9.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final BulkProgress
    A progress sink that discards everything, for a caller that only wants the report.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    completed(int index, int total, BulkEntryResult result)
    Called as an entry finishes, whether it succeeded or not.
    default void
    Called once when the run is over, however it ended, and before BulkHandle.report() completes: a caller woken by the report has already had this call, and every call before it.
    void
    started(int index, int total, String label)
    Called as an entry begins.
  • Field Details

    • NONE

      static final BulkProgress NONE
      A progress sink that discards everything, for a caller that only wants the report.
      Since:
      0.9.0
  • Method Details

    • started

      void started(int index, int total, String label)
      Called as an entry begins.

      If this throws, that entry is not attempted: it fails with kind AltsFailure.Kind.UNKNOWN, and the run goes on with the next entry.

      Parameters:
      index - the entry's position, counting from 0
      total - how many entries the run was given
      label - a name safe to display, never the input line
      Since:
      0.9.0
    • completed

      void completed(int index, int total, BulkEntryResult result)
      Called as an entry finishes, whether it succeeded or not.
      Parameters:
      index - the entry's position, counting from 0
      total - how many entries the run was given
      result - what became of it
      Since:
      0.9.0
    • finished

      default void finished(BulkReport report)
      Called once when the run is over, however it ended, and before BulkHandle.report() completes: a caller woken by the report has already had this call, and every call before it.
      Parameters:
      report - what the run came to
      Since:
      0.9.0