mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Support HDFS Tiering (#7484)
This is the 1st step to supporting HDFS Tiering Changes: Add new mounted folder icon. Will have separate commit for file icon Disable delete/mkdir/upload for mounted files and folders Disable delete for root HDFS folder (this was added in error)
This commit is contained in:
19
extensions/mssql/src/hdfs/mount.ts
Normal file
19
extensions/mssql/src/hdfs/mount.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Information about a HDFS mount to a remote directory
|
||||
*/
|
||||
export interface Mount {
|
||||
mountPath: string;
|
||||
mountStatus: string;
|
||||
remotePath: string;
|
||||
}
|
||||
|
||||
export enum MountStatus {
|
||||
None = 0,
|
||||
Mount = 1,
|
||||
Mount_Child = 2
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import * as nls from 'vscode-nls';
|
||||
import * as auth from '../util/auth';
|
||||
import { IHdfsOptions, IRequestParams } from '../objectExplorerNodeProvider/fileSources';
|
||||
import { IAclStatus, AclEntry, parseAcl, AclPermissionType, parseAclPermissionFromOctal, AclEntryScope } from './aclEntry';
|
||||
import { Mount } from './mount';
|
||||
import { everyoneName } from '../localizedConstants';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
@@ -472,6 +473,26 @@ export class WebHDFS {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all mounts for a HDFS connection
|
||||
* @param callback Callback to handle the response
|
||||
* @returns void
|
||||
*/
|
||||
public getMounts(callback: (error: HdfsError, mounts: Mount[]) => void): void {
|
||||
let endpoint = this.getOperationEndpoint('listmounts', '');
|
||||
this.sendRequest('GET', endpoint, undefined, (error, response) => {
|
||||
if (!callback) { return; }
|
||||
if (error) {
|
||||
callback(error, undefined);
|
||||
} else if (response.body.hasOwnProperty('Mounts')) {
|
||||
const mounts = response.body.Mounts;
|
||||
callback(undefined, mounts);
|
||||
} else {
|
||||
callback(new HdfsError(ErrorMessageInvalidDataStructure), undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check file existence
|
||||
* Wraps stat method
|
||||
|
||||
Reference in New Issue
Block a user