Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/19/09 13:05:47 (15 years ago)
Author:
svonolfe
Message:

Implemented job assignment to resources (#507)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/dsHiveServer.Designer.cs

    r2001 r2066  
    7676        private global::System.Data.DataRelation relationR_37;
    7777       
     78        private global::System.Data.DataRelation relationR_44;
     79       
    7880        private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
    7981       
     
    454456            this.relationR_56 = this.Relations["R_56"];
    455457            this.relationR_37 = this.Relations["R_37"];
     458            this.relationR_44 = this.Relations["R_44"];
    456459        }
    457460       
     
    541544                        this.tableClient.ClientConfigIdColumn}, false);
    542545            this.Relations.Add(this.relationR_37);
     546            this.relationR_44 = new global::System.Data.DataRelation("R_44", new global::System.Data.DataColumn[] {
     547                        this.tableJob.JobIdColumn}, new global::System.Data.DataColumn[] {
     548                        this.tableJob.ParentJobIdColumn}, false);
     549            this.Relations.Add(this.relationR_44);
    543550        }
    544551       
     
    19381945           
    19391946            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    1940             public JobRow AddJobRow(System.Guid JobId, System.Guid ParentJobId, string JobState, ClientRow parentClientRowByR_21, double Percentage, byte[] SerializedJob, System.DateTime DateCreated, System.DateTime DateCalculated, int Priority, ProjectRow parentProjectRowByR_49, System.Guid UserId, int CoresNeeded, int MemoryNeeded) {
     1947            public JobRow AddJobRow(System.Guid JobId, JobRow parentJobRowByR_44, string JobState, ClientRow parentClientRowByR_21, double Percentage, byte[] SerializedJob, System.DateTime DateCreated, System.DateTime DateCalculated, int Priority, ProjectRow parentProjectRowByR_49, System.Guid UserId, int CoresNeeded, int MemoryNeeded) {
    19411948                JobRow rowJobRow = ((JobRow)(this.NewRow()));
    19421949                object[] columnValuesArray = new object[] {
    19431950                        JobId,
    1944                         ParentJobId,
     1951                        null,
    19451952                        JobState,
    19461953                        null,
     
    19541961                        CoresNeeded,
    19551962                        MemoryNeeded};
     1963                if ((parentJobRowByR_44 != null)) {
     1964                    columnValuesArray[1] = parentJobRowByR_44[0];
     1965                }
    19561966                if ((parentClientRowByR_21 != null)) {
    19571967                    columnValuesArray[3] = parentClientRowByR_21[0];
     
    44574467           
    44584468            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     4469            public JobRow JobRowParent {
     4470                get {
     4471                    return ((JobRow)(this.GetParentRow(this.Table.ParentRelations["R_44"])));
     4472                }
     4473                set {
     4474                    this.SetParentRow(value, this.Table.ParentRelations["R_44"]);
     4475                }
     4476            }
     4477           
     4478            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    44594479            public bool IsParentJobIdNull() {
    44604480                return this.IsNull(this.tableJob.ParentJobIdColumn);
     
    46034623                else {
    46044624                    return ((AssignedResourcesRow[])(base.GetChildRows(this.Table.ChildRelations["R_56"])));
     4625                }
     4626            }
     4627           
     4628            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     4629            public JobRow[] GetJobRows() {
     4630                if ((this.Table.ChildRelations["R_44"] == null)) {
     4631                    return new JobRow[0];
     4632                }
     4633                else {
     4634                    return ((JobRow[])(base.GetChildRows(this.Table.ChildRelations["R_44"])));
    46054635                }
    46064636            }
     
    74027432            this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
    74037433            this._adapter.DeleteCommand.Connection = this.Connection;
    7404             this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[Job] WHERE (([JobId] = @Original_JobId) AND ((@IsNull_ParentJobId = 1 AND [ParentJobId] IS NULL) OR ([ParentJobId] = @Original_ParentJobId)) AND ((@IsNull_JobState = 1 AND [JobState] IS NULL) OR ([JobState] = @Original_JobState)) AND ((@IsNull_ResourceId = 1 AND [ResourceId] IS NULL) OR ([ResourceId] = @Original_ResourceId)) AND ((@IsNull_Percentage = 1 AND [Percentage] IS NULL) OR ([Percentage] = @Original_Percentage)) AND ((@IsNull_DateCreated = 1 AND [DateCreated] IS NULL) OR ([DateCreated] = @Original_DateCreated)) AND ((@IsNull_DateCalculated = 1 AND [DateCalculated] IS NULL) OR ([DateCalculated] = @Original_DateCalculated)) AND ((@IsNull_Priority = 1 AND [Priority] IS NULL) OR ([Priority] = @Original_Priority)) AND ((@IsNull_ProjectId = 1 AND [ProjectId] IS NULL) OR ([ProjectId] = @Original_ProjectId)) AND ((@IsNull_UserId = 1 AND [UserId] IS NULL) OR ([UserId] = @Original_UserId)) AND ((@IsNull_CoresNeeded = 1 AND [CoresNeeded] IS NULL) OR ([CoresNeeded] = @Original_CoresNeeded)) AND ((@IsNull_MemoryNeeded = 1 AND [MemoryNeeded] IS NULL) OR ([MemoryNeeded] = @Original_MemoryNeeded)))";
     7434            this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[Job] WHERE (([JobId] = @Original_JobId) AND ((@IsNull_ParentJobId = 1 AND [ParentJobId] IS NULL) OR ([ParentJobId] = @Original_ParentJobId)) AND ((@IsNull_ResourceId = 1 AND [ResourceId] IS NULL) OR ([ResourceId] = @Original_ResourceId)) AND ((@IsNull_Percentage = 1 AND [Percentage] IS NULL) OR ([Percentage] = @Original_Percentage)) AND ((@IsNull_DateCreated = 1 AND [DateCreated] IS NULL) OR ([DateCreated] = @Original_DateCreated)) AND ((@IsNull_DateCalculated = 1 AND [DateCalculated] IS NULL) OR ([DateCalculated] = @Original_DateCalculated)) AND ((@IsNull_Priority = 1 AND [Priority] IS NULL) OR ([Priority] = @Original_Priority)) AND ((@IsNull_ProjectId = 1 AND [ProjectId] IS NULL) OR ([ProjectId] = @Original_ProjectId)) AND ((@IsNull_UserId = 1 AND [UserId] IS NULL) OR ([UserId] = @Original_UserId)) AND ((@IsNull_CoresNeeded = 1 AND [CoresNeeded] IS NULL) OR ([CoresNeeded] = @Original_CoresNeeded)) AND ((@IsNull_MemoryNeeded = 1 AND [MemoryNeeded] IS NULL) OR ([MemoryNeeded] = @Original_MemoryNeeded)))";
    74057435            this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
    74067436            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_JobId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
    74077437            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ParentJobId", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ParentJobId", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
    74087438            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ParentJobId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ParentJobId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
    7409             this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_JobState", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
    7410             this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_JobState", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
    74117439            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ResourceId", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
    74127440            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
     
    74307458            this._adapter.InsertCommand.Connection = this.Connection;
    74317459            this._adapter.InsertCommand.CommandText = @"INSERT INTO [dbo].[Job] ([JobId], [ParentJobId], [JobState], [ResourceId], [Percentage], [SerializedJob], [DateCreated], [DateCalculated], [Priority], [ProjectId], [UserId], [CoresNeeded], [MemoryNeeded]) VALUES (@JobId, @ParentJobId, @JobState, @ResourceId, @Percentage, @SerializedJob, @DateCreated, @DateCalculated, @Priority, @ProjectId, @UserId, @CoresNeeded, @MemoryNeeded);
    7432 SELECT JobId, ParentJobId, JobState, ResourceId, Percentage, SerializedJob, DateCreated, DateCalculated, Priority, ProjectId, UserId, CoresNeeded, MemoryNeeded FROM Job WHERE (JobId = @JobId) ORDER BY Priority";
     7460WITH ClientGroups(ClientGroupId) AS (SELECT ClientGroupId FROM ClientGroup_Resource WHERE (ResourceId = @ResourceId) UNION ALL SELECT g.ClientGroupId FROM ClientGroup_Resource AS g INNER JOIN ClientGroups AS gr ON gr.ClientGroupId = g.ResourceId) SELECT JobId, ParentJobId, JobState, ResourceId, Percentage, SerializedJob, DateCreated, DateCalculated, Priority, ProjectId, UserId, CoresNeeded, MemoryNeeded FROM Job WHERE (JobId = @JobId) ORDER BY Priority";
    74337461            this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
    74347462            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     
    74537481                "[CoresNeeded] = @CoresNeeded, [MemoryNeeded] = @MemoryNeeded WHERE (([JobId] = @" +
    74547482                "Original_JobId) AND ((@IsNull_ParentJobId = 1 AND [ParentJobId] IS NULL) OR ([Pa" +
    7455                 "rentJobId] = @Original_ParentJobId)) AND ((@IsNull_JobState = 1 AND [JobState] I" +
    7456                 "S NULL) OR ([JobState] = @Original_JobState)) AND ((@IsNull_ResourceId = 1 AND [" +
    7457                 "ResourceId] IS NULL) OR ([ResourceId] = @Original_ResourceId)) AND ((@IsNull_Per" +
    7458                 "centage = 1 AND [Percentage] IS NULL) OR ([Percentage] = @Original_Percentage)) " +
    7459                 "AND ((@IsNull_DateCreated = 1 AND [DateCreated] IS NULL) OR ([DateCreated] = @Or" +
    7460                 "iginal_DateCreated)) AND ((@IsNull_DateCalculated = 1 AND [DateCalculated] IS NU" +
    7461                 "LL) OR ([DateCalculated] = @Original_DateCalculated)) AND ((@IsNull_Priority = 1" +
    7462                 " AND [Priority] IS NULL) OR ([Priority] = @Original_Priority)) AND ((@IsNull_Pro" +
    7463                 "jectId = 1 AND [ProjectId] IS NULL) OR ([ProjectId] = @Original_ProjectId)) AND " +
    7464                 "((@IsNull_UserId = 1 AND [UserId] IS NULL) OR ([UserId] = @Original_UserId)) AND" +
    7465                 " ((@IsNull_CoresNeeded = 1 AND [CoresNeeded] IS NULL) OR ([CoresNeeded] = @Origi" +
    7466                 "nal_CoresNeeded)) AND ((@IsNull_MemoryNeeded = 1 AND [MemoryNeeded] IS NULL) OR " +
    7467                 "([MemoryNeeded] = @Original_MemoryNeeded)));\r\nSELECT JobId, ParentJobId, JobStat" +
    7468                 "e, ResourceId, Percentage, SerializedJob, DateCreated, DateCalculated, Priority," +
    7469                 " ProjectId, UserId, CoresNeeded, MemoryNeeded FROM Job WHERE (JobId = @JobId) OR" +
    7470                 "DER BY Priority";
     7483                "rentJobId] = @Original_ParentJobId)) AND ((@IsNull_ResourceId = 1 AND [ResourceI" +
     7484                "d] IS NULL) OR ([ResourceId] = @Original_ResourceId)) AND ((@IsNull_Percentage =" +
     7485                " 1 AND [Percentage] IS NULL) OR ([Percentage] = @Original_Percentage)) AND ((@Is" +
     7486                "Null_DateCreated = 1 AND [DateCreated] IS NULL) OR ([DateCreated] = @Original_Da" +
     7487                "teCreated)) AND ((@IsNull_DateCalculated = 1 AND [DateCalculated] IS NULL) OR ([" +
     7488                "DateCalculated] = @Original_DateCalculated)) AND ((@IsNull_Priority = 1 AND [Pri" +
     7489                "ority] IS NULL) OR ([Priority] = @Original_Priority)) AND ((@IsNull_ProjectId = " +
     7490                "1 AND [ProjectId] IS NULL) OR ([ProjectId] = @Original_ProjectId)) AND ((@IsNull" +
     7491                "_UserId = 1 AND [UserId] IS NULL) OR ([UserId] = @Original_UserId)) AND ((@IsNul" +
     7492                "l_CoresNeeded = 1 AND [CoresNeeded] IS NULL) OR ([CoresNeeded] = @Original_Cores" +
     7493                "Needed)) AND ((@IsNull_MemoryNeeded = 1 AND [MemoryNeeded] IS NULL) OR ([MemoryN" +
     7494                "eeded] = @Original_MemoryNeeded)));\r\nWITH ClientGroups(ClientGroupId) AS (SELECT" +
     7495                " ClientGroupId FROM ClientGroup_Resource WHERE (ResourceId = @ResourceId) UNION " +
     7496                "ALL SELECT g.ClientGroupId FROM ClientGroup_Resource AS g INNER JOIN ClientGroup" +
     7497                "s AS gr ON gr.ClientGroupId = g.ResourceId) SELECT JobId, ParentJobId, JobState," +
     7498                " ResourceId, Percentage, SerializedJob, DateCreated, DateCalculated, Priority, P" +
     7499                "rojectId, UserId, CoresNeeded, MemoryNeeded FROM Job WHERE (JobId = @JobId) ORDE" +
     7500                "R BY Priority";
    74717501            this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
    74727502            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     
    74867516            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ParentJobId", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ParentJobId", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
    74877517            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ParentJobId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ParentJobId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
    7488             this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_JobState", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
    7489             this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_JobState", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
    74907518            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ResourceId", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
    74917519            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
     
    75197547            this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
    75207548            this._commandCollection[0].Connection = this.Connection;
    7521             this._commandCollection[0].CommandText = "SELECT * FROM dbo.Job WHERE JobState = @State AND CoresNeeded <= @CoresNeeded AND" +
    7522                 " MemoryNeeded <= @MemoryNeeded ORDER BY Priority";
     7549            this._commandCollection[0].CommandText = @"WITH ClientGroups(ClientGroupId)
     7550AS
     7551(
     7552-- Anchor member definition
     7553    SELECT ClientGroupId
     7554    FROM ClientGroup_Resource
     7555    WHERE ResourceId = @ResourceId
     7556    UNION ALL
     7557-- Recursive member definition
     7558    SELECT g.ClientGroupId
     7559    FROM ClientGroup_Resource AS g
     7560    INNER JOIN  ClientGroups AS gr
     7561        ON gr.ClientGroupId = g.ResourceId
     7562)
     7563
     7564SELECT * FROM dbo.Job WHERE JobState =@State AND CoresNeeded <= @CoresNeeded
     7565 AND MemoryNeeded <= @MemoryNeeded AND
     7566(
     7567 -- no assigned resources - can be executed everywhere
     7568 NOT EXISTS (SELECT * FROM AssignedResources
     7569 WHERE JobId = Job.JobId)
     7570 
     7571 -- the resource itself is assigned to the job
     7572 OR  EXISTS ((SELECT * FROM AssignedResources
     7573  WHERE JobId = Job.JobId
     7574  AND ResourceId = @ResourceId))
     7575 
     7576  -- a group of the resource is assigned to the job
     7577 OR  EXISTS ((SELECT * FROM AssignedResources 
     7578  WHERE JobId = Job.JobId AND
     7579  ResourceId IN (SELECT * FROM ClientGroups))))
     7580ORDER BY Priority";
    75237581            this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
    7524             this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@State", global::System.Data.SqlDbType.VarChar, 18, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7582            this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@State", global::System.Data.SqlDbType.VarChar, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    75257583            this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CoresNeeded", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "CoresNeeded", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    75267584            this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MemoryNeeded", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "MemoryNeeded", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7585            this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    75277586            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
    75287587            this._commandCollection[1].Connection = this.Connection;
     
    75337592            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
    75347593            this._commandCollection[2].Connection = this.Connection;
    7535             this._commandCollection[2].CommandText = @"SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, ParentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId FROM Job WHERE ((JobState = 'calculating')  OR (JobState = 'abort') OR (JobState = 'requestSnapshot ') OR (JobState = 'requestSnapshotSent')) AND (ResourceId = @ResourceId)";
     7594            this._commandCollection[2].CommandText = @"SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, ParentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId FROM Job WHERE (JobState = 'calculating' OR JobState = 'abort' OR JobState = 'requestSnapshot ' OR JobState = 'requestSnapshotSent') AND (ResourceId = @ResourceId)";
    75367595            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
    75377596            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     
    75667625            this._commandCollection[7] = new global::System.Data.SqlClient.SqlCommand();
    75677626            this._commandCollection[7].Connection = this.Connection;
    7568             this._commandCollection[7].CommandText = "SELECT * FROM dbo.Job WHERE ProjectId = @ProjectId";
     7627            this._commandCollection[7].CommandText = "SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, P" +
     7628                "arentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId F" +
     7629                "ROM Job WHERE (ProjectId = @ProjectId)";
    75697630            this._commandCollection[7].CommandType = global::System.Data.CommandType.Text;
    75707631            this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     
    75887649        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    75897650        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
    7590         public virtual int FillByStateCoresMemory(dsHiveServer.JobDataTable dataTable, string State, global::System.Nullable<int> CoresNeeded, global::System.Nullable<int> MemoryNeeded) {
     7651        public virtual int FillByStateCoresMemoryResource(dsHiveServer.JobDataTable dataTable, string State, global::System.Nullable<int> CoresNeeded, global::System.Nullable<int> MemoryNeeded, System.Guid ResourceId) {
    75917652            this.Adapter.SelectCommand = this.CommandCollection[0];
    75927653            if ((State == null)) {
     
    76087669                this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
    76097670            }
     7671            this.Adapter.SelectCommand.Parameters[3].Value = ((System.Guid)(ResourceId));
    76107672            if ((this.ClearBeforeFill == true)) {
    76117673                dataTable.Clear();
     
    76187680        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    76197681        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
    7620         public virtual dsHiveServer.JobDataTable GetDataByStateCoresMemory(string State, global::System.Nullable<int> CoresNeeded, global::System.Nullable<int> MemoryNeeded) {
     7682        public virtual dsHiveServer.JobDataTable GetDataByStateCoresMemoryResource(string State, global::System.Nullable<int> CoresNeeded, global::System.Nullable<int> MemoryNeeded, System.Guid ResourceId) {
    76217683            this.Adapter.SelectCommand = this.CommandCollection[0];
    76227684            if ((State == null)) {
     
    76387700                this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
    76397701            }
     7702            this.Adapter.SelectCommand.Parameters[3].Value = ((System.Guid)(ResourceId));
    76407703            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
    76417704            this.Adapter.Fill(dataTable);
     
    79458008        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    79468009        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
    7947         public virtual int Delete(System.Guid Original_JobId, global::System.Nullable<global::System.Guid> Original_ParentJobId, string Original_JobState, global::System.Nullable<global::System.Guid> Original_ResourceId, global::System.Nullable<double> Original_Percentage, global::System.Nullable<global::System.DateTime> Original_DateCreated, global::System.Nullable<global::System.DateTime> Original_DateCalculated, global::System.Nullable<int> Original_Priority, global::System.Nullable<global::System.Guid> Original_ProjectId, global::System.Nullable<global::System.Guid> Original_UserId, global::System.Nullable<int> Original_CoresNeeded, global::System.Nullable<int> Original_MemoryNeeded) {
     8010        public virtual int Delete(System.Guid Original_JobId, global::System.Nullable<global::System.Guid> Original_ParentJobId, global::System.Nullable<global::System.Guid> Original_ResourceId, global::System.Nullable<double> Original_Percentage, global::System.Nullable<global::System.DateTime> Original_DateCreated, global::System.Nullable<global::System.DateTime> Original_DateCalculated, global::System.Nullable<int> Original_Priority, global::System.Nullable<global::System.Guid> Original_ProjectId, global::System.Nullable<global::System.Guid> Original_UserId, global::System.Nullable<int> Original_CoresNeeded, global::System.Nullable<int> Original_MemoryNeeded) {
    79488011            this.Adapter.DeleteCommand.Parameters[0].Value = ((System.Guid)(Original_JobId));
    79498012            if ((Original_ParentJobId.HasValue == true)) {
     
    79558018                this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
    79568019            }
    7957             if ((Original_JobState == null)) {
     8020            if ((Original_ResourceId.HasValue == true)) {
     8021                this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
     8022                this.Adapter.DeleteCommand.Parameters[4].Value = ((System.Guid)(Original_ResourceId.Value));
     8023            }
     8024            else {
    79588025                this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
    79598026                this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value;
    79608027            }
    7961             else {
    7962                 this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
    7963                 this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_JobState));
    7964             }
    7965             if ((Original_ResourceId.HasValue == true)) {
     8028            if ((Original_Percentage.HasValue == true)) {
    79668029                this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
    7967                 this.Adapter.DeleteCommand.Parameters[6].Value = ((System.Guid)(Original_ResourceId.Value));
     8030                this.Adapter.DeleteCommand.Parameters[6].Value = ((double)(Original_Percentage.Value));
    79688031            }
    79698032            else {
     
    79718034                this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value;
    79728035            }
    7973             if ((Original_Percentage.HasValue == true)) {
     8036            if ((Original_DateCreated.HasValue == true)) {
    79748037                this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(0));
    7975                 this.Adapter.DeleteCommand.Parameters[8].Value = ((double)(Original_Percentage.Value));
     8038                this.Adapter.DeleteCommand.Parameters[8].Value = ((System.DateTime)(Original_DateCreated.Value));
    79768039            }
    79778040            else {
     
    79798042                this.Adapter.DeleteCommand.Parameters[8].Value = global::System.DBNull.Value;
    79808043            }
    7981             if ((Original_DateCreated.HasValue == true)) {
     8044            if ((Original_DateCalculated.HasValue == true)) {
    79828045                this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(0));
    7983                 this.Adapter.DeleteCommand.Parameters[10].Value = ((System.DateTime)(Original_DateCreated.Value));
     8046                this.Adapter.DeleteCommand.Parameters[10].Value = ((System.DateTime)(Original_DateCalculated.Value));
    79848047            }
    79858048            else {
     
    79878050                this.Adapter.DeleteCommand.Parameters[10].Value = global::System.DBNull.Value;
    79888051            }
    7989             if ((Original_DateCalculated.HasValue == true)) {
     8052            if ((Original_Priority.HasValue == true)) {
    79908053                this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(0));
    7991                 this.Adapter.DeleteCommand.Parameters[12].Value = ((System.DateTime)(Original_DateCalculated.Value));
     8054                this.Adapter.DeleteCommand.Parameters[12].Value = ((int)(Original_Priority.Value));
    79928055            }
    79938056            else {
     
    79958058                this.Adapter.DeleteCommand.Parameters[12].Value = global::System.DBNull.Value;
    79968059            }
    7997             if ((Original_Priority.HasValue == true)) {
     8060            if ((Original_ProjectId.HasValue == true)) {
    79988061                this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(0));
    7999                 this.Adapter.DeleteCommand.Parameters[14].Value = ((int)(Original_Priority.Value));
     8062                this.Adapter.DeleteCommand.Parameters[14].Value = ((System.Guid)(Original_ProjectId.Value));
    80008063            }
    80018064            else {
     
    80038066                this.Adapter.DeleteCommand.Parameters[14].Value = global::System.DBNull.Value;
    80048067            }
    8005             if ((Original_ProjectId.HasValue == true)) {
     8068            if ((Original_UserId.HasValue == true)) {
    80068069                this.Adapter.DeleteCommand.Parameters[15].Value = ((object)(0));
    8007                 this.Adapter.DeleteCommand.Parameters[16].Value = ((System.Guid)(Original_ProjectId.Value));
     8070                this.Adapter.DeleteCommand.Parameters[16].Value = ((System.Guid)(Original_UserId.Value));
    80088071            }
    80098072            else {
     
    80118074                this.Adapter.DeleteCommand.Parameters[16].Value = global::System.DBNull.Value;
    80128075            }
    8013             if ((Original_UserId.HasValue == true)) {
     8076            if ((Original_CoresNeeded.HasValue == true)) {
    80148077                this.Adapter.DeleteCommand.Parameters[17].Value = ((object)(0));
    8015                 this.Adapter.DeleteCommand.Parameters[18].Value = ((System.Guid)(Original_UserId.Value));
     8078                this.Adapter.DeleteCommand.Parameters[18].Value = ((int)(Original_CoresNeeded.Value));
    80168079            }
    80178080            else {
     
    80198082                this.Adapter.DeleteCommand.Parameters[18].Value = global::System.DBNull.Value;
    80208083            }
    8021             if ((Original_CoresNeeded.HasValue == true)) {
     8084            if ((Original_MemoryNeeded.HasValue == true)) {
    80228085                this.Adapter.DeleteCommand.Parameters[19].Value = ((object)(0));
    8023                 this.Adapter.DeleteCommand.Parameters[20].Value = ((int)(Original_CoresNeeded.Value));
     8086                this.Adapter.DeleteCommand.Parameters[20].Value = ((int)(Original_MemoryNeeded.Value));
    80248087            }
    80258088            else {
    80268089                this.Adapter.DeleteCommand.Parameters[19].Value = ((object)(1));
    80278090                this.Adapter.DeleteCommand.Parameters[20].Value = global::System.DBNull.Value;
    8028             }
    8029             if ((Original_MemoryNeeded.HasValue == true)) {
    8030                 this.Adapter.DeleteCommand.Parameters[21].Value = ((object)(0));
    8031                 this.Adapter.DeleteCommand.Parameters[22].Value = ((int)(Original_MemoryNeeded.Value));
    8032             }
    8033             else {
    8034                 this.Adapter.DeleteCommand.Parameters[21].Value = ((object)(1));
    8035                 this.Adapter.DeleteCommand.Parameters[22].Value = global::System.DBNull.Value;
    80368091            }
    80378092            global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
     
    81638218                    System.Guid Original_JobId,
    81648219                    global::System.Nullable<global::System.Guid> Original_ParentJobId,
    8165                     string Original_JobState,
    81668220                    global::System.Nullable<global::System.Guid> Original_ResourceId,
    81678221                    global::System.Nullable<double> Original_Percentage,
     
    82558309                this.Adapter.UpdateCommand.Parameters[15].Value = global::System.DBNull.Value;
    82568310            }
    8257             if ((Original_JobState == null)) {
     8311            if ((Original_ResourceId.HasValue == true)) {
     8312                this.Adapter.UpdateCommand.Parameters[16].Value = ((object)(0));
     8313                this.Adapter.UpdateCommand.Parameters[17].Value = ((System.Guid)(Original_ResourceId.Value));
     8314            }
     8315            else {
    82588316                this.Adapter.UpdateCommand.Parameters[16].Value = ((object)(1));
    82598317                this.Adapter.UpdateCommand.Parameters[17].Value = global::System.DBNull.Value;
    82608318            }
    8261             else {
    8262                 this.Adapter.UpdateCommand.Parameters[16].Value = ((object)(0));
    8263                 this.Adapter.UpdateCommand.Parameters[17].Value = ((string)(Original_JobState));
    8264             }
    8265             if ((Original_ResourceId.HasValue == true)) {
     8319            if ((Original_Percentage.HasValue == true)) {
    82668320                this.Adapter.UpdateCommand.Parameters[18].Value = ((object)(0));
    8267                 this.Adapter.UpdateCommand.Parameters[19].Value = ((System.Guid)(Original_ResourceId.Value));
     8321                this.Adapter.UpdateCommand.Parameters[19].Value = ((double)(Original_Percentage.Value));
    82688322            }
    82698323            else {
     
    82718325                this.Adapter.UpdateCommand.Parameters[19].Value = global::System.DBNull.Value;
    82728326            }
    8273             if ((Original_Percentage.HasValue == true)) {
     8327            if ((Original_DateCreated.HasValue == true)) {
    82748328                this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(0));
    8275                 this.Adapter.UpdateCommand.Parameters[21].Value = ((double)(Original_Percentage.Value));
     8329                this.Adapter.UpdateCommand.Parameters[21].Value = ((System.DateTime)(Original_DateCreated.Value));
    82768330            }
    82778331            else {
     
    82798333                this.Adapter.UpdateCommand.Parameters[21].Value = global::System.DBNull.Value;
    82808334            }
    8281             if ((Original_DateCreated.HasValue == true)) {
     8335            if ((Original_DateCalculated.HasValue == true)) {
    82828336                this.Adapter.UpdateCommand.Parameters[22].Value = ((object)(0));
    8283                 this.Adapter.UpdateCommand.Parameters[23].Value = ((System.DateTime)(Original_DateCreated.Value));
     8337                this.Adapter.UpdateCommand.Parameters[23].Value = ((System.DateTime)(Original_DateCalculated.Value));
    82848338            }
    82858339            else {
     
    82878341                this.Adapter.UpdateCommand.Parameters[23].Value = global::System.DBNull.Value;
    82888342            }
    8289             if ((Original_DateCalculated.HasValue == true)) {
     8343            if ((Original_Priority.HasValue == true)) {
    82908344                this.Adapter.UpdateCommand.Parameters[24].Value = ((object)(0));
    8291                 this.Adapter.UpdateCommand.Parameters[25].Value = ((System.DateTime)(Original_DateCalculated.Value));
     8345                this.Adapter.UpdateCommand.Parameters[25].Value = ((int)(Original_Priority.Value));
    82928346            }
    82938347            else {
     
    82958349                this.Adapter.UpdateCommand.Parameters[25].Value = global::System.DBNull.Value;
    82968350            }
    8297             if ((Original_Priority.HasValue == true)) {
     8351            if ((Original_ProjectId.HasValue == true)) {
    82988352                this.Adapter.UpdateCommand.Parameters[26].Value = ((object)(0));
    8299                 this.Adapter.UpdateCommand.Parameters[27].Value = ((int)(Original_Priority.Value));
     8353                this.Adapter.UpdateCommand.Parameters[27].Value = ((System.Guid)(Original_ProjectId.Value));
    83008354            }
    83018355            else {
     
    83038357                this.Adapter.UpdateCommand.Parameters[27].Value = global::System.DBNull.Value;
    83048358            }
    8305             if ((Original_ProjectId.HasValue == true)) {
     8359            if ((Original_UserId.HasValue == true)) {
    83068360                this.Adapter.UpdateCommand.Parameters[28].Value = ((object)(0));
    8307                 this.Adapter.UpdateCommand.Parameters[29].Value = ((System.Guid)(Original_ProjectId.Value));
     8361                this.Adapter.UpdateCommand.Parameters[29].Value = ((System.Guid)(Original_UserId.Value));
    83088362            }
    83098363            else {
     
    83118365                this.Adapter.UpdateCommand.Parameters[29].Value = global::System.DBNull.Value;
    83128366            }
    8313             if ((Original_UserId.HasValue == true)) {
     8367            if ((Original_CoresNeeded.HasValue == true)) {
    83148368                this.Adapter.UpdateCommand.Parameters[30].Value = ((object)(0));
    8315                 this.Adapter.UpdateCommand.Parameters[31].Value = ((System.Guid)(Original_UserId.Value));
     8369                this.Adapter.UpdateCommand.Parameters[31].Value = ((int)(Original_CoresNeeded.Value));
    83168370            }
    83178371            else {
     
    83198373                this.Adapter.UpdateCommand.Parameters[31].Value = global::System.DBNull.Value;
    83208374            }
    8321             if ((Original_CoresNeeded.HasValue == true)) {
     8375            if ((Original_MemoryNeeded.HasValue == true)) {
    83228376                this.Adapter.UpdateCommand.Parameters[32].Value = ((object)(0));
    8323                 this.Adapter.UpdateCommand.Parameters[33].Value = ((int)(Original_CoresNeeded.Value));
     8377                this.Adapter.UpdateCommand.Parameters[33].Value = ((int)(Original_MemoryNeeded.Value));
    83248378            }
    83258379            else {
    83268380                this.Adapter.UpdateCommand.Parameters[32].Value = ((object)(1));
    83278381                this.Adapter.UpdateCommand.Parameters[33].Value = global::System.DBNull.Value;
    8328             }
    8329             if ((Original_MemoryNeeded.HasValue == true)) {
    8330                 this.Adapter.UpdateCommand.Parameters[34].Value = ((object)(0));
    8331                 this.Adapter.UpdateCommand.Parameters[35].Value = ((int)(Original_MemoryNeeded.Value));
    8332             }
    8333             else {
    8334                 this.Adapter.UpdateCommand.Parameters[34].Value = ((object)(1));
    8335                 this.Adapter.UpdateCommand.Parameters[35].Value = global::System.DBNull.Value;
    83368382            }
    83378383            global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
     
    83698415                    System.Guid Original_JobId,
    83708416                    global::System.Nullable<global::System.Guid> Original_ParentJobId,
    8371                     string Original_JobState,
    83728417                    global::System.Nullable<global::System.Guid> Original_ResourceId,
    83738418                    global::System.Nullable<double> Original_Percentage,
     
    83798424                    global::System.Nullable<int> Original_CoresNeeded,
    83808425                    global::System.Nullable<int> Original_MemoryNeeded) {
    8381             return this.Update(Original_JobId, ParentJobId, JobState, ResourceId, Percentage, SerializedJob, DateCreated, DateCalculated, Priority, ProjectId, UserId, CoresNeeded, MemoryNeeded, Original_JobId, Original_ParentJobId, Original_JobState, Original_ResourceId, Original_Percentage, Original_DateCreated, Original_DateCalculated, Original_Priority, Original_ProjectId, Original_UserId, Original_CoresNeeded, Original_MemoryNeeded);
     8426            return this.Update(Original_JobId, ParentJobId, JobState, ResourceId, Percentage, SerializedJob, DateCreated, DateCalculated, Priority, ProjectId, UserId, CoresNeeded, MemoryNeeded, Original_JobId, Original_ParentJobId, Original_ResourceId, Original_Percentage, Original_DateCreated, Original_DateCalculated, Original_Priority, Original_ProjectId, Original_UserId, Original_CoresNeeded, Original_MemoryNeeded);
    83828427        }
    83838428    }
     
    1105311098                if (((updatedRows != null)
    1105411099                            && (0 < updatedRows.Length))) {
     11100                    this.SortSelfReferenceRows(updatedRows, dataSet.Relations["R_44"], false);
    1105511101                    result = (result + this._jobTableAdapter.Update(updatedRows));
    1105611102                    allChangedRows.AddRange(updatedRows);
     
    1115411200                if (((addedRows != null)
    1115511201                            && (0 < addedRows.Length))) {
     11202                    this.SortSelfReferenceRows(addedRows, dataSet.Relations["R_44"], false);
    1115611203                    result = (result + this._jobTableAdapter.Update(addedRows));
    1115711204                    allAddedRows.AddRange(addedRows);
     
    1123511282                if (((deletedRows != null)
    1123611283                            && (0 < deletedRows.Length))) {
     11284                    this.SortSelfReferenceRows(deletedRows, dataSet.Relations["R_44"], true);
    1123711285                    result = (result + this._jobTableAdapter.Update(deletedRows));
    1123811286                    allChangedRows.AddRange(deletedRows);
Note: See TracChangeset for help on using the changeset viewer.