All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.spark.deploy.rest.DriverState Maven / Gradle / Ivy

The newest version!
package org.apache.spark.deploy.rest;

import java.util.HashSet;
import java.util.Set;

// copy of org.apache.spark.deploy.master.DriverState
public enum DriverState {
    SUBMITTED, RUNNING, FINISHED, RELAUNCHING, UNKNOWN, KILLED, FAILED, ERROR, UNDEFINED;

    private static Set failedStates = new HashSet<>() {{
        add(UNKNOWN);
        add(KILLED);
        add(FAILED);
        add(ERROR);
    }};

    private static Set successStates = new HashSet<>() {{
        add(FINISHED);
    }};


    public boolean isFinal() {
        return failedStates.contains(this) || successStates.contains(this);
    }

    public boolean isSuccess() {
        return successStates.contains(this);
    }

    public boolean isFailure() {
        return failedStates.contains(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy