Changeset 1775


Ignore:
Timestamp:
05/08/09 14:55:56 (12 years ago)
Author:
kgrading
Message:

fixed small changes in logging, messagequeues and the jobfetching (#467)

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Common/3.2/Logging.cs

    r1530 r1775  
    7777    public void Error(String source, String message) {
    7878      eventLogger.Source = source;
    79       eventLogger.WriteEntry(message, EventLogEntryType.Error);
     79      //, EventLogEntryType.Error
     80      eventLogger.WriteEntry(message);
    8081      eventLogger.Close();
    8182    }
     
    8990    public void Error(String source, String message, Exception e) {
    9091      eventLogger.Source = source;
    91       eventLogger.WriteEntry(message +"\n" + e.ToString(), EventLogEntryType.Error);
     92      eventLogger.WriteEntry(message +"\n" + e.ToString());
    9293      eventLogger.Close();
    9394    }
  • trunk/sources/HeuristicLab.Hive.Client.Common/3.2/MessageQueue.cs

    r1530 r1775  
    5151
    5252    /// <summary>
     53    /// Sets Lease time to infinite
     54    /// </summary>
     55    /// <returns>nothing</returns>
     56    public override object InitializeLifetimeService() {
     57      return null;
     58    }
     59
     60    /// <summary>
    5361    /// Creates a new MessageQueue Object.
    5462    /// A new Queue and a Semaphore is created. The Semaphore is set to a max size of 5000.
  • trunk/sources/HeuristicLab.Hive.Client.Core/3.2/Core.cs

    r1755 r1775  
    118118        //Job has been successfully aborted
    119119        case MessageContainer.MessageType.JobAborted:
    120           Debug.WriteLine("-- Job Aborted Message received");
     120          //todo: thread this
     121          Debug.WriteLine("Job aborted, he's dead");
     122          lock (engines) {
     123            AppDomain.Unload(appDomains[container.JobId]);
     124            appDomains.Remove(container.JobId);
     125            engines.Remove(container.JobId);
     126            jobs.Remove(container.JobId);
     127          }
    121128          break;
    122129        //Request a Snapshot from the Execution Engine
     
    132139          if (!currentlyFetching) {
    133140            wcfService.SendJobAsync(ConfigManager.Instance.GetClientInfo().Id);
    134             currentlyFetching = false;
     141            currentlyFetching = true;
    135142          }         
    136143          break;         
     
    212219        //Todo: make a set & override the equals method
    213220        List<byte[]> files = new List<byte[]>();
    214         foreach (CachedHivePluginInfo plugininfo in PluginCache.Instance.GetPlugins(e.Result.Job.PluginsNeeded))
    215           files.AddRange(plugininfo.PluginFiles);
     221        //foreach (CachedHivePluginInfo plugininfo in PluginCache.Instance.GetPlugins(e.Result.Job.PluginsNeeded))
     222        //  files.AddRange(plugininfo.PluginFiles);
    216223       
    217224        AppDomain appDomain = PluginManager.Manager.CreateAndInitAppDomainWithSandbox(e.Result.Job.Id.ToString(), sandboxed, null, files);
     
    232239            Debug.WriteLine("Increment FetchedJobs to:" + ClientStatusInfo.JobsFetched);
    233240          }
    234         }
    235       }
     241        }       
     242      }
     243      currentlyFetching = false;
    236244    }
    237245   
  • trunk/sources/HeuristicLab.Hive.Client.Core/3.2/JobStorage/JobStorageManager.cs

    r1728 r1775  
    99using HeuristicLab.Hive.Contracts;
    1010using System.Xml.Serialization;
     11using System.Diagnostics;
    1112
    1213namespace HeuristicLab.Hive.Client.Core.JobStorage {
     
    1617    //Todo: execution path
    1718    //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\\";
    1920   
    2021    public static void PersistObjectToDisc(String serverIP, long serverPort, Guid jobId, byte[] job) {
     
    3031        jobstream.Write(job, 0, job.Length);
    3132        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");
    3335      }
    3436      catch (Exception e) {
     
    4850        if (WcfService.Instance.ConnState == NetworkEnum.WcfConnState.Loggedin && (storedJobsList[index-1].ServerIP == WcfService.Instance.ServerIP && storedJobsList[index-1].ServerPort == WcfService.Instance.ServerPort)) {
    4951          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");
    5154          byte[] job = File.ReadAllBytes(path + filename + ".dat");
    5255         
    5356          //Todo: ask server first if he really wants the job...
    5457          ResponseResultReceived res = WcfService.Instance.SendStoredJobResultsSync(ConfigManager.Instance.GetClientInfo().Id, storedJobsList[index-1].JobID, job, 1.00, null, true);
     58          ClientStatusInfo.JobsProcessed++;
    5559          //TODO: has to be fixed from server side
    5660          //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
    5864          storedJobsList.Remove(storedJobsList[index - 1]);
    5965          File.Delete(path + filename + ".dat");
     
    6672    public static void StoreJobList() {
    6773      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"));
    6975      serializer.Serialize(writer, storedJobsList);
     76      writer.Close();
    7077    }
    7178   
Note: See TracChangeset for help on using the changeset viewer.