Exemplo n.º 1
0
 private FileUploader(string srcPath, string destPath, AdlsClient client, int numThreads,
                      IfExists doOverwrite, IProgress <TransferStatus> progressTracker, bool notRecurse, bool resume, bool isBinary, CancellationToken cancelToken, bool ingressTest, long chunkSize) : base(srcPath, destPath, client, numThreads, doOverwrite, progressTracker, notRecurse, resume, ingressTest, chunkSize, Path.Combine(Path.GetTempPath(), ".adl", "Upload", GetTransferLogFileName(srcPath, destPath, Path.DirectorySeparatorChar, '/')), cancelToken, $"binary:{isBinary}")
 {
     // If not recurse then we will have one thread and ProducerFirstPass logic loop will run only once
     NumProducerThreads    = NotRecurse ? 1 : NumProducerThreadsFirstPass;
     UploaderProducerQueue = new QueueWrapper <DirectoryInfo>(NumProducerThreads);
     if (FileTransferLog.IsDebugEnabled)
     {
         FileTransferLog.Debug($"FileTransfer.Uploader, Src: {SourcePath}, Dest: {DestPath}, Threads: {NumConsumerThreads}, TrackingProgress: {ProgressTracker != null}, OverwriteIfExist: {DoOverwrite == IfExists.Overwrite}");
     }
     _isBinary   = isBinary;
     _encodeType = Encoding.UTF8;
 }
        private FileDownloader(string srcPath, string destPath, AdlsClient client, int numThreads,
                               IfExists doOverwrite, IProgress <TransferStatus> progressTracker, bool notRecurse, bool disableTransferLogging, bool resume, CancellationToken cancelToken, bool egressTest, int egressBufferCapacity, long chunkSize) : base(srcPath, destPath, client, numThreads, doOverwrite, progressTracker, notRecurse, disableTransferLogging, resume, egressTest, chunkSize, Path.Combine(Path.GetTempPath(), ".adl", "Download", GetTransferLogFileName(client.AccountFQDN, srcPath, destPath, '/', Path.DirectorySeparatorChar)), cancelToken)
        {
            EgressBufferCapacity = egressBufferCapacity;

            // If not recurse then we will have one thread and ProducerFirstPass logic loop will run only once
            NumProducerThreads      = notRecurse ? 1 : NumProducerThreadsFirstPass;
            DownloaderProducerQueue = new QueueWrapper <DirectoryEntry>(NumProducerThreads);
            DownloaderList          = new List <DirectoryEntry>(DownloaderListCapacity);
            if (FileTransferLog.IsDebugEnabled)
            {
                FileTransferLog.Debug($"FileTransfer.Downloader, Src: {SourcePath}, Dest: {DestPath}, Threads: {NumConsumerThreads}, TrackingProgress: {ProgressTracker != null}, OverwriteIfExist: {DoOverwrite == IfExists.Overwrite}");
            }
        }