Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9546 for branches


Ignore:
Timestamp:
05/28/13 10:30:43 (12 years ago)
Author:
pfleck
Message:

#2063:
As suggested by gkronber, added user to primary key again in ClientFact table and added a 'NULL'-user in the DimUser table instead.

Location:
branches/HiveStatistics/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml

    r9541 r9546  
    277277      <Column Name="ClientId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    278278      <Column Name="Time" Type="System.DateTime" DbType="DateTime NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    279       <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NULL" CanBeNull="true" />
     279      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NULL" IsPrimaryKey="true" CanBeNull="false" />
    280280      <Column Name="NumUsedCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
    281281      <Column Name="NumTotalCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs

    r9541 r9546  
    59295929    private System.DateTime _Time;
    59305930   
    5931     private System.Nullable<System.Guid> _UserId;
     5931    private System.Guid _UserId;
    59325932   
    59335933    private int _NumUsedCores;
     
    59695969    partial void OnTimeChanging(System.DateTime value);
    59705970    partial void OnTimeChanged();
    5971     partial void OnUserIdChanging(System.Nullable<System.Guid> value);
     5971    partial void OnUserIdChanging(System.Guid value);
    59725972    partial void OnUserIdChanged();
    59735973    partial void OnNumUsedCoresChanging(int value);
     
    60536053    }
    60546054   
    6055     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NULL")]
    6056     public System.Nullable<System.Guid> UserId
     6055    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NULL", IsPrimaryKey=true)]
     6056    public System.Guid UserId
    60576057    {
    60586058      get
     
    64126412          else
    64136413          {
    6414             this._UserId = default(Nullable<System.Guid>);
     6414            this._UserId = default(System.Guid);
    64156415          }
    64166416          this.SendPropertyChanged("DimUser");
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql

    r9541 r9546  
    233233    [ClientId]              UNIQUEIDENTIFIER NOT NULL,
    234234    [Time]                  DATETIME         NOT NULL,
    235     [UserId]                UNIQUEIDENTIFIER NULL,
     235    [UserId]                UNIQUEIDENTIFIER NOT NULL,
    236236    [NumUsedCores]          INT              NOT NULL,
    237237    [NumTotalCores]         INT              NOT NULL,
     
    246246    [TotalTimeOffline]      FLOAT (53)       NOT NULL,
    247247    [TotalTimeUnavailable]  FLOAT (53)       NOT NULL,
    248     CONSTRAINT [PK_FactClientInfo] PRIMARY KEY CLUSTERED ([ClientId] ASC, [Time] ASC),
     248    CONSTRAINT [PK_FactClientInfo] PRIMARY KEY CLUSTERED ([ClientId] ASC, [Time] ASC, [UserId] ASC),
    249249    CONSTRAINT [FK_FactClientInfo_DimTime] FOREIGN KEY ([Time]) REFERENCES [statistics].[DimTime] ([Time]),
    250250    CONSTRAINT [FK_FactClientInfo_DimClient] FOREIGN KEY ([ClientId]) REFERENCES [statistics].[DimClient] ([Id]),
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs

    r9545 r9546  
    9292
    9393      db.DimUsers.InsertAllOnSubmit(newDimUsers);
     94
     95      // insert NULL-User
     96      if (!db.DimUsers.Any(x => x.UserId == Guid.Empty)) {
     97        db.DimUsers.InsertOnSubmit(new DimUser { UserId = Guid.Empty, Name = "NULL" });
     98      }
    9499    }
    95100
     
    168173          DimClient = s.Client,
    169174          DimTime = newTime,
    170           UserId = s.Slave.OwnerUserId,
     175          UserId = s.Slave.OwnerUserId ?? Guid.Empty,
    171176          NumUsedCores =
    172177            s.Slave.Cores != null && s.Slave.FreeCores != null
Note: See TracChangeset for help on using the changeset viewer.