mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Update product references from 'sqlops' to 'azdata' (#4259)
* Update extensions to use azdata * Switch core code to use azdata
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
const localize = nls.loadMessageBundle();
|
||||
@@ -48,9 +48,9 @@ export class OpenSparkJobSubmissionDialogCommand extends Command {
|
||||
}
|
||||
|
||||
private async selectConnection(): Promise<SqlClusterConnection> {
|
||||
let connectionList: sqlops.connection.Connection[] = await this.apiWrapper.getActiveConnections();
|
||||
let connectionList: azdata.connection.Connection[] = await this.apiWrapper.getActiveConnections();
|
||||
let displayList: string[] = new Array();
|
||||
let connectionMap: Map<string, sqlops.connection.Connection> = new Map();
|
||||
let connectionMap: Map<string, azdata.connection.Connection> = new Map();
|
||||
if (connectionList && connectionList.length > 0) {
|
||||
connectionList.forEach(conn => {
|
||||
if (conn.providerName === constants.sqlProviderName) {
|
||||
@@ -125,7 +125,7 @@ export class OpenSparkJobSubmissionDialogTask {
|
||||
constructor(private appContext: AppContext, private outputChannel: vscode.OutputChannel) {
|
||||
}
|
||||
|
||||
async execute(profile: sqlops.IConnectionProfile, ...args: any[]): Promise<void> {
|
||||
async execute(profile: azdata.IConnectionProfile, ...args: any[]): Promise<void> {
|
||||
try {
|
||||
let sqlClusterConnection = SqlClusterLookUp.findSqlClusterConnection(profile, this.appContext);
|
||||
if (!sqlClusterConnection) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -14,12 +14,12 @@ import { AppContext } from '../../../appContext';
|
||||
import { ApiWrapper } from '../../../apiWrapper';
|
||||
|
||||
export class SparkAdvancedTab {
|
||||
private _tab: sqlops.window.DialogTab;
|
||||
public get tab(): sqlops.window.DialogTab { return this._tab; }
|
||||
private _tab: azdata.window.DialogTab;
|
||||
public get tab(): azdata.window.DialogTab { return this._tab; }
|
||||
|
||||
private _referenceFilesInputBox: sqlops.InputBoxComponent;
|
||||
private _referenceJARFilesInputBox: sqlops.InputBoxComponent;
|
||||
private _referencePyFilesInputBox: sqlops.InputBoxComponent;
|
||||
private _referenceFilesInputBox: azdata.InputBoxComponent;
|
||||
private _referenceJARFilesInputBox: azdata.InputBoxComponent;
|
||||
private _referencePyFilesInputBox: azdata.InputBoxComponent;
|
||||
|
||||
private get apiWrapper(): ApiWrapper {
|
||||
return this.appContext.apiWrapper;
|
||||
@@ -30,7 +30,7 @@ export class SparkAdvancedTab {
|
||||
|
||||
this._tab.registerContent(async (modelView) => {
|
||||
let builder = modelView.modelBuilder;
|
||||
let parentLayout: sqlops.FormItemLayout = {
|
||||
let parentLayout: azdata.FormItemLayout = {
|
||||
horizontal: false,
|
||||
componentWidth: '400px'
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as fspath from 'path';
|
||||
import * as fs from 'fs';
|
||||
@@ -22,19 +22,19 @@ import { SparkFileSource } from './sparkJobSubmissionService';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class SparkConfigurationTab {
|
||||
private _tab: sqlops.window.DialogTab;
|
||||
public get tab(): sqlops.window.DialogTab { return this._tab; }
|
||||
private _tab: azdata.window.DialogTab;
|
||||
public get tab(): azdata.window.DialogTab { return this._tab; }
|
||||
|
||||
private _jobNameInputBox: sqlops.InputBoxComponent;
|
||||
private _sparkContextLabel: sqlops.TextComponent;
|
||||
private _fileSourceDropDown: sqlops.DropDownComponent;
|
||||
private _sparkSourceFileInputBox: sqlops.InputBoxComponent;
|
||||
private _filePickerButton: sqlops.ButtonComponent;
|
||||
private _sourceFlexContainer: sqlops.FlexContainer;
|
||||
private _sourceFlexContainerWithHint: sqlops.FlexContainer;
|
||||
private _localUploadDestinationLabel: sqlops.TextComponent;
|
||||
private _mainClassInputBox: sqlops.InputBoxComponent;
|
||||
private _argumentsInputBox: sqlops.InputBoxComponent;
|
||||
private _jobNameInputBox: azdata.InputBoxComponent;
|
||||
private _sparkContextLabel: azdata.TextComponent;
|
||||
private _fileSourceDropDown: azdata.DropDownComponent;
|
||||
private _sparkSourceFileInputBox: azdata.InputBoxComponent;
|
||||
private _filePickerButton: azdata.ButtonComponent;
|
||||
private _sourceFlexContainer: azdata.FlexContainer;
|
||||
private _sourceFlexContainerWithHint: azdata.FlexContainer;
|
||||
private _localUploadDestinationLabel: azdata.TextComponent;
|
||||
private _mainClassInputBox: azdata.InputBoxComponent;
|
||||
private _argumentsInputBox: azdata.InputBoxComponent;
|
||||
|
||||
private get apiWrapper(): ApiWrapper {
|
||||
return this.appContext.apiWrapper;
|
||||
@@ -46,7 +46,7 @@ export class SparkConfigurationTab {
|
||||
|
||||
this._tab.registerContent(async (modelView) => {
|
||||
let builder = modelView.modelBuilder;
|
||||
let parentLayout: sqlops.FormItemLayout = {
|
||||
let parentLayout: azdata.FormItemLayout = {
|
||||
horizontal: false,
|
||||
componentWidth: '400px'
|
||||
};
|
||||
@@ -72,7 +72,7 @@ export class SparkConfigurationTab {
|
||||
title: localize('sparkJobSubmission_SparkCluster', 'Spark Cluster')
|
||||
}, parentLayout);
|
||||
|
||||
this._fileSourceDropDown = builder.dropDown().withProperties<sqlops.DropDownProperties>({
|
||||
this._fileSourceDropDown = builder.dropDown().withProperties<azdata.DropDownProperties>({
|
||||
values: [SparkFileSource.Local.toString(), SparkFileSource.HDFS.toString()],
|
||||
value: (this._path) ? SparkFileSource.HDFS.toString() : SparkFileSource.Local.toString()
|
||||
}).component();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as utils from '../../../utils';
|
||||
@@ -22,7 +22,7 @@ import { SqlClusterConnection } from '../../../objectExplorerNodeProvider/connec
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class SparkJobSubmissionDialog {
|
||||
private _dialog: sqlops.window.Dialog;
|
||||
private _dialog: azdata.window.Dialog;
|
||||
private _dataModel: SparkJobSubmissionModel;
|
||||
private _sparkConfigTab: SparkConfigurationTab;
|
||||
private _sparkAdvancedTab: SparkAdvancedTab;
|
||||
@@ -76,7 +76,7 @@ export class SparkJobSubmissionDialog {
|
||||
);
|
||||
}
|
||||
|
||||
private async onSubmit(op: sqlops.BackgroundOperation): Promise<void> {
|
||||
private async onSubmit(op: azdata.BackgroundOperation): Promise<void> {
|
||||
try {
|
||||
this.outputChannel.show();
|
||||
let msg = localize('sparkJobSubmission_SubmissionStartMessage',
|
||||
@@ -86,15 +86,15 @@ export class SparkJobSubmissionDialog {
|
||||
if (this._dataModel.isMainSourceFromLocal) {
|
||||
try {
|
||||
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionPrepareUploadingFile(this._dataModel.localFileSourcePath, this._dataModel.hdfsFolderDestinationPath)));
|
||||
op.updateStatus(sqlops.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionPrepareUploadingFile(this._dataModel.localFileSourcePath, this._dataModel.hdfsFolderDestinationPath));
|
||||
op.updateStatus(azdata.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionPrepareUploadingFile(this._dataModel.localFileSourcePath, this._dataModel.hdfsFolderDestinationPath));
|
||||
await this._dataModel.uploadFile(this._dataModel.localFileSourcePath, this._dataModel.hdfsFolderDestinationPath);
|
||||
vscode.window.showInformationMessage(LocalizedConstants.sparkJobSubmissionUploadingFileSucceeded);
|
||||
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionUploadingFileSucceeded));
|
||||
op.updateStatus(sqlops.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionUploadingFileSucceeded);
|
||||
op.updateStatus(azdata.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionUploadingFileSucceeded);
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(LocalizedConstants.sparkJobSubmissionUploadingFileFailed(utils.getErrorMessage(error)));
|
||||
this.outputChannel.appendLine(this.addErrorTag(LocalizedConstants.sparkJobSubmissionUploadingFileFailed(utils.getErrorMessage(error))));
|
||||
op.updateStatus(sqlops.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionUploadingFileFailed(utils.getErrorMessage(error)));
|
||||
op.updateStatus(azdata.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionUploadingFileFailed(utils.getErrorMessage(error)));
|
||||
this.outputChannel.appendLine(LocalizedConstants.sparkJobSubmissionEndMessage);
|
||||
return;
|
||||
}
|
||||
@@ -103,11 +103,11 @@ export class SparkJobSubmissionDialog {
|
||||
// 2. Submit job to cluster.
|
||||
let submissionSettings: SparkJobSubmissionInput = this.getSubmissionInput();
|
||||
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionPrepareSubmitJob(submissionSettings.jobName)));
|
||||
op.updateStatus(sqlops.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionPrepareSubmitJob(submissionSettings.jobName));
|
||||
op.updateStatus(azdata.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionPrepareSubmitJob(submissionSettings.jobName));
|
||||
let livyBatchId = await this._dataModel.submitBatchJobByLivy(submissionSettings);
|
||||
vscode.window.showInformationMessage(LocalizedConstants.sparkJobSubmissionSparkJobHasBeenSubmitted);
|
||||
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionSparkJobHasBeenSubmitted));
|
||||
op.updateStatus(sqlops.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionSparkJobHasBeenSubmitted);
|
||||
op.updateStatus(azdata.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionSparkJobHasBeenSubmitted);
|
||||
|
||||
// 3. Get SparkHistory/YarnUI Url.
|
||||
try {
|
||||
@@ -116,24 +116,24 @@ export class SparkJobSubmissionDialog {
|
||||
let sparkHistoryUrl = this._dataModel.generateSparkHistoryUIUrl(submissionSettings, appId);
|
||||
vscode.window.showInformationMessage(LocalizedConstants.sparkJobSubmissionSparkHistoryLinkMessage(sparkHistoryUrl));
|
||||
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionSparkHistoryLinkMessage(sparkHistoryUrl)));
|
||||
op.updateStatus(sqlops.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionSparkHistoryLinkMessage(sparkHistoryUrl));
|
||||
op.updateStatus(azdata.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionSparkHistoryLinkMessage(sparkHistoryUrl));
|
||||
|
||||
/*
|
||||
// Spark Tracking URl is not working now.
|
||||
let sparkTrackingUrl = this._dataModel.generateSparkTrackingUIUrl(submissionSettings, appId);
|
||||
vscode.window.showInformationMessage(LocalizedConstants.sparkJobSubmissionTrackingLinkMessage(sparkTrackingUrl));
|
||||
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionTrackingLinkMessage(sparkTrackingUrl)));
|
||||
op.updateStatus(sqlops.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionTrackingLinkMessage(sparkTrackingUrl));
|
||||
op.updateStatus(azdata.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionTrackingLinkMessage(sparkTrackingUrl));
|
||||
*/
|
||||
|
||||
let yarnUIUrl = this._dataModel.generateYarnUIUrl(submissionSettings, appId);
|
||||
vscode.window.showInformationMessage(LocalizedConstants.sparkJobSubmissionYarnUIMessage(yarnUIUrl));
|
||||
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionYarnUIMessage(yarnUIUrl)));
|
||||
op.updateStatus(sqlops.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionYarnUIMessage(yarnUIUrl));
|
||||
op.updateStatus(azdata.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionYarnUIMessage(yarnUIUrl));
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(LocalizedConstants.sparkJobSubmissionGetApplicationIdFailed(utils.getErrorMessage(error)));
|
||||
this.outputChannel.appendLine(this.addErrorTag(LocalizedConstants.sparkJobSubmissionGetApplicationIdFailed(utils.getErrorMessage(error))));
|
||||
op.updateStatus(sqlops.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionGetApplicationIdFailed(utils.getErrorMessage(error)));
|
||||
op.updateStatus(azdata.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionGetApplicationIdFailed(utils.getErrorMessage(error)));
|
||||
this.outputChannel.appendLine(LocalizedConstants.sparkJobSubmissionEndMessage);
|
||||
return;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ export class SparkJobSubmissionDialog {
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(LocalizedConstants.sparkJobSubmissionSubmitJobFailed(utils.getErrorMessage(error)));
|
||||
this.outputChannel.appendLine(this.addErrorTag(LocalizedConstants.sparkJobSubmissionSubmitJobFailed(utils.getErrorMessage(error))));
|
||||
op.updateStatus(sqlops.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionSubmitJobFailed(utils.getErrorMessage(error)));
|
||||
op.updateStatus(azdata.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionSubmitJobFailed(utils.getErrorMessage(error)));
|
||||
this.outputChannel.appendLine(LocalizedConstants.sparkJobSubmissionEndMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
import * as fs from 'fs';
|
||||
@@ -39,7 +39,7 @@ export class SparkJobSubmissionModel {
|
||||
|
||||
constructor(
|
||||
private readonly _sqlClusterConnection: SqlClusterConnection,
|
||||
private readonly _dialog: sqlops.window.Dialog,
|
||||
private readonly _dialog: azdata.window.Dialog,
|
||||
private readonly _appContext: AppContext,
|
||||
requestService?: (args: any) => any) {
|
||||
|
||||
@@ -54,7 +54,7 @@ export class SparkJobSubmissionModel {
|
||||
|
||||
public get connection(): SqlClusterConnection { return this._sqlClusterConnection; }
|
||||
public get dialogService(): SparkJobSubmissionService { return this._dialogService; }
|
||||
public get dialog(): sqlops.window.Dialog { return this._dialog; }
|
||||
public get dialog(): azdata.window.Dialog { return this._dialog; }
|
||||
|
||||
public isJarFile(): boolean {
|
||||
if (this.hdfsSubmitFilePath) {
|
||||
@@ -65,15 +65,15 @@ export class SparkJobSubmissionModel {
|
||||
}
|
||||
|
||||
public showDialogError(message: string): void {
|
||||
let errorLevel = sqlops.window.MessageLevel ? sqlops.window.MessageLevel : 0;
|
||||
let errorLevel = azdata.window.MessageLevel ? azdata.window.MessageLevel : 0;
|
||||
this._dialog.message = {
|
||||
text: message,
|
||||
level: <sqlops.window.MessageLevel>errorLevel
|
||||
level: <azdata.window.MessageLevel>errorLevel
|
||||
};
|
||||
}
|
||||
|
||||
public showDialogInfo(message: string): void {
|
||||
let infoLevel = sqlops.window.MessageLevel ? sqlops.window.MessageLevel.Information : 2;
|
||||
let infoLevel = azdata.window.MessageLevel ? azdata.window.MessageLevel.Information : 2;
|
||||
this._dialog.message = {
|
||||
text: message,
|
||||
level: infoLevel
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { AppContext } from '../appContext';
|
||||
import { getErrorMessage } from '../utils';
|
||||
@@ -15,7 +15,7 @@ export class OpenSparkYarnHistoryTask {
|
||||
constructor(private appContext: AppContext) {
|
||||
}
|
||||
|
||||
async execute(sqlConnProfile: sqlops.IConnectionProfile, isSpark: boolean): Promise<void> {
|
||||
async execute(sqlConnProfile: azdata.IConnectionProfile, isSpark: boolean): Promise<void> {
|
||||
try {
|
||||
let sqlClusterConnection = SqlClusterLookUp.findSqlClusterConnection(sqlConnProfile, this.appContext);
|
||||
if (!sqlClusterConnection)
|
||||
|
||||
@@ -9,27 +9,27 @@ import * as childProcess from 'child_process';
|
||||
import * as fs from 'fs-extra';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as path from 'path';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as which from 'which';
|
||||
import * as Constants from '../constants';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export function getDropdownValue(dropdownValue: string | sqlops.CategoryValue): string {
|
||||
export function getDropdownValue(dropdownValue: string | azdata.CategoryValue): string {
|
||||
if (typeof(dropdownValue) === 'string') {
|
||||
return <string>dropdownValue;
|
||||
} else {
|
||||
return dropdownValue ? (<sqlops.CategoryValue>dropdownValue).name : undefined;
|
||||
return dropdownValue ? (<azdata.CategoryValue>dropdownValue).name : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export function getServerAddressFromName(connection: sqlops.ConnectionInfo | string): string {
|
||||
export function getServerAddressFromName(connection: azdata.ConnectionInfo | string): string {
|
||||
// Strip TDS port number from the server URI
|
||||
if ((<sqlops.ConnectionInfo>connection).options && (<sqlops.ConnectionInfo>connection).options['host']) {
|
||||
return (<sqlops.ConnectionInfo>connection).options['host'].split(',')[0].split(':')[0];
|
||||
} else if ((<sqlops.ConnectionInfo>connection).options && (<sqlops.ConnectionInfo>connection).options['server']) {
|
||||
return (<sqlops.ConnectionInfo>connection).options['server'].split(',')[0].split(':')[0];
|
||||
if ((<azdata.ConnectionInfo>connection).options && (<azdata.ConnectionInfo>connection).options['host']) {
|
||||
return (<azdata.ConnectionInfo>connection).options['host'].split(',')[0].split(':')[0];
|
||||
} else if ((<azdata.ConnectionInfo>connection).options && (<azdata.ConnectionInfo>connection).options['server']) {
|
||||
return (<azdata.ConnectionInfo>connection).options['server'].split(',')[0].split(':')[0];
|
||||
} else {
|
||||
return (<string>connection).split(',')[0].split(':')[0];
|
||||
}
|
||||
@@ -141,7 +141,7 @@ export function executeStreamedCommand(cmd: string, outputChannel?: vscode.Outpu
|
||||
});
|
||||
}
|
||||
|
||||
export function isObjectExplorerContext(object: any): object is sqlops.ObjectExplorerContext {
|
||||
export function isObjectExplorerContext(object: any): object is azdata.ObjectExplorerContext {
|
||||
return 'connectionProfile' in object && 'isConnectionNode' in object;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user