use of com.microsoft.azure.hdinsight.spark.common.SparkSubmitModel in project azure-tools-for-java by Microsoft.
the class SparkBatchJobConfigurable method setData.
@Override
public void setData(@NotNull SparkBatchJobConfigurableModel data) {
// Data -> Component
localRunParamsPanel.setData(data.getLocalRunConfigurableModel());
SparkSubmitModel submitModel = data.getSubmitModel();
submitModel.setClusterSelectable(data.isClusterSelectionEnabled());
submissionContentPanel.setData(data.getSubmitModel());
executionTypeTabPane.setSelectedIndex(data.getFocusedTabIndex());
commonRunParametersPanel.setMainClassName(data.getSubmitModel().getMainClassName());
// Presentation only
setLocalRunConfigEnabled(data.isLocalRunConfigEnabled());
}
use of com.microsoft.azure.hdinsight.spark.common.SparkSubmitModel in project azure-tools-for-java by Microsoft.
the class RemoteDebugRunConfiguration method readExternal.
@Override
public void readExternal(Element rootElement) throws InvalidDataException {
super.readExternal(rootElement);
SparkSubmitModel model = getSubmitModel();
SparkSubmissionParameter parameter = Optional.ofNullable(model.getSubmissionParameter()).orElse(new SparkSubmissionParameter("", false, "", "", "", "", new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), Arrays.stream(SparkSubmissionParameter.defaultParameters).collect(Collectors.toMap(Pair::first, Pair::second))));
Optional.ofNullable(rootElement.getChild(SUBMISSION_CONTENT_NAME)).ifPresent((element -> {
Optional.ofNullable(element.getAttribute(SUBMISSION_ATTRIBUTE_CLUSTER_NAME)).ifPresent(attribute -> parameter.setClusterName(attribute.getValue()));
Optional.ofNullable(element.getAttribute(SUBMISSION_ATTRIBUTE_IS_LOCAL_ARTIFACT)).ifPresent(attribute -> parameter.setLocalArtifact(attribute.getValue().toLowerCase().equals("true")));
Optional.ofNullable(element.getAttribute(SUBMISSION_ATTRIBUTE_ARTIFACT_NAME)).ifPresent(attribute -> parameter.setArtifactName(attribute.getValue()));
Optional.ofNullable(element.getAttribute(SUBMISSION_ATTRIBUTE_CLASSNAME)).ifPresent(attribute -> parameter.setClassName(attribute.getValue()));
model.setSubmissionParameters(parameter);
}));
}
use of com.microsoft.azure.hdinsight.spark.common.SparkSubmitModel in project azure-tools-for-java by Microsoft.
the class RemoteDebugRunConfiguration method writeExternal.
@Override
public void writeExternal(Element rootElement) throws WriteExternalException {
super.writeExternal(rootElement);
SparkSubmitModel model = getSubmitModel();
SparkSubmissionParameter submissionParameter = model.getSubmissionParameter();
// The element to save editor's setting
Element remoteDebugSettingsElement = new Element(SUBMISSION_CONTENT_NAME);
remoteDebugSettingsElement.setAttribute(SUBMISSION_ATTRIBUTE_CLUSTER_NAME, submissionParameter.getClusterName());
remoteDebugSettingsElement.setAttribute(SUBMISSION_ATTRIBUTE_IS_LOCAL_ARTIFACT, Boolean.toString(model.isLocalArtifact()));
remoteDebugSettingsElement.setAttribute(SUBMISSION_ATTRIBUTE_ARTIFACT_NAME, submissionParameter.getArtifactName());
remoteDebugSettingsElement.setAttribute(SUBMISSION_ATTRIBUTE_CLASSNAME, submissionParameter.getMainClassName());
rootElement.addContent(remoteDebugSettingsElement);
}
Aggregations