UNPKG

snowflake-sdk

Version:
95 lines (94 loc) 3.05 kB
export = AzureUtil; /** * Creates an Azure utility object. * * @param {module} azure * @param {module} filestream * * @returns {Object} * @constructor */ declare function AzureUtil(connectionConfig: any): Object; declare class AzureUtil { /** * Creates an Azure utility object. * * @param {module} azure * @param {module} filestream * * @returns {Object} * @constructor */ constructor(connectionConfig: any); /** * Create a blob service client using an Azure SAS token. * * @param {Object} stageInfo * * @returns {String} */ createClient: (stageInfo: Object) => string; /** * Extract the container name and path from the metadata's stage location. * * @param {String} stageLocation * * @returns {Object} */ extractContainerNameAndPath: (stageLocation: string) => Object; /** * Create file header based on file being uploaded or not. * * @param {Object} meta * @param {String} filename * * @returns {Object} */ getFileHeader: (meta: Object, filename: string) => Object; /** * Create the file metadata then upload the file. * * @param {String} dataFile * @param {Object} meta * @param {Object} encryptionMetadata * @param {Number} maxConcurrency */ uploadFile: (dataFile: string, meta: Object, encryptionMetadata: Object, maxConcurrency: number) => Promise<void>; /** * Multi-block upload of `dataFile` to Azure Block Blob storage. Reads * `MULTIPART_PART_SIZE_BYTES` bytes per chunk into a fresh Buffer and stages * each as a separate `stageBlock` call, then commits the block list in order. * * On any error before commit, best-effort `deleteIfExists` runs on the * target blob to release any uncommitted blocks. Azure auto-GCs * uncommitted blocks after a week regardless, so the explicit cleanup * is just to avoid leaving the stage in a confusing intermediate state * for the immediate retry. * * @param {String} dataFile - Local file path to upload. * @param {Number} fileSize - Pre-stat'd file size in bytes. * @param {Object} meta * @param {Object} encryptionMetadata */ uploadFileMultipart: (dataFile: string, fileSize: number, meta: Object, encryptionMetadata: Object) => Promise<void>; /** * Create the file metadata then upload the file stream. * * @param {Buffer|string|stream.Readable} fileStream * @param {Object} meta * @param {Object} encryptionMetadata * @param {Number} maxConcurrency * * @returns {null} */ uploadFileStream: (fileStream: Buffer | string | stream.Readable, meta: Object, encryptionMetadata: Object, maxConcurrency: number) => null; /** * Download the file blob then write the file. * * @param {Object} meta * @param fullDstPath * * @returns {null} */ nativeDownloadFile: (meta: Object, fullDstPath: any) => null; }