- Timestamp:
- 05/08/09 14:55:56 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Core/3.2/JobStorage/JobStorageManager.cs
r1728 r1775 9 9 using HeuristicLab.Hive.Contracts; 10 10 using System.Xml.Serialization; 11 using System.Diagnostics; 11 12 12 13 namespace HeuristicLab.Hive.Client.Core.JobStorage { … … 16 17 //Todo: execution path 17 18 //Todo: Choose a better directory name 18 private static String path = "C:\\Program Files\\HeuristicLab 3.0\\plugins\\ jobStorrage\\";19 private static String path = "C:\\Program Files\\HeuristicLab 3.0\\plugins\\Hive.Client.Jobs\\"; 19 20 20 21 public static void PersistObjectToDisc(String serverIP, long serverPort, Guid jobId, byte[] job) { … … 30 31 jobstream.Write(job, 0, job.Length); 31 32 storedJobsList.Add(info); 32 Logging.Instance.Info("JobStorageManager", "Job " + info.JobID + " stored on the harddisc"); 33 Debug.WriteLine("Job " + info.JobID + " stored on the harddisc"); 34 //Logging.Instance.Info("JobStorageManager", "Job " + info.JobID + " stored on the harddisc"); 33 35 } 34 36 catch (Exception e) { … … 48 50 if (WcfService.Instance.ConnState == NetworkEnum.WcfConnState.Loggedin && (storedJobsList[index-1].ServerIP == WcfService.Instance.ServerIP && storedJobsList[index-1].ServerPort == WcfService.Instance.ServerPort)) { 49 51 String filename = storedJobsList[index-1].ServerIP + "." + storedJobsList[index-1].ServerPort + "." + storedJobsList[index-1].JobID.ToString(); 50 Logging.Instance.Info("JobStorrageManager", "Sending stored job " + storedJobsList[index - 1].JobID + " to the server"); 52 Debug.WriteLine("Sending stored job " + storedJobsList[index - 1].JobID + " to the server"); 53 //Logging.Instance.Info("JobStorrageManager", "Sending stored job " + storedJobsList[index - 1].JobID + " to the server"); 51 54 byte[] job = File.ReadAllBytes(path + filename + ".dat"); 52 55 53 56 //Todo: ask server first if he really wants the job... 54 57 ResponseResultReceived res = WcfService.Instance.SendStoredJobResultsSync(ConfigManager.Instance.GetClientInfo().Id, storedJobsList[index-1].JobID, job, 1.00, null, true); 58 ClientStatusInfo.JobsProcessed++; 55 59 //TODO: has to be fixed from server side 56 60 //if (res.Success == true) { 57 Logging.Instance.Info("JobStorrageManager", "Sending of job " + storedJobsList[index - 1].JobID + " done"); 61 Debug.WriteLine("Sending of job " + storedJobsList[index - 1].JobID + " done"); 62 //Logging.Instance.Info("JobStorrageManager", "Sending of job " + storedJobsList[index - 1].JobID + " done"); 63 58 64 storedJobsList.Remove(storedJobsList[index - 1]); 59 65 File.Delete(path + filename + ".dat"); … … 66 72 public static void StoreJobList() { 67 73 XmlSerializer serializer = new XmlSerializer(typeof(List<JobStorageInfo>)); 68 TextWriter writer = new StreamWriter( path + "list.xml");74 TextWriter writer = new StreamWriter(Path.Combine(path ,"list.xml")); 69 75 serializer.Serialize(writer, storedJobsList); 76 writer.Close(); 70 77 } 71 78
Note: See TracChangeset
for help on using the changeset viewer.