Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.IO;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.Hive.Client.Core.JobStorrage {
|
---|
8 | public class JobStorrageManager {
|
---|
9 | private static List<JobStorrageInfo> StoredJobsList = new List<JobStorrageInfo>();
|
---|
10 |
|
---|
11 | public static void PersistObjectToDisc(String serverIP, long serverPort, long jobId, byte[] job) {
|
---|
12 | String filename = serverIP + serverPort + jobId.ToString();
|
---|
13 |
|
---|
14 | JobStorrageInfo info = new JobStorrageInfo { JobID = jobId, ServerIP = serverIP, ServerPort = serverPort, TimeFinished = DateTime.Now };
|
---|
15 | try {
|
---|
16 | Stream jobstream = File.Create("jobStorrage\\"+filename + ".dat");
|
---|
17 | jobstream.Write(job, 0, job.Length);
|
---|
18 | StoredJobsList.Add(info);
|
---|
19 | jobstream.Close();
|
---|
20 | }
|
---|
21 | catch (Exception e) {
|
---|
22 | Console.WriteLine(e);
|
---|
23 | }
|
---|
24 | }
|
---|
25 | }
|
---|
26 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.