@FunctionalInterface public interface BulkCommitCallback
commits
, each with a set listing one or more
repositories
where it was found.Modifier and Type | Method and Description |
---|---|
boolean |
onCommit(Commit commit,
Set<Repository> repositories)
Receives a commit, and the set of repositories the commit was found in.
|
default void |
onEnd(BulkCommitSummary summary)
Called after the final
commit has been streamed. |
default void |
onStart(BulkCommitContext context)
Called before the first
commit is streamed. |
boolean onCommit(@Nonnull Commit commit, @Nonnull Set<Repository> repositories) throws IOException
Because the Commit
may be found in multiple repositories, Commit.getRepository()
will always
return null
on the provided commit. To know which repository, or repositories, the commit was actually
present in, use the accompanying set.
This method will never be invoked before onStart(BulkCommitContext)
, and if it is invoked
onEnd(BulkCommitSummary)
is guaranteed to be invoked, whether the end happens because this
method returns false
or because the upstream sender runs out of commits.
commit
- the commitrepositories
- a set containing one or more repositories where the commit was foundtrue
if more commits should be provided; otherwise false
to end streaming,
potentially leaving some number of commits unreadIOException
- for implementations which perform I/Odefault void onEnd(@Nonnull BulkCommitSummary summary) throws IOException
commit
has been streamed.
Note: If there were no commits, this method may be called immediately after onStart(BulkCommitContext)
without any calls to onCommit(Commit, Set)
.
summary
- summarizes the request and the streamed commitsIOException
- for implementations which perform I/Odefault void onStart(@Nonnull BulkCommitContext context) throws IOException
commit
is streamed.context
- provides details about the request for which commits are being streamedIOException
- for implementations which perform I/OCopyright © 2022 Atlassian. All rights reserved.