Changeset 9538
- Timestamp:
- 05/27/13 10:28:48 (11 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
r9524 r9538 259 259 <Column Name="Hour" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" /> 260 260 <Column Name="Day" Type="System.DateTime" DbType="Date NOT NULL" CanBeNull="false" /> 261 <Column Name="Week" Type="System.DateTime" DbType="Date NOT NULL" CanBeNull="false" />262 261 <Column Name="Month" Type="System.DateTime" DbType="Date NOT NULL" CanBeNull="false" /> 263 262 <Column Name="Year" Type="System.DateTime" DbType="Date NOT NULL" CanBeNull="false" /> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
r9524 r9538 121 121 </nestedChildShapes> 122 122 </classShape> 123 <associationConnector edgePoints="[(11.25 : 1.87677124023437); (10.9375 : 1.87677124023437); (10.9375 : 0.6875); (2.75 : 0.6875); (2.75 : 1)]" fixedFrom=" Algorithm" fixedTo="Algorithm">123 <associationConnector edgePoints="[(11.25 : 1.87677124023437); (10.9375 : 1.87677124023437); (10.9375 : 0.6875); (2.75 : 0.6875); (2.75 : 1)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 124 124 <AssociationMoniker Name="/HiveDataContext/Resource/Resource_StateLog" /> 125 125 <nodes> … … 265 265 </nestedChildShapes> 266 266 </classShape> 267 <classShape Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" absoluteBounds="3.625, 8.5, 2, 1. 7535424804687487">267 <classShape Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" absoluteBounds="3.625, 8.5, 2, 1.5891951497395844"> 268 268 <DataClassMoniker Name="/HiveDataContext/DimTime" /> 269 269 <nestedChildShapes> 270 <elementListCompartment Id="694c4a5a-20fb-43a9-bc9a-7b59d794a7fb" absoluteBounds="3.6399999999999997, 8.96, 1.9700000000000002, 1. 19354248046875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />270 <elementListCompartment Id="694c4a5a-20fb-43a9-bc9a-7b59d794a7fb" absoluteBounds="3.6399999999999997, 8.96, 1.9700000000000002, 1.0291951497395833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 271 271 </nestedChildShapes> 272 272 </classShape> … … 283 283 </nestedChildShapes> 284 284 </classShape> 285 <associationConnector edgePoints="[(6.625 : 16.1191239261004); (7.875 : 16.1191239261004); (7.875 : 14.4826684570313)]" fixedFrom=" Caller" fixedTo="Algorithm">285 <associationConnector edgePoints="[(6.625 : 16.1191239261004); (7.875 : 16.1191239261004); (7.875 : 14.4826684570313)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 286 286 <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactTask" /> 287 287 <nodes> … … 290 290 </nodes> 291 291 </associationConnector> 292 <associationConnector edgePoints="[(8.5 : 10.5498478190104); (8.5 : 11.25)]" fixedFrom=" Algorithm" fixedTo="Algorithm">292 <associationConnector edgePoints="[(8.5 : 10.5498478190104); (8.5 : 11.25)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 293 293 <AssociationMoniker Name="/HiveDataContext/DimJob/DimJob_FactTask" /> 294 294 <nodes> … … 297 297 </nodes> 298 298 </associationConnector> 299 <associationConnector edgePoints="[(5. 625 : 9.57218767438616); (7.15624775 : 9.57218767438616); (7.15624775 : 11.25)]" fixedFrom="Caller" fixedTo="Algorithm">299 <associationConnector edgePoints="[(5.15625 : 10.0891951497396); (5.15625 : 14.3889184570313); (6.875 : 14.3889184570313)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 300 300 <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactTask" /> 301 301 <nodes> … … 304 304 </nodes> 305 305 </associationConnector> 306 <associationConnector edgePoints="[(5. 625 : 9.28136218952683); (7.4999995 : 9.28136218952683); (7.4999995 : 11.25)]" fixedFrom="Caller" fixedTo="Algorithm">306 <associationConnector edgePoints="[(5.4218775 : 10.0891951497396); (5.4218775 : 13.3576659570313); (6.71675495975 : 13.3576659570313); (6.71675495975 : 13.359301744963); (6.875 : 13.359301744963)]" manuallyRouted="true" fixedFrom="Algorithm" fixedTo="Caller"> 307 307 <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactTask1" /> 308 308 <nodes> … … 311 311 </nodes> 312 312 </associationConnector> 313 <associationConnector edgePoints="[(4.625 : 16.2383361179518); (3.59375 : 16.2383361179518); (3.59375 : 14.2326684570313)]" fixedFrom=" Caller" fixedTo="Algorithm">313 <associationConnector edgePoints="[(4.625 : 16.2383361179518); (3.59375 : 16.2383361179518); (3.59375 : 14.2326684570313)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 314 314 <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactClientInfo" /> 315 315 <nodes> … … 318 318 </nodes> 319 319 </associationConnector> 320 <associationConnector edgePoints="[(4.125 : 10. 2535424804687); (4.125 : 11)]" fixedFrom="Algorithm" fixedTo="Algorithm">320 <associationConnector edgePoints="[(4.125 : 10.0891951497396); (4.125 : 11)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 321 321 <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactClientInfo" /> 322 322 <nodes> … … 325 325 </nodes> 326 326 </associationConnector> 327 <associationConnector edgePoints="[(1.59375 : 9.97115315755208); (1.59375 : 12.6163342285156); (2.625 : 12.6163342285156)]" fixedFrom=" Algorithm" fixedTo="Algorithm">327 <associationConnector edgePoints="[(1.59375 : 9.97115315755208); (1.59375 : 12.6163342285156); (2.625 : 12.6163342285156)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 328 328 <AssociationMoniker Name="/HiveDataContext/DimUser/DimUser_FactClientInfo" /> 329 329 <nodes> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
r9524 r9538 5575 5575 private System.DateTime _Day; 5576 5576 5577 private System.DateTime _Week;5578 5579 5577 private System.DateTime _Month; 5580 5578 … … 5597 5595 partial void OnDayChanging(System.DateTime value); 5598 5596 partial void OnDayChanged(); 5599 partial void OnWeekChanging(System.DateTime value);5600 partial void OnWeekChanged();5601 5597 partial void OnMonthChanging(System.DateTime value); 5602 5598 partial void OnMonthChanged(); … … 5669 5665 this.SendPropertyChanged("Day"); 5670 5666 this.OnDayChanged(); 5671 }5672 }5673 }5674 5675 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Week", DbType="Date NOT NULL")]5676 public System.DateTime Week5677 {5678 get5679 {5680 return this._Week;5681 }5682 set5683 {5684 if ((this._Week != value))5685 {5686 this.OnWeekChanging(value);5687 this.SendPropertyChanging();5688 this._Week = value;5689 this.SendPropertyChanged("Week");5690 this.OnWeekChanged();5691 5667 } 5692 5668 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql
r9524 r9538 205 205 [Hour] DATETIME NOT NULL, 206 206 [Day] DATE NOT NULL, 207 [Week] DATE NOT NULL,208 207 [Month] DATE NOT NULL, 209 208 [Year] DATE NOT NULL, -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs
r9533 r9538 27 27 UpdateJobs(db); 28 28 UpdateUsers(db); 29 // UpdateClients29 UpdateClients(db); 30 30 31 31 return newTime; … … 46 46 Hour = new DateTime(now.Year, now.Month, now.Day, now.Hour, 0, 0), 47 47 Day = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0), 48 Week = new DateTime(now.Year, now.Month, now.Day - (int)now.DayOfWeek, 0, 0, 0), // Week begins with Sunday49 48 Month = new DateTime(now.Year, now.Month, 1, 0, 0, 0), 50 49 Year = new DateTime(now.Year, 1, 1, 0, 0, 0) … … 90 89 } 91 90 91 private void UpdateClients(HiveDataContext db) { 92 var removedClients = 93 from c in db.DimClients 94 where c.ExpirationTime == null && 95 !db.Resources.OfType<Slave>().Select(x => x.ResourceId).Contains(c.ResourceId) 96 select c; 97 98 var modifiedClients = 99 from s in db.Resources.OfType<Slave>() 100 join c in db.DimClients on s.ResourceId equals c.ResourceId 101 where c.ExpirationTime == null 102 && (s.Name != c.Name || s.ParentResourceId != c.ResourceGroupId || 103 s.ParentResource.ParentResourceId != c.ResourceGroup2Id) 104 select new { Slave = s, Client = c }; 105 106 foreach (var client in removedClients.Union(modifiedClients.Select(x => x.Client))) { 107 client.ExpirationTime = DateTime.Now; 108 } 109 110 var newClients = 111 from s in db.Resources.OfType<Slave>() 112 where !db.DimClients.Select(x => x.ResourceId).Contains(s.ResourceId) 113 || modifiedClients.Select(x => x.Slave.ResourceId).Contains(s.ResourceId) 114 select new { 115 Slave = s, 116 Group = s.ParentResourceId, 117 Group2 = s.ParentResource.ParentResourceId 118 }; 119 120 var newDimClients = 121 from s in newClients.ToList() 122 select new DimClient { 123 ResourceId = s.Slave.ResourceId, 124 Name = s.Slave.Name, 125 ExpirationTime = null, 126 ResourceGroupId = s.Group, 127 ResourceGroup2Id = s.Group2 128 }; 129 130 db.DimClients.InsertAllOnSubmit(newDimClients); 131 } 132 92 133 private void UpdateDataTables(DimTime newTime, HiveDataContext db) { 93 134
Note: See TracChangeset
for help on using the changeset viewer.