use of com.microsoft.azure.hdinsight.sdk.cluster.IClusterDetail in project azure-tools-for-java by Microsoft.
the class SparkSubmitModel method deployArtifactObservable.
public Single<IClusterDetail> deployArtifactObservable(Artifact artifact, IClusterDetail clusterDetail) {
return Single.create(em -> {
IClusterDetail selectedClusterDetail = getClusterConfiguration(clusterDetail, true);
if (selectedClusterDetail == null) {
String errorMessage = "Selected Cluster can not found. Please login in first in HDInsight Explorer and try submit job again";
HDInsightUtil.showErrorMessageOnSubmissionMessageWindow(project, errorMessage);
em.onError(new HDIException(errorMessage));
return;
}
try {
uploadFileToCluster(selectedClusterDetail, artifact.getName());
em.onSuccess(selectedClusterDetail);
} catch (Exception exception) {
showFailedSubmitErrorMessage(exception);
em.onError(exception);
}
});
}
use of com.microsoft.azure.hdinsight.sdk.cluster.IClusterDetail in project azure-tools-for-java by Microsoft.
the class SparkSubmissionContentPanel method initializeModel.
private void initializeModel() {
clustersListComboBox.getButton().setEnabled(false);
DefaultLoader.getIdeHelper().executeOnPooledThread(() -> {
Project project = submitModel.getProject();
HDInsightUtil.showInfoOnSubmissionMessageWindow(submitModel.getProject(), "List spark clusters ...", true);
List<IClusterDetail> cachedClusters = ClusterManagerEx.getInstance().getClusterDetailsWithoutAsync(true, submitModel.getProject());
if (!ClusterManagerEx.getInstance().isSelectedSubscriptionExist()) {
HDInsightUtil.showWarningMessageOnSubmissionMessageWindow(project, "No selected subscription(s), Please go to HDInsight Explorer to sign in....");
}
if (ClusterManagerEx.getInstance().isListClusterSuccess()) {
HDInsightUtil.showInfoOnSubmissionMessageWindow(project, "List spark clusters successfully");
} else {
HDInsightUtil.showErrorMessageOnSubmissionMessageWindow(project, "Error : Failed to list spark clusters.");
}
if (ClusterManagerEx.getInstance().isLIstAdditionalClusterSuccess()) {
HDInsightUtil.showInfoOnSubmissionMessageWindow(project, "List additional spark clusters successfully");
} else {
HDInsightUtil.showErrorMessageOnSubmissionMessageWindow(project, "Error: Failed to list additional cluster");
}
submitModel.setClusterComboBoxModel(cachedClusters);
clustersListComboBox.getComboBox().setModel(submitModel.getClusterComboBoxModel());
clustersListComboBox.getButton().setEnabled(true);
});
selectedArtifactComboBox.setModel(submitModel.getArtifactComboBoxModel());
jobConfigurationTable.setModel(submitModel.getTableModel());
}
use of com.microsoft.azure.hdinsight.sdk.cluster.IClusterDetail in project azure-tools-for-java by Microsoft.
the class HDInsightHelperImpl method openJobViewEditor.
public void openJobViewEditor(Object projectObject, String uuid) {
IClusterDetail clusterDetail = JobViewManager.getCluster(uuid);
Project project = (Project) projectObject;
VirtualFile openedFile = getOpenedItem(project);
if (openedFile == null || isNeedReopen(openedFile, clusterDetail)) {
openItem(project, clusterDetail, uuid, openedFile);
} else {
openItem(project, openedFile, null);
}
}
use of com.microsoft.azure.hdinsight.sdk.cluster.IClusterDetail in project azure-tools-for-java by Microsoft.
the class HDInsightHelperImpl method openJobViewEditor.
public void openJobViewEditor(Object projectObject, String uuid) {
try {
loadHDInsightPlugin();
} catch (BundleException bundleException) {
Activator.getDefault().log("Error loading plugin " + HDINSIHGT_BUNDLE_ID, bundleException);
}
IClusterDetail clusterDetail = JobViewManager.getCluster(uuid);
IWorkbench workbench = PlatformUI.getWorkbench();
IEditorDescriptor editorDescriptor = workbench.getEditorRegistry().findEditor("com.microsoft.azure.hdinsight.jobview");
try {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart newEditor = page.openEditor(new JobViewInput(clusterDetail, uuid), editorDescriptor.getId());
} catch (PartInitException e2) {
Activator.getDefault().log("Error opening " + clusterDetail.getName(), e2);
}
}
Aggregations