Changeset 17194
- Timestamp:
- 08/07/19 14:44:13 (5 years ago)
- Location:
- misc/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain.csproj
r15921 r17194 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <Project ToolsVersion=" 4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">2 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 3 3 <PropertyGroup> 4 4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> … … 11 11 <RootNamespace>HiveDrain</RootNamespace> 12 12 <AssemblyName>HeuristicLab.HiveDrain</AssemblyName> 13 <TargetFrameworkVersion>v4. 5</TargetFrameworkVersion>13 <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> 14 14 <TargetFrameworkProfile> 15 15 </TargetFrameworkProfile> -
misc/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/JobDownloader.cs
r15347 r17194 23 23 using System.Collections.Generic; 24 24 using System.IO; 25 using System.Linq; 25 26 using System.Threading; 26 27 using HeuristicLab.Clients.Hive; … … 51 52 Semaphore limitSemaphore = new Semaphore(HeuristicLabHiveDrainApplication.MaxParallelDownloads, HeuristicLabHiveDrainApplication.MaxParallelDownloads); 52 53 54 var invalidChars = Path.GetInvalidFileNameChars(); 55 53 56 foreach (Job j in jobsLoaded) { 54 57 if (string.IsNullOrEmpty(NamePattern) || j.Name.Contains(NamePattern)) { 55 string jobPath = Path.Combine(RootLocation, String.Format("{0} - {1}", j.Name, j.Id));56 58 log.LogMessage(String.Format("\"{0}\": {1}", j.Name, j.Id)); 59 60 61 var jobName = j.Name; 62 //handle invalid characters in fileNames 63 if (invalidChars.Any(c => jobName.Contains(c))) { 64 log.LogMessage("Job name contains characters that cannot be used as filename. Invalid characters are replaced with '_'."); 65 foreach (var c in invalidChars) { 66 jobName = jobName.Replace(c, '_'); 67 } 68 } 69 70 string jobPath = Path.Combine(RootLocation, String.Format("{0} - {1}", jobName, j.Id)); 71 57 72 58 73 if (OneFile) { 59 74 JobTaskOneFileDownloader taskDownloader = new JobTaskOneFileDownloader(jobPath, j, limitSemaphore, log); 60 75 taskDownloader.Start(); 61 } else { 76 } 77 else { 62 78 JobTaskDownloader taskDownloader = new JobTaskDownloader(jobPath, j, limitSemaphore, log); 63 79 taskDownloader.Start(); 64 80 } 65 } else { 81 } 82 else { 66 83 log.LogMessage(String.Format("\"{0}\": {1} ---> ignored", j.Name, j.Id)); 67 84 } -
misc/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/JobTaskOneFileDownloader.cs
r15494 r17194 33 33 namespace HeuristicLab.HiveDrain { 34 34 public class JobTaskOneFileDownloader { 35 public String RootLocation { get; set; }35 public string RootLocation { get; set; } 36 36 37 37 public Job ParentJob { get; set; } … … 39 39 private ILog log; 40 40 41 private RunCollection results = new RunCollection();42 41 43 42 private static ConcurrentTaskDownloader<ItemTask> downloader = 44 43 new ConcurrentTaskDownloader<ItemTask>(HeuristicLabHiveDrainApplication.MaxParallelDownloads, HeuristicLabHiveDrainApplication.MaxParallelDownloads); 45 46 private static int jobCount = 0;47 48 private static bool endReached = false;49 44 50 45 private ManualResetEvent allJobsFinished = new ManualResetEvent(false); … … 68 63 69 64 public void Start() { 70 results = new RunCollection();71 65 72 66 var allTasks = HiveServiceLocator.Instance.CallHiveService(s => s.GetLightweightJobTasksWithoutStateLog(ParentJob.Id));
Note: See TracChangeset
for help on using the changeset viewer.