Skip to content

Commit

Permalink
[hotfix][core] Improve/fix JavaDocs in SplitEnumeratorContext class.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanEwen committed Sep 9, 2021
1 parent e4b0008 commit d666d2a
Showing 1 changed file with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@
import java.util.function.BiConsumer;

/**
* A context class for the {@link SplitEnumerator}. This class serves the following purposes: 1.
* Host information necessary for the SplitEnumerator to make split assignment decisions. 2. Accept
* and track the split assignment from the enumerator. 3. Provide a managed threading model so the
* split enumerators do not need to create their own internal threads.
* A context class for the {@link SplitEnumerator}. This class serves the following purposes:
*
* <ol>
* <li>Host information necessary for the SplitEnumerator to make split assignment decisions.
* <li>Accept and track the split assignment from the enumerator.
* <li>Provide a managed threading model so the split enumerators do not need to create their own
* internal threads.
* </ol>
*
* @param <SplitT> the type of the splits.
*/
Expand Down Expand Up @@ -96,7 +100,7 @@ default void assignSplit(SplitT split, int subtask) {
* s may be executed in a thread pool concurrently.
*
* <p>It is important to make sure that the callable does not modify any shared state,
* especially the states that will be a part of the {@link SplitEnumerator#snapshotState()}.
* especially the states that will be a part of the {@link SplitEnumerator#snapshotState(long)}.
* Otherwise the there might be unexpected behavior.
*
* <p>Note that an exception thrown from the handler would result in failing the job.
Expand All @@ -113,19 +117,22 @@ default void assignSplit(SplitT split, int subtask) {
* <code>Callable</code>s may be executed in a thread pool concurrently.
*
* <p>It is important to make sure that the callable does not modify any shared state,
* especially the states that will be a part of the {@link SplitEnumerator#snapshotState()}.
* especially the states that will be a part of the {@link SplitEnumerator#snapshotState(long)}.
* Otherwise the there might be unexpected behavior.
*
* <p>Note that an exception thrown from the handler would result in failing the job.
*
* @param callable the callable to call.
* @param handler a handler that handles the return value of or the exception thrown from the
* callable.
* @param initialDelay the initial delay of calling the callable.
* @param period the period between two invocations of the callable.
* @param initialDelayMillis the initial delay of calling the callable, in milliseconds.
* @param periodMillis the period between two invocations of the callable, in milliseconds.
*/
<T> void callAsync(
Callable<T> callable, BiConsumer<T, Throwable> handler, long initialDelay, long period);
Callable<T> callable,
BiConsumer<T, Throwable> handler,
long initialDelayMillis,
long periodMillis);

/**
* Invoke the given runnable in the source coordinator thread.
Expand Down

0 comments on commit d666d2a

Please sign in to comment.