Search in sources :

Example 1 with SparkSubmissionJobUploadStorageWithUploadPathPanel

use of com.microsoft.azure.hdinsight.spark.ui.SparkSubmissionJobUploadStorageWithUploadPathPanel in project azure-tools-for-java by Microsoft.

the class LivySparkBatchJobRunConfiguration method checkSubmissionConfigurationBeforeRun.

protected void checkSubmissionConfigurationBeforeRun(@NotNull final SparkSubmissionRunner runner) throws RuntimeConfigurationException {
    final SparkSubmissionParameter parameter = getSubmitModel().getSubmissionParameter();
    if (StringUtils.isBlank(parameter.getClusterName())) {
        throw new RuntimeConfigurationError(this.getErrorMessageClusterNull());
    }
    if (!parameter.isLocalArtifact()) {
        if (StringUtils.isBlank(parameter.getArtifactName())) {
            throw new RuntimeConfigurationError("Couldn't find the artifact to submit, please create one and select it, " + "or select a local artifact");
        }
        if (!getSubmitModel().getArtifactPath().isPresent()) {
            throw new RuntimeConfigurationError(String.format("No artifact selected or selected artifact %s is gone.", getSubmitModel().getArtifactName()));
        }
    } else {
        if (StringUtils.isBlank(parameter.getLocalArtifactPath())) {
            throw new RuntimeConfigurationError("The specified local artifact path is empty");
        }
        if (!new File(parameter.getLocalArtifactPath()).exists()) {
            throw new RuntimeConfigurationError(String.format("The specified local artifact path '%s' doesn't exist", parameter.getLocalArtifactPath()));
        }
    }
    if (StringUtils.isBlank(parameter.getMainClassName())) {
        throw new RuntimeConfigurationError("The main class name should not be empty");
    }
    if (getSubmitModel().getTableModel().getFirstCheckResults() != null) {
        throw new RuntimeConfigurationError("There are Spark job configuration issues, fix it before continue, please: " + getSubmitModel().getTableModel().getFirstCheckResults().getMessaqge());
    }
    // Validate Storage Configurations
    final SparkSubmissionJobUploadStorageWithUploadPathPanel storageConfigPanels = new SparkSubmissionJobUploadStorageWithUploadPathPanel();
    try {
        storageConfigPanels.checkConfigurationBeforeRun(getSubmitModel().getJobUploadStorageModel());
    } finally {
        Disposer.dispose(storageConfigPanels);
    }
}
Also used : SparkSubmissionJobUploadStorageWithUploadPathPanel(com.microsoft.azure.hdinsight.spark.ui.SparkSubmissionJobUploadStorageWithUploadPathPanel) File(java.io.File)

Aggregations

SparkSubmissionJobUploadStorageWithUploadPathPanel (com.microsoft.azure.hdinsight.spark.ui.SparkSubmissionJobUploadStorageWithUploadPathPanel)1 File (java.io.File)1