Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/25/11 17:34:47 (14 years ago)
Author:
ascheibe
Message:

#1233

  • added various bits to the Hive Server
  • adjusted data model
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs

    r5266 r5375  
    126126    public static DT.PluginData ToDto(PluginData source) {
    127127      if (source == null) return null;
    128       return new DT.PluginData { PluginId = source.PluginId, Data = source.Data.ToArray(), FileName = source.FileName };
     128      return new DT.PluginData { PluginId = source.PluginId, Data = source.Data.ToArray(), FileName = source.FileName, PluginDataId = source.PluginDataId };
    129129    }
    130130    public static PluginData ToEntity(DT.PluginData source) {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs

    r5156 r5375  
    9090                    orderby ar.Job.Priority descending
    9191                    select Convert.ToDto(ar.Job);
    92         return query;
     92        return query.ToArray();
    9393      }
    9494    }
     
    100100                    orderby j.Priority descending
    101101                    select Convert.ToDto(j);
    102         return query.Union(GetWaitingParentJobs(slave.Id)).OrderByDescending(x => x.Priority).ToArray();
     102        var waitingJobs = query.ToArray();
     103        var waitingParentJobs = GetWaitingParentJobs(slave.Id);
     104        return waitingJobs.Union(waitingParentJobs).OrderByDescending(x => x.Priority);
    103105      }
    104106    }
     
    322324    public Guid AddSlaveGroup(DT.SlaveGroup dto) {
    323325      using (var db = CreateContext()) {
     326        if (dto.Id == Guid.Empty)
     327          dto.Id = Guid.NewGuid();
    324328        var entity = Convert.ToEntity(dto);
    325329        db.Resources.InsertOnSubmit(entity);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml

    r5266 r5375  
    1515      <Column Name="Version" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
    1616      <Association Name="Plugin_RequiredPlugin" Member="RequiredPlugins" ThisKey="PluginId" OtherKey="PluginId" Type="RequiredPlugin" />
    17       <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" Cardinality="One" />
     17      <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" />
    1818    </Type>
    1919  </Table>
     
    2929  <Table Name="dbo.Resource" Member="Resources">
    3030    <Type Name="Resource" InheritanceCode="RESOURCE">
    31       <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
     31      <Column Name="ResourceId" AutoSync="OnInsert" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    3232      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
    3333      <Column Name="ResourceType" Type="System.String" CanBeNull="false" IsDiscriminator="true" />
     
    112112      <Column Name="Data" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX) NOT NULL" CanBeNull="false" UpdateCheck="Never" />
    113113      <Column Name="FileName" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
     114      <Column Name="PluginDataId" Type="System.Int32" DbType="Int IDENTITY(1,1)" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    114115      <Association Name="Plugin_PluginData" Member="Plugin" ThisKey="PluginId" OtherKey="PluginId" Type="Plugin" IsForeignKey="true" />
    115116    </Type>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout

    r5266 r5375  
    124124      </nestedChildShapes>
    125125    </classShape>
    126     <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.375, 5.5, 2, 1.3862939453124996">
     126    <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.625, 5.5, 2, 1.5785953776041666">
    127127      <DataClassMoniker Name="/HiveDataContext/PluginData" />
    128128      <nestedChildShapes>
    129         <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.39, 5.9600000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     129        <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.64, 5.9600000000000009, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    130130      </nestedChildShapes>
    131131    </classShape>
    132     <associationConnector edgePoints="[(11 : 6.19314697265625); (11.375 : 6.19314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     132    <associationConnector edgePoints="[(11 : 6.19314697265625); (11.625 : 6.19314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    133133      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
    134134      <nodes>
     
    137137      </nodes>
    138138    </associationConnector>
    139     <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     139    <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    140140      <AssociationMoniker Name="/HiveDataContext/Job/Job_JobData" />
    141141      <nodes>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs

    r5266 r5375  
    5555    partial void UpdateJobData(JobData instance);
    5656    partial void DeleteJobData(JobData instance);
     57    partial void InsertPluginData(PluginData instance);
     58    partial void UpdatePluginData(PluginData instance);
     59    partial void DeletePluginData(PluginData instance);
    5760    #endregion
    5861   
     
    360363    private EntitySet<RequiredPlugin> _RequiredPlugins;
    361364   
     365    private EntitySet<PluginData> _PluginData;
     366   
    362367    #region Extensibility Method Definitions
    363368    partial void OnLoaded();
     
    375380    {
    376381      this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
     382      this._PluginData = new EntitySet<PluginData>(new Action<PluginData>(this.attach_PluginData), new Action<PluginData>(this.detach_PluginData));
    377383      OnCreated();
    378384    }
     
    451457    }
    452458   
     459    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_PluginData", Storage="_PluginData", ThisKey="PluginId", OtherKey="PluginId")]
     460    public EntitySet<PluginData> PluginData
     461    {
     462      get
     463      {
     464        return this._PluginData;
     465      }
     466      set
     467      {
     468        this._PluginData.Assign(value);
     469      }
     470    }
     471   
    453472    public event PropertyChangingEventHandler PropertyChanging;
    454473   
     
    478497   
    479498    private void detach_RequiredPlugins(RequiredPlugin entity)
     499    {
     500      this.SendPropertyChanging();
     501      entity.Plugin = null;
     502    }
     503   
     504    private void attach_PluginData(PluginData entity)
     505    {
     506      this.SendPropertyChanging();
     507      entity.Plugin = this;
     508    }
     509   
     510    private void detach_PluginData(PluginData entity)
    480511    {
    481512      this.SendPropertyChanging();
     
    724755    }
    725756   
    726     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
     757    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
    727758    public System.Guid ResourceId
    728759    {
     
    23862417 
    23872418  [global::System.Data.Linq.Mapping.TableAttribute(Name="")]
    2388   public partial class PluginData
     2419  public partial class PluginData : INotifyPropertyChanging, INotifyPropertyChanged
    23892420  {
    23902421   
     2422    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     2423   
    23912424    private System.Guid _PluginId;
    23922425   
     
    23952428    private string _FileName;
    23962429   
     2430    private int _PluginDataId;
     2431   
     2432    private EntityRef<Plugin> _Plugin;
     2433   
     2434    #region Extensibility Method Definitions
     2435    partial void OnLoaded();
     2436    partial void OnValidate(System.Data.Linq.ChangeAction action);
     2437    partial void OnCreated();
     2438    partial void OnPluginIdChanging(System.Guid value);
     2439    partial void OnPluginIdChanged();
     2440    partial void OnDataChanging(System.Data.Linq.Binary value);
     2441    partial void OnDataChanged();
     2442    partial void OnFileNameChanging(string value);
     2443    partial void OnFileNameChanged();
     2444    partial void OnPluginDataIdChanging(int value);
     2445    partial void OnPluginDataIdChanged();
     2446    #endregion
     2447   
    23972448    public PluginData()
    23982449    {
     2450      this._Plugin = default(EntityRef<Plugin>);
     2451      OnCreated();
    23992452    }
    24002453   
     
    24102463        if ((this._PluginId != value))
    24112464        {
     2465          if (this._Plugin.HasLoadedOrAssignedValue)
     2466          {
     2467            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     2468          }
     2469          this.OnPluginIdChanging(value);
     2470          this.SendPropertyChanging();
    24122471          this._PluginId = value;
     2472          this.SendPropertyChanged("PluginId");
     2473          this.OnPluginIdChanged();
    24132474        }
    24142475      }
     
    24262487        if ((this._Data != value))
    24272488        {
     2489          this.OnDataChanging(value);
     2490          this.SendPropertyChanging();
    24282491          this._Data = value;
     2492          this.SendPropertyChanged("Data");
     2493          this.OnDataChanged();
    24292494        }
    24302495      }
     
    24422507        if ((this._FileName != value))
    24432508        {
     2509          this.OnFileNameChanging(value);
     2510          this.SendPropertyChanging();
    24442511          this._FileName = value;
    2445         }
     2512          this.SendPropertyChanged("FileName");
     2513          this.OnFileNameChanged();
     2514        }
     2515      }
     2516    }
     2517   
     2518    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginDataId", AutoSync=AutoSync.OnInsert, DbType="Int IDENTITY(1,1)", IsPrimaryKey=true, IsDbGenerated=true)]
     2519    public int PluginDataId
     2520    {
     2521      get
     2522      {
     2523        return this._PluginDataId;
     2524      }
     2525      set
     2526      {
     2527        if ((this._PluginDataId != value))
     2528        {
     2529          this.OnPluginDataIdChanging(value);
     2530          this.SendPropertyChanging();
     2531          this._PluginDataId = value;
     2532          this.SendPropertyChanged("PluginDataId");
     2533          this.OnPluginDataIdChanged();
     2534        }
     2535      }
     2536    }
     2537   
     2538    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_PluginData", Storage="_Plugin", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true)]
     2539    public Plugin Plugin
     2540    {
     2541      get
     2542      {
     2543        return this._Plugin.Entity;
     2544      }
     2545      set
     2546      {
     2547        Plugin previousValue = this._Plugin.Entity;
     2548        if (((previousValue != value)
     2549              || (this._Plugin.HasLoadedOrAssignedValue == false)))
     2550        {
     2551          this.SendPropertyChanging();
     2552          if ((previousValue != null))
     2553          {
     2554            this._Plugin.Entity = null;
     2555            previousValue.PluginData.Remove(this);
     2556          }
     2557          this._Plugin.Entity = value;
     2558          if ((value != null))
     2559          {
     2560            value.PluginData.Add(this);
     2561            this._PluginId = value.PluginId;
     2562          }
     2563          else
     2564          {
     2565            this._PluginId = default(System.Guid);
     2566          }
     2567          this.SendPropertyChanged("Plugin");
     2568        }
     2569      }
     2570    }
     2571   
     2572    public event PropertyChangingEventHandler PropertyChanging;
     2573   
     2574    public event PropertyChangedEventHandler PropertyChanged;
     2575   
     2576    protected virtual void SendPropertyChanging()
     2577    {
     2578      if ((this.PropertyChanging != null))
     2579      {
     2580        this.PropertyChanging(this, emptyChangingEventArgs);
     2581      }
     2582    }
     2583   
     2584    protected virtual void SendPropertyChanged(String propertyName)
     2585    {
     2586      if ((this.PropertyChanged != null))
     2587      {
     2588        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    24462589      }
    24472590    }
Note: See TracChangeset for help on using the changeset viewer.