Changeset 1340


Ignore:
Timestamp:
03/13/09 11:59:36 (12 years ago)
Author:
kgrading
Message:

Code Review changes (#522)

Location:
trunk/sources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Communication/WcfService.cs

    r1271 r1340  
    8989        if (Connected != null)
    9090          Connected(this, new EventArgs());                               
    91        
     91        //Todo: This won't be hit. EVER       
    9292        if (ConnState == NetworkEnum.WcfConnState.Failed)
    9393          ConnectionRestored(this, new EventArgs());       
    9494      }
    9595      catch (Exception ex) {
     96        //Todo: Rename to HandleNetworkError
    9697        NetworkErrorHandling(ex);
    9798      }
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r1260 r1340  
    5252  public class Core: MarshalByRefObject {
    5353    public delegate string GetASnapshotDelegate();
    54 
     54    //Todo: private + getter/setter removen.
    5555    public static Object Locker { get; set; }
    56 
     56    //Todo: ev. Rename to "abortRequested"
    5757    public static bool ShutdownFlag { get; set; }
    58 
     58   
     59    //Todo: Access modifier
    5960    Dictionary<long, Executor> engines = new Dictionary<long, Executor>();
    6061    Dictionary<long, AppDomain> appDomains = new Dictionary<long, AppDomain>();
     
    9899      MessageQueue queue = MessageQueue.GetInstance();
    99100     
    100       //Main processing loop
     101      //Main processing loop     
     102      //Todo: own thread for message handling
    101103      while (!ShutdownFlag) {
    102104        MessageContainer container = queue.GetMessage();
     
    112114    /// <param name="container">The Container, containing the message</param>
    113115    private void DetermineAction(MessageContainer container) {
     116      //Todo: Threads aus Threadpool verwenden
     117     
    114118      switch (container.Message) {
    115119        //Server requests to abort a job
     
    152156    private void GetFinishedJob(object jobId) {
    153157      long jId = (long)jobId;
     158      //Todo: Don't return null, throw exception!
    154159      byte[] sJob = engines[jId].GetFinishedJob();
    155160
     
    162167          true);
    163168      } else {
     169        //Todo: locking
    164170        JobStorrageManager.PersistObjectToDisc(wcfService.ServerIP, wcfService.ServerPort, jId, sJob);
    165171        AppDomain.Unload(appDomains[jId]);
     
    219225    }
    220226
     227    //Todo: Remove intellgent stuff from the async event and move it to the main thread (message queue)
     228    //Todo: Seperate this method into 2: Finished jobs and Snapshots
    221229    void wcfService_SendJobResultCompleted(object sender, SendJobResultCompletedEventArgs e) {
    222230      if (e.Result.Success) {       
     
    237245        }       
    238246      } else {
     247        //Todo: don't Java Style! IT'S EVIL!
    239248        Logging.GetInstance().Error(this.ToString(), "Sending of job " + e.Result.JobId + " failed");
    240249      }
    241250    }
    242251
     252    //Todo: First stop all threads, then terminate
    243253    void wcfService_ServerChanged(object sender, EventArgs e) {
    244254      Logging.GetInstance().Info(this.ToString(), "ServerChanged has been called");
  • trunk/sources/HeuristicLab.Hive.Client.Core/Heartbeat.cs

    r1255 r1340  
    7373      Console.WriteLine("tick"); 
    7474      ClientInfo info = ConfigManager.Instance.GetClientInfo();
    75       // Todo: remove tempfix for free cores.
     75      // Todo: remove tempfix for free cores. Fix spelling of freeCores (uppercase)
    7676
    7777      HeartBeatData heartBeatData = new HeartBeatData {
  • trunk/sources/HeuristicLab.Hive.Client.Core/JobStorrage/JobStorrageManager.cs

    r1271 r1340  
    1313   
    1414    private static List<JobStorrageInfo> storedJobsList = new List<JobStorrageInfo>();
     15    //Todo: execution path
     16    //Todo: Choose a better directory name
    1517    private static String path = "C:\\Program Files\\HeuristicLab 3.0\\plugins\\jobStorrage\\";
    1618   
     
    1921
    2022      JobStorrageInfo info = new JobStorrageInfo { JobID = jobId, ServerIP = serverIP, ServerPort = serverPort, TimeFinished = DateTime.Now };
     23     
     24      //Todo: Filestream won't be closed if exception occurs
    2125      try {
    2226        Stream jobstream = File.Create(path + filename + ".dat");
     
    2731      }
    2832      catch (Exception e) {
     33        //Todo: Change to logging.exception!
    2934        Console.WriteLine(e);
    3035      }       
     
    3742          Logging.GetInstance().Info("JobStorrageManager", "Sending stored job " + storedJobsList[index-1].JobID + " to the server");
    3843          byte[] job = File.ReadAllBytes(path + filename + ".dat");
     44         
     45          //Todo: ask server first if he really wants the job...
    3946          ResponseResultReceived res = WcfService.Instance.SendStoredJobResultsSync(ConfigManager.Instance.GetClientInfo().ClientId, storedJobsList[index-1].JobID, job, 1.00, null, true);
    4047          //TODO: has to be fixed from server side
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.cs

    r995 r1340  
    1414    }
    1515}
     16
     17namespace dsHiveServerTableAdapters {
     18   
     19   
     20    public partial class HiveUserTableAdapter {
     21    }
     22}
  • trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs

    r1334 r1340  
    4646      new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
    4747
     48    // todo: access modifier!
    4849    IClientAdapter clientAdapter;
    4950    IJobAdapter jobAdapter;
     
    143144      heartbeatLock.ExitWriteLock();
    144145
     146      // todo: allClients legacy ?
    145147      ICollection<ClientInfo> allClients = clientAdapter.GetAll();
    146148      ClientInfo client = clientAdapter.GetById(clientInfo.ClientId);
     
    165167    /// <param name="hbData"></param>
    166168    /// <returns></returns>
     169    // todo: new name for "SendHeartBeat" e.g. ProcessHeartBeat
    167170    public ResponseHB SendHeartBeat(HeartBeatData hbData) {
    168171      ResponseHB response = new ResponseHB();
Note: See TracChangeset for help on using the changeset viewer.