Package io.trino.tempto.threads
Class ParallelExecution
java.lang.Object
io.trino.tempto.threads.ParallelExecution
A class implementing parallel execution of code blocks.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()voidjoin()booleanjoin(long timeout) voidJoins all child threads and throwsParallelExecutionExceptionif some child throws aThrowable.booleanjoinAndRethrow(long timeout) static ParallelExecutionparallelExecution(int nTimes, IndexedRunnable indexedRunnable) start()
-
Method Details
-
start
-
joinAndRethrow
Joins all child threads and throwsParallelExecutionExceptionif some child throws aThrowable.- Throws:
InterruptedException- if the thread is interrupted
-
joinAndRethrow
- Parameters:
timeout- Milliseconds- Returns:
- true if child threads were successfully joined within given timeout.
- Throws:
InterruptedException- if the thread is interrupted
-
join
- Throws:
InterruptedException
-
join
- Throws:
InterruptedException
-
getThrowables
- Returns:
Throwables that were caught in child threads during execution.
-
parallelExecution
-
builder
-