Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/11 17:02:15 (14 years ago)
Author:
cneumuel
Message:

#1233

  • fixed statelog when time on server differs from slave or client
  • fixed wrong creation of childjobs in experiment manager
  • made ganttchardview the default view for statelogs
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveItem.cs

    r5676 r5718  
    3030  public partial class HiveItem : IItem {
    3131
    32     public HiveItem() {
    33     }
    34 
     32    public HiveItem() { }
    3533
    3634    protected HiveItem(HiveItem original, Cloner cloner) {
     35      cloner.RegisterClonedObject(original, this);
    3736      this.Id = original.Id;
    3837    }
    3938
    40     public IDeepCloneable Clone(Cloner cloner) {
     39    public virtual IDeepCloneable Clone(Cloner cloner) {
    4140      return new HiveItem(this, cloner);
    4241    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Job.cs

    r5614 r5718  
    3030    public Job() { }
    3131
    32     public void SetState(JobState state) {
    33       this.State = state;
    34       this.StateLog.Add(new StateLog() { State = state, DateTime = DateTime.Now });
    35     }
    36 
    37     public void SetState(JobState state, Guid userId) {
    38       this.State = state;
    39       this.StateLog.Add(new StateLog() { State = state, DateTime = DateTime.Now, UserId = userId });
    40     }
    41 
    42     public void SetState(JobState state, Guid slaveId, string exception) {
    43       this.State = state;
    44       this.StateLog.Add(new StateLog() { State = state, DateTime = DateTime.Now, SlaveId = slaveId, Exception = exception });
    45     }
    46 
    4732    protected Job(Job original, Cloner cloner) {
    4833      this.Priority = original.Priority;
     
    6045    }
    6146
    62     public IDeepCloneable Clone(Cloner cloner) {
     47    public override IDeepCloneable Clone(Cloner cloner) {
    6348      return new Job(this, cloner);
    6449    }
    6550
    66     public object Clone() {
    67       return Clone(new Cloner());
    68     }
    69 
    7051    public override string ToString() {
    71       return string.Format("State: {0}, SlaveId: {1}, DateCreated: {2}, DateCalculated: {3}, CoresNeeded: {4}, MemoryNeeded: {5}", State, CurrentStateLog.SlaveId, DateCreated, CoresNeeded, MemoryNeeded);
     52      return string.Format("State: {0}, SlaveId: {1}, DateCreated: {2}, DateCalculated: {3}, CoresNeeded: {4}, MemoryNeeded: {5}", State, CurrentStateLog.SlaveId, DateCreated.HasValue ? DateCreated.ToString() : "-", CoresNeeded, MemoryNeeded);
    7253    }
    7354  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/LightweightJob.cs

    r5614 r5718  
    2828
    2929  public partial class LightweightJob : IDeepCloneable, IContent {
     30    public StateLog CurrentStateLog { get { return StateLog.LastOrDefault(); } }
     31    public DateTime? DateCreated { get { return StateLog.Count > 0 ? new DateTime?(StateLog.First().DateTime) : null; } }
     32    public DateTime? DateFinished { get { return (StateLog.Count > 0 && CurrentStateLog.State == JobState.Finished) ? new DateTime?(CurrentStateLog.DateTime) : null; } }
    3033
    3134    public LightweightJob() {
     
    4851      this.Id = original.Id;
    4952    }
    50     public IDeepCloneable Clone(Cloner cloner) {
     53    public override IDeepCloneable Clone(Cloner cloner) {
    5154      return new LightweightJob(this, cloner);
    52     }
    53 
    54     public object Clone() {
    55       return Clone(new Cloner());
    56     }
    57 
    58     public StateLog CurrentStateLog { get { return StateLog.Last(); } }
    59     public DateTime DateCreated { get { return StateLog.First().DateTime; } }
    60     public DateTime? DateFinished { get { return CurrentStateLog.State == JobState.Finished ? new DateTime?(CurrentStateLog.DateTime) : null; } }
    61 
    62     public void SetState(JobState state) {
    63       this.State = state;
    64       this.StateLog.Add(new StateLog() { State = state, DateTime = DateTime.Now });
    65     }
    66 
    67     public void SetState(JobState state, Guid userId) {
    68       this.State = state;
    69       this.StateLog.Add(new StateLog() { State = state, DateTime = DateTime.Now, UserId = userId });
    70     }
    71 
    72     public void SetState(JobState state, Guid slaveId, string exception) {
    73       this.State = state;
    74       this.StateLog.Add(new StateLog() { State = state, DateTime = DateTime.Now, SlaveId = slaveId, Exception = exception });
    7555    }
    7656  }
Note: See TracChangeset for help on using the changeset viewer.