mantis-common/src/main/java/io/mantisrx/runtime/MantisJobState.java [22:49]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public enum MantisJobState {

    Accepted,
    Launched, // scheduled and sent to slave
    StartInitiated, // initial message from slave worker, about to start
    Started, // actually started running
    Failed,  // OK to handle as a resubmit
    Completed, // terminal state, not necessarily successful
    Noop; // internal use only

    private static final Map<MantisJobState, MantisJobState[]> validChanges;
    private static final Map<MantisJobState, MetaState> metaStates;

    static {
        validChanges = new HashMap<>();
        validChanges.put(Accepted, new MantisJobState[] {Launched, Failed, Completed});
        validChanges.put(Launched, new MantisJobState[] {StartInitiated, Started, Failed, Completed});
        validChanges.put(StartInitiated, new MantisJobState[] {StartInitiated, Started, Completed, Failed});
        validChanges.put(Started, new MantisJobState[] {Started, Completed, Failed});
        validChanges.put(Failed, new MantisJobState[] {});
        validChanges.put(Completed, new MantisJobState[] {});
        metaStates = new HashMap<>();
        metaStates.put(Accepted, MetaState.Active);
        metaStates.put(Launched, MetaState.Active);
        metaStates.put(StartInitiated, MetaState.Active);
        metaStates.put(Started, MetaState.Active);
        metaStates.put(Failed, MetaState.Terminal);
        metaStates.put(Completed, MetaState.Terminal);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



mantis-publish/mantis-publish-core/src/main/java/io/mantisrx/publish/internal/discovery/proto/MantisJobState.java [26:53]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public enum MantisJobState {

    Accepted,
    Launched, // scheduled and sent to slave
    StartInitiated, // initial message from slave worker, about to start
    Started, // actually started running
    Failed,  // OK to handle as a resubmit
    Completed, // terminal state, not necessarily successful
    Noop; // internal use only

    private static final Map<MantisJobState, MantisJobState[]> validChanges;
    private static final Map<MantisJobState, MetaState> metaStates;

    static {
        validChanges = new HashMap<>();
        validChanges.put(Accepted, new MantisJobState[] {Launched, Failed, Completed});
        validChanges.put(Launched, new MantisJobState[] {StartInitiated, Started, Failed, Completed});
        validChanges.put(StartInitiated, new MantisJobState[] {StartInitiated, Started, Completed, Failed});
        validChanges.put(Started, new MantisJobState[] {Started, Completed, Failed});
        validChanges.put(Failed, new MantisJobState[] {});
        validChanges.put(Completed, new MantisJobState[] {});
        metaStates = new HashMap<>();
        metaStates.put(Accepted, MetaState.Active);
        metaStates.put(Launched, MetaState.Active);
        metaStates.put(StartInitiated, MetaState.Active);
        metaStates.put(Started, MetaState.Active);
        metaStates.put(Failed, MetaState.Terminal);
        metaStates.put(Completed, MetaState.Terminal);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



