Class MigrationExecution
- java.lang.Object
-
- com.launchdarkly.sdk.server.migrations.MigrationExecution
-
public class MigrationExecution extends java.lang.Object
This class is used to control the execution mechanism for migrations.Read operations may be executed in parallel, sequentially in a fixed order, or sequentially in a randomized order.
This class facilitates correct combinations of parallel/serial with random/fixed.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MigrationExecutionMode
getMode()
Get the current execution mode.java.util.Optional<MigrationSerialOrder>
getOrder()
If the execution mode isMigrationExecutionMode.SERIAL
, then this will contain an execution order.static MigrationExecution
Parallel()
Constructs a parallel execution.static MigrationExecution
Serial(MigrationSerialOrder order)
Construct a serial execution with the specified ordering.java.lang.String
toString()
A string representation of the migration execution.
-
-
-
Method Detail
-
Serial
public static MigrationExecution Serial(@NotNull MigrationSerialOrder order)
Construct a serial execution with the specified ordering.- Parameters:
order
- The serial execution order fixed/random.- Returns:
- an execution instance
-
Parallel
public static MigrationExecution Parallel()
Constructs a parallel execution.- Returns:
- an execution instance
-
getMode
public MigrationExecutionMode getMode()
Get the current execution mode.- Returns:
- The execution mode.
-
getOrder
public java.util.Optional<MigrationSerialOrder> getOrder()
If the execution mode isMigrationExecutionMode.SERIAL
, then this will contain an execution order. If the mode is not SERIAL, then this will return an empty optional.- Returns:
- The optional execution mode.
-
toString
public java.lang.String toString()
A string representation of the migration execution. The return value from this function should only be used for logging or human-read identification. It should not be used programmatically and will not follow semver.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the string.
-
-