Package org.neo4j.gds.termination
Interface TerminationFlag
-
- All Known Implementing Classes:
TerminationFlagImpl
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface TerminationFlag
-
-
Field Summary
Fields Modifier and Type Field Description static TerminationFlagDEFAULTstatic intRUN_CHECK_NODE_COUNTstatic TerminationFlagRUNNING_TRUEstatic TerminationFlagSTOP_RUNNING
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidassertRunning()booleanrunning()default voidterminate()static TerminationFlagwrap(TerminationMonitor terminationMonitor)Creates a new termination flag.static TerminationFlagwrap(TerminationMonitor terminationMonitor, java.util.function.Supplier<java.lang.RuntimeException> terminationCause)Creates a new termination flag.
-
-
-
Field Detail
-
RUNNING_TRUE
static final TerminationFlag RUNNING_TRUE
-
DEFAULT
static final TerminationFlag DEFAULT
-
STOP_RUNNING
static final TerminationFlag STOP_RUNNING
-
RUN_CHECK_NODE_COUNT
static final int RUN_CHECK_NODE_COUNT
- See Also:
- Constant Field Values
-
-
Method Detail
-
wrap
static TerminationFlag wrap(TerminationMonitor terminationMonitor)
Creates a new termination flag.- Parameters:
terminationMonitor- used to signal that the execution stopped running
-
wrap
static TerminationFlag wrap(TerminationMonitor terminationMonitor, java.util.function.Supplier<java.lang.RuntimeException> terminationCause)
Creates a new termination flag.- Parameters:
terminationMonitor- used to signal that the execution stopped runningterminationCause- returns aRuntimeExceptionthat is thrown when the execution is terminated
-
running
boolean running()
-
assertRunning
default void assertRunning()
- Throws:
java.lang.RuntimeException- if the transaction has been terminated
-
terminate
default void terminate()
-
-