public void DownloadTables(string tablePrefix = "") { Log.Info($"enumerating tables: with prefix {tablePrefix}"); int resultsCount = 0; TableContinuationToken token = new TableContinuationToken(); tablePrefix = string.IsNullOrEmpty(Config.UriFilter) ? tablePrefix : Config.UriFilter; while (token != null) { try { Task <TableResultSegment> tableSegment = _tableClient.ListTablesSegmentedAsync(tablePrefix, MaxResults, token, null, null); Task <TableResultSegment> task = DownloadTablesSegmentAsync(tableSegment, Config.NodeFilter); token = task.Result.ContinuationToken; resultsCount += task.Result.Results.Count; } catch (Exception e) { Log.Exception($"exception in table enumeration { e }"); break; } } Log.Info("finished table enumeration"); _tableTasks.Wait(); Log.Highlight($"processed table count:{ resultsCount.ToString("#,#") } minutes:{ (DateTime.Now - StartTime).TotalMinutes.ToString("F3") } "); }
public void DownloadContainers(string containerPrefix = "") { EnumerateContainers(containerPrefix); foreach (CloudBlobContainer container in ContainerList) { Log.Info($"ContainerName: {container.Name}, NodeFilter: {Config.NodeFilter}"); DownloadContainer(container); } Log.Info("waiting for download tasks"); _blobTasks.Wait(); _blobChildTasks.Wait(); }
public bool Initialize() { _noProgressTimer = new Timer(NoProgressCallback, null, 0, 60 * 1000); Log.Open(); CustomTaskManager.Resume(); if (_initialized) { _taskManager?.Wait(); _taskManager = new CustomTaskManager(); Instance.Initialize(); } else { if (!Config.PopulateConfig(_args)) { Config.SaveConfigFile(); return(false); } _initialized = true; Log.Info($"version: {Version}"); _parallelConfig = new ParallelOptions { MaxDegreeOfParallelism = Config.Threads }; ServicePointManager.DefaultConnectionLimit = Config.Threads * MaxThreadMultiplier; ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; ThreadPool.SetMinThreads(Config.Threads * MinThreadMultiplier, Config.Threads * MinThreadMultiplier); ThreadPool.SetMaxThreads(Config.Threads * MaxThreadMultiplier, Config.Threads * MaxThreadMultiplier); } return(true); }