Changeset 4111
- Timestamp:
- 07/27/10 14:20:42 (14 years ago)
- Location:
- branches/3.3-HiveMigration/sources/HeuristicLab.Hive
- Files:
-
- 10 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Calendar/3.3/Properties/AssemblyInfo.cs
r4107 r4111 57 57 // by using the '*' as shown below: 58 58 // [assembly: AssemblyVersion("1.0.*")] 59 [assembly: AssemblyVersion("3.3.0.410 5")]60 [assembly: AssemblyFileVersion("3.3.0.410 5")]61 [assembly: AssemblyBuildDate("2010/07/2 6 18:06:56")]59 [assembly: AssemblyVersion("3.3.0.4107")] 60 [assembly: AssemblyFileVersion("3.3.0.4107")] 61 [assembly: AssemblyBuildDate("2010/07/27 12:52:47")] -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive 3.3.sln
r4107 r4111 8 8 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Hive-3.3", "HeuristicLab.Hive\3.3\HeuristicLab.Hive-3.3.csproj", "{C92AAC8C-4D88-449C-ABA5-2B935D769842}" 9 9 ProjectSection(ProjectDependencies) = postProject 10 {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE} = {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE} 10 11 {55B89815-F3E7-4D09-9442-273F849141DD} = {55B89815-F3E7-4D09-9442-273F849141DD} 11 12 {4D5A2A16-66C2-431D-9AA3-BD3041E64B84} = {4D5A2A16-66C2-431D-9AA3-BD3041E64B84} 12 13 {21187322-52DD-4243-80A4-A85F0263E63B} = {21187322-52DD-4243-80A4-A85F0263E63B} 14 {A84C0A25-13D0-40A6-924F-53556D9691DC} = {A84C0A25-13D0-40A6-924F-53556D9691DC} 13 15 {A04AE929-D0E1-466D-A9D3-BF3C4B2C209F} = {A04AE929-D0E1-466D-A9D3-BF3C4B2C209F} 14 16 {D59E852C-F205-4647-8C05-EB9ED1CF44E9} = {D59E852C-F205-4647-8C05-EB9ED1CF44E9} 15 17 {CE2DFB48-6A9C-4507-96C6-5FC40E92035C} = {CE2DFB48-6A9C-4507-96C6-5FC40E92035C} 18 {89F4BC52-C174-481E-9BD2-3814171020E8} = {89F4BC52-C174-481E-9BD2-3814171020E8} 16 19 {5CDACE54-5FB2-4344-A21C-963F63CB7C2B} = {5CDACE54-5FB2-4344-A21C-963F63CB7C2B} 20 {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E} = {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E} 21 {1605256A-1CB3-44AB-AAFF-577093EE5789} = {1605256A-1CB3-44AB-AAFF-577093EE5789} 17 22 {D17A4D6A-4CAA-4470-8A19-F42463C021FD} = {D17A4D6A-4CAA-4470-8A19-F42463C021FD} 18 23 {42A1D075-6C12-4DD9-B0C2-C6F5210A8119} = {42A1D075-6C12-4DD9-B0C2-C6F5210A8119} 19 24 {679E977A-117B-456E-8594-2A4DEADB658B} = {679E977A-117B-456E-8594-2A4DEADB658B} 20 25 {9076697B-C151-46CD-95BC-1D059492B478} = {9076697B-C151-46CD-95BC-1D059492B478} 26 {5010BD86-23B7-4F8C-888A-76D21AD5266A} = {5010BD86-23B7-4F8C-888A-76D21AD5266A} 27 {4F15BEA2-F494-4584-A0E5-6BA85377B313} = {4F15BEA2-F494-4584-A0E5-6BA85377B313} 21 28 {48D4AEB1-2247-4B58-8B63-20B81BF8D4B1} = {48D4AEB1-2247-4B58-8B63-20B81BF8D4B1} 22 29 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11} = {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11} … … 95 102 EndProject 96 103 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Security.ADODataAccess-3.3", "HeuristicLab.Security.ADODataAccess\3.3\HeuristicLab.Security.ADODataAccess-3.3.csproj", "{FD1AFEC2-7A79-45CF-9365-5195B04A2C9F}" 104 EndProject 105 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Hive.Experiment-3.3", "HeuristicLab.Hive.Experiment\3.3\HeuristicLab.Hive.Experiment-3.3.csproj", "{A84C0A25-13D0-40A6-924F-53556D9691DC}" 106 EndProject 107 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Hive.Experiment.Views-3.3", "HeuristicLab.Hive.Experiment.Views\3.3\HeuristicLab.Hive.Experiment.Views-3.3.csproj", "{4F15BEA2-F494-4584-A0E5-6BA85377B313}" 97 108 EndProject 98 109 Global … … 483 494 {FD1AFEC2-7A79-45CF-9365-5195B04A2C9F}.Release|x86.ActiveCfg = Release|x86 484 495 {FD1AFEC2-7A79-45CF-9365-5195B04A2C9F}.Release|x86.Build.0 = Release|x86 496 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 497 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Debug|Any CPU.Build.0 = Debug|Any CPU 498 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 499 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Debug|Mixed Platforms.Build.0 = Debug|x86 500 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Debug|x64.ActiveCfg = Debug|x86 501 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Debug|x86.ActiveCfg = Debug|x86 502 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Debug|x86.Build.0 = Debug|x86 503 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Release|Any CPU.ActiveCfg = Release|x86 504 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Release|Mixed Platforms.ActiveCfg = Release|x86 505 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Release|Mixed Platforms.Build.0 = Release|x86 506 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Release|x64.ActiveCfg = Release|x86 507 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Release|x86.ActiveCfg = Release|x86 508 {A84C0A25-13D0-40A6-924F-53556D9691DC}.Release|x86.Build.0 = Release|x86 509 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 510 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Debug|Any CPU.Build.0 = Debug|Any CPU 511 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 512 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Debug|Mixed Platforms.Build.0 = Debug|x86 513 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Debug|x64.ActiveCfg = Debug|x86 514 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Debug|x86.ActiveCfg = Debug|x86 515 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Debug|x86.Build.0 = Debug|x86 516 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Release|Any CPU.ActiveCfg = Release|x86 517 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Release|Mixed Platforms.ActiveCfg = Release|x86 518 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Release|Mixed Platforms.Build.0 = Release|x86 519 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Release|x64.ActiveCfg = Release|x86 520 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Release|x86.ActiveCfg = Release|x86 521 {4F15BEA2-F494-4584-A0E5-6BA85377B313}.Release|x86.Build.0 = Release|x86 485 522 EndGlobalSection 486 523 GlobalSection(SolutionProperties) = preSolution … … 503 540 {21187322-52DD-4243-80A4-A85F0263E63B} = {84899895-AC52-4053-8A91-61753EF8E0A8} 504 541 {C92AAC8C-4D88-449C-ABA5-2B935D769842} = {84899895-AC52-4053-8A91-61753EF8E0A8} 542 {A84C0A25-13D0-40A6-924F-53556D9691DC} = {84899895-AC52-4053-8A91-61753EF8E0A8} 543 {4F15BEA2-F494-4584-A0E5-6BA85377B313} = {84899895-AC52-4053-8A91-61753EF8E0A8} 505 544 {CE2DFB48-6A9C-4507-96C6-5FC40E92035C} = {3721CE4A-1148-49E1-B8DD-D9F5309AB8D9} 506 545 {AC3D84FF-F0D7-43F0-9C99-9F8DBE087E2C} = {3721CE4A-1148-49E1-B8DD-D9F5309AB8D9} -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.Communication/3.3/HeuristicLab.Hive.Client.Communication-3.3.csproj
r4107 r4111 79 79 <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath> 80 80 </Reference> 81 <Reference Include="HeuristicLab.DataAccess-3.3, Version=3.3.0.4091, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 81 82 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 82 83 <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> … … 148 149 </ItemGroup> 149 150 <ItemGroup> 150 <ProjectReference Include="..\..\HeuristicLab.DataAccess\3.3\HeuristicLab.DataAccess-3.3.csproj">151 <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project>152 <Name>HeuristicLab.DataAccess-3.3</Name>153 </ProjectReference>154 151 <ProjectReference Include="..\..\HeuristicLab.Hive.Client.Common\3.3\HeuristicLab.Hive.Client.Common-3.3.csproj"> 155 152 <Project>{89F4BC52-C174-481E-9BD2-3814171020E8}</Project> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.Core/3.3/Properties/AssemblyInfo.cs
r4107 r4111 57 57 // by using the '*' as shown below: 58 58 // [assembly: AssemblyVersion("1.0.*")] 59 [assembly: AssemblyVersion("3.3.0.4 091")]60 [assembly: AssemblyFileVersion("3.3.0.4 091")]61 [assembly: AssemblyBuildDate("2010/07/2 6 18:07:12")]59 [assembly: AssemblyVersion("3.3.0.4107")] 60 [assembly: AssemblyFileVersion("3.3.0.4107")] 61 [assembly: AssemblyBuildDate("2010/07/27 14:15:11")] -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.ExecutionEngine/3.3/Executor.cs
r4107 r4111 55 55 public void Start(byte[] serializedJob) { 56 56 CreationTime = DateTime.Now; 57 //throw new NotImplementedException("TODO[chn] use persistency-3.3");58 // Job = (IJob)PersistenceManager.RestoreFromGZip(serializedJob);59 60 57 Job = XmlParser.Deserialize<IJob>(new MemoryStream(serializedJob)); 61 62 //debug63 //Job = new TestJob();64 58 65 59 Job.JobStopped += new EventHandler(Job_JobStopped); … … 135 129 CurrentMessage = MessageContainer.MessageType.NoMessage; 136 130 JobIsFinished = false; 137 Job = new TestJob();131 //Job = new TestJob(); 138 132 } 139 133 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Engine/3.3/HeuristicLab.Hive.Engine-3.3.csproj
r4107 r4111 97 97 <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath> 98 98 </Reference> 99 <Reference Include="HeuristicLab.Data-3.3"> 100 <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath> 101 </Reference> 99 <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 100 <Reference Include="HeuristicLab.DataAccess-3.3, Version=3.3.0.4091, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 102 101 <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 103 102 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> … … 136 135 </ItemGroup> 137 136 <ItemGroup> 138 <ProjectReference Include="..\..\HeuristicLab.DataAccess\3.3\HeuristicLab.DataAccess-3.3.csproj">139 <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project>140 <Name>HeuristicLab.DataAccess-3.3</Name>141 </ProjectReference>142 137 <ProjectReference Include="..\..\HeuristicLab.Hive.Contracts\3.3\HeuristicLab.Hive.Contracts-3.3.csproj"> 143 138 <Project>{134F93D7-E7C8-4ECD-9923-7F63259A60D8}</Project> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Engine/3.3/HiveEngine.cs
r4107 r4111 70 70 71 71 //public OperatorGraph OperatorGraph { 72 // get { return job.Engine.OperatorGraph; }72 // get { return currentJob.Engine.; } 73 73 //} 74 74 … … 76 76 // get { return job.Engine.GlobalScope; } 77 77 //} 78 79 public TimeSpan ExecutionTime {80 get { return job.Engine.ExecutionTime; }81 }82 78 83 79 public ThreadPriority Priority { … … 86 82 } 87 83 88 //public bool Running { 89 // get { return job.Engine.ExecutionState == Core.ExecutionState.Started; } 90 //} 91 92 //public bool Canceled { 93 // get { return job.Engine.Canceled; } 94 //} 95 96 //public bool Terminated { 97 // get { return job.Engine.Terminated; } 98 //} 99 100 public ExecutionState ExecutionState { 101 get { return job.Engine.ExecutionState; } 102 } 103 104 protected override void ProcessNextOperation() { 105 var jobObj = CreateJobObj(); 84 public new void Prepare(IOperation initialOperation) { 85 this.job.Prepare(initialOperation); 86 OnPrepared(); 87 } 88 89 public override void Start() { 90 SerializedJob jobObj = CreateSerializedJob(); 106 91 IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl); 107 92 108 93 List<string> groups = new List<string>(); 109 if (!String. Empty.Equals(RessourceIds)) {94 if (!String.IsNullOrEmpty(RessourceIds)) { 110 95 groups.AddRange(RessourceIds.Split(';')); 111 96 } 112 97 113 /*if(!String.Empty.Equals(RessourceIds)) { 114 String[] ids = RessourceIds.Split(';'); 115 foreach (string sid in ids) { 116 try { 117 System.Guid gid = new Guid(sid); 118 jobObj.JobInfo.AssignedResourceIds.Add(gid); 119 } catch(Exception ex) { 120 121 } 122 } 123 } */ 124 125 int loops = 1; 126 127 Int32.TryParse(MultiSubmitCount, out loops); 128 if (loops == 0) 129 loops = 1; 130 131 for (int i = 0; i < loops; i++) { 132 ResponseObject<Contracts.BusinessObjects.JobDto> res = executionEngineFacade.AddJobWithGroupStrings(jobObj, groups); 133 jobId = res.Obj.Id; 134 } 98 ResponseObject<JobDto> res = executionEngineFacade.AddJobWithGroupStrings(jobObj, groups); 99 jobId = res.Obj.Id; 135 100 136 101 StartResultPollingThread(); … … 165 130 job = restoredJob; 166 131 132 // [chn] how to show the View in 3.3? 167 133 //ControlManager.Manager.ShowControl(job.Engine.CreateView()); 168 134 //OnChanged(); … … 174 140 } 175 141 176 private HeuristicLab.Hive.Contracts.BusinessObjects.SerializedJob CreateJobObj() { 177 HeuristicLab.Hive.Contracts.BusinessObjects.JobDto jobObj = new HeuristicLab.Hive.Contracts.BusinessObjects.JobDto(); 178 179 // create xml document with <Root> as root-node and the persisted job as child 142 public override void Pause() { 143 base.Pause(); 144 if (job != null) { 145 IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl); 146 executionEngineFacade.AbortJob(jobId); 147 } 148 } 149 150 public override void Stop() { 151 base.Stop(); 152 if (job != null) { 153 IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl); 154 executionEngineFacade.AbortJob(jobId); 155 } 156 } 157 158 /// <summary> 159 /// Creates a SerializedJob Object which contains the currentJob as binary array 160 /// and some metainfo about that job. 161 /// </summary> 162 private SerializedJob CreateSerializedJob() { 163 JobDto jobDto = new JobDto(); 164 165 // serialize current job 180 166 MemoryStream memStream = new MemoryStream(); 181 167 XmlGenerator.Serialize(job, memStream); 182 168 183 169 // convert memStream to byte-array 184 HeuristicLab.Hive.Contracts.BusinessObjects.SerializedJob executableJobObj = new HeuristicLab.Hive.Contracts.BusinessObjects.SerializedJob();185 executableJobObj.JobInfo = job Obj;170 SerializedJob executableJobObj = new SerializedJob(); 171 executableJobObj.JobInfo = jobDto; 186 172 executableJobObj.SerializedJobData = memStream.ToArray(); 187 173 … … 195 181 }).ToList(); 196 182 197 job Obj.CoresNeeded = 1;198 job Obj.PluginsNeeded = pluginsNeeded;199 job Obj.State = HeuristicLab.Hive.Contracts.BusinessObjects.State.offline;183 jobDto.CoresNeeded = 1; 184 jobDto.PluginsNeeded = pluginsNeeded; 185 jobDto.State = State.offline; 200 186 return executableJobObj; 201 187 } 202 188 203 /// <summary>204 /// Returns a list of plugins in which the type itself and all members205 /// of the type are declared. Objectgraph is searched recursively.206 /// </summary>207 private IEnumerable<IPluginDescription> GetDeclaringPlugins(Type type) {208 HashSet<Type> types = new HashSet<Type>();209 FindTypes(type, types, "HeuristicLab.");210 IEnumerable<IPluginDescription> plugins = from t in types211 select ApplicationManager.Manager.GetDeclaringPlugin(t);212 return plugins;213 }214 215 /// <summary>216 /// Recursively finds all types used in type which are in a namespace which starts with namespaceStart217 /// </summary>218 /// <param name="type">the type to be searched</param>219 /// <param name="types">found types will be stored there, needed in order to avoid duplicates</param>220 /// <param name="namespaceStart">only types from namespaces which start with this will be searched and added</param>221 private void FindTypes(Type type, HashSet<Type> types, string namespaceStart) {222 223 // search is not performed on attributes224 225 if (!types.Contains(type) && type.Namespace.StartsWith(namespaceStart)) {226 types.Add(type);227 228 // interfaces229 foreach (Type t in type.GetInterfaces()) {230 FindTypes(t, types, namespaceStart);231 }232 233 // events234 foreach (EventInfo info in type.GetEvents()) {235 FindTypes(info.EventHandlerType, types, namespaceStart);236 FindTypes(info.DeclaringType, types, namespaceStart);237 }238 239 // properties240 foreach (PropertyInfo info in type.GetProperties()) {241 FindTypes(info.PropertyType, types, namespaceStart);242 }243 244 // fields245 foreach (FieldInfo info in type.GetFields()) {246 FindTypes(info.FieldType, types, namespaceStart);247 }248 249 // constructors : maybe constructors them out (?)250 foreach (ConstructorInfo info in type.GetConstructors()) {251 foreach (ParameterInfo paramInfo in info.GetParameters()) {252 FindTypes(paramInfo.ParameterType, types, namespaceStart);253 }254 }255 256 // methods257 foreach (MethodInfo info in type.GetMethods()) {258 foreach (ParameterInfo paramInfo in info.GetParameters()) {259 FindTypes(paramInfo.ParameterType, types, namespaceStart);260 }261 FindTypes(info.ReturnType, types, namespaceStart);262 }263 }264 }265 189 266 190 //public event EventHandler Initialized; … … 321 245 //} 322 246 323 //public void Reset() { 324 // abortRequested = false; 325 326 // throw new NotImplementedException("[chn] how to reset Engine?"); 327 // //job.Engine.Reset(); 328 329 // jobId = Guid.NewGuid(); 330 // OnInitialized(); 331 //} 332 333 //public void RequestSnapshot() { 334 // IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl); 335 // int retryCount = 0; 336 // ResponseObject<SerializedJob> response; 337 // lock (locker) { 338 // Logger.Debug("HiveEngine: Abort - RequestSnapshot"); 339 // Response snapShotResponse = executionEngineFacade.RequestSnapshot(jobId); 340 // if (snapShotResponse.StatusMessage == ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED) { 341 // // job is finished already 342 // Logger.Debug("HiveEngine: Abort - GetLastResult(false)"); 343 // response = executionEngineFacade.GetLastSerializedResult(jobId, false, false); 344 // Logger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 345 // } else { 346 // // server sent snapshot request to client 347 // // poll until snapshot is ready 348 // do { 349 // Thread.Sleep(SNAPSHOT_POLLING_INTERVAL_MS); 350 // Logger.Debug("HiveEngine: Abort - GetLastResult(true)"); 351 // response = executionEngineFacade.GetLastSerializedResult(jobId, false, true); 352 // Logger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 353 // retryCount++; 354 // // loop while 355 // // 1. problem with communication with server 356 // // 2. job result not yet ready 357 // } while ( 358 // (retryCount < MAX_SNAPSHOT_RETRIES) && ( 359 // !response.Success || 360 // response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) 361 // ); 362 // } 363 // } 364 // SerializedJob jobResult = response.Obj; 365 // if (jobResult != null) { 366 // Logger.Debug("HiveEngine: Results-polling - Got result!"); 367 368 // //job = (Job)PersistenceManager.RestoreFromGZip(jobResult.SerializedJobData); 369 // //ControlManager.Manager.ShowControl(job.Engine.CreateView()); 370 // throw new NotImplementedException("TODO[chn]use persistency-3.3"); 371 // } 372 // //HiveLogger.Debug("HiveEngine: Results-polling - Exception!"); 373 // //Exception ex = new Exception(response.Obj.Exception.Message); 374 // //ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(ex); }); 375 //} 376 377 //public override System.Xml.XmlNode GetXmlNode(string name, System.Xml.XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 378 // XmlNode node = base.GetXmlNode(name, document, persistedObjects); 379 // XmlAttribute attr = document.CreateAttribute("HiveServerUrl"); 380 // attr.Value = HiveServerUrl; 381 // node.Attributes.Append(attr); 382 // node.AppendChild(PersistenceManager.Persist("Job", job, document, persistedObjects)); 383 // return node; 384 //} 385 386 //public override void Populate(System.Xml.XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 387 // base.Populate(node, restoredObjects); 388 // HiveServerUrl = node.Attributes["HiveServerUrl"].Value; 389 // job = (Job)PersistenceManager.Restore(node.SelectSingleNode("Job"), restoredObjects); 390 //} 391 392 247 public void RequestSnapshot() { 248 if (job != null) { 249 IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl); 250 int retryCount = 0; 251 ResponseObject<SerializedJob> response; 252 lock (locker) { 253 Logger.Debug("HiveEngine: Abort - RequestSnapshot"); 254 Response snapShotResponse = executionEngineFacade.RequestSnapshot(jobId); 255 if (snapShotResponse.StatusMessage == ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED) { 256 // job is finished already 257 Logger.Debug("HiveEngine: Abort - GetLastResult(false)"); 258 response = executionEngineFacade.GetLastSerializedResult(jobId, false, false); 259 Logger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 260 } else { 261 // server sent snapshot request to client 262 // poll until snapshot is ready 263 do { 264 Thread.Sleep(SNAPSHOT_POLLING_INTERVAL_MS); 265 Logger.Debug("HiveEngine: Abort - GetLastResult(true)"); 266 response = executionEngineFacade.GetLastSerializedResult(jobId, false, true); 267 Logger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success); 268 retryCount++; 269 // loop while 270 // 1. problem with communication with server 271 // 2. job result not yet ready 272 } while ( 273 (retryCount < MAX_SNAPSHOT_RETRIES) && ( 274 !response.Success || 275 response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) 276 ); 277 } 278 279 } 280 SerializedJob jobResult = response.Obj; 281 if (jobResult != null) { 282 Logger.Debug("HiveEngine: Results-polling - Got result!"); 283 284 job = XmlParser.Deserialize<Job>(new MemoryStream(jobResult.SerializedJobData)); 285 286 throw new NotImplementedException("[chn] how to create a view in 3.3 and why should i do this here? shouldnt the caller of this method receive a result and decide what to do?"); 287 //ControlManager.Manager.ShowControl(job.Engine.CreateView()); 288 } 289 } 290 //HiveLogger.Debug("HiveEngine: Results-polling - Exception!"); 291 //Exception ex = new Exception(response.Obj.Exception.Message); 292 //ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(ex); }); 293 } 294 295 protected override void ProcessNextOperation() { 296 throw new NotSupportedException(); 297 } 298 299 #region Required Plugin Search 300 /// <summary> 301 /// Returns a list of plugins in which the type itself and all members 302 /// of the type are declared. Objectgraph is searched recursively. 303 /// </summary> 304 private IEnumerable<IPluginDescription> GetDeclaringPlugins(Type type) { 305 HashSet<Type> types = new HashSet<Type>(); 306 FindTypes(type, types, "HeuristicLab."); 307 return GetDeclaringPlugins(types); 308 } 309 310 /// <summary> 311 /// Returns the plugins (including dependencies) in which the given types are declared 312 /// </summary> 313 private IEnumerable<IPluginDescription> GetDeclaringPlugins(IEnumerable<Type> types) { 314 HashSet<IPluginDescription> plugins = new HashSet<IPluginDescription>(); 315 foreach (Type t in types) { 316 FindDeclaringPlugins(ApplicationManager.Manager.GetDeclaringPlugin(t), plugins); 317 } 318 return plugins; 319 } 320 321 /// <summary> 322 /// Finds the dependencies of the given plugin and adds it to the plugins hashset. 323 /// Also searches the dependencies recursively. 324 /// </summary> 325 private void FindDeclaringPlugins(IPluginDescription plugin, HashSet<IPluginDescription> plugins) { 326 if (!plugins.Contains(plugin)) { 327 plugins.Add(plugin); 328 foreach (IPluginDescription dependency in plugin.Dependencies) { 329 FindDeclaringPlugins(dependency, plugins); 330 } 331 } 332 } 333 334 /// <summary> 335 /// Recursively finds all types used in type which are in a namespace which starts with namespaceStart 336 /// Be aware that search is not performed on attributes 337 /// </summary> 338 /// <param name="type">the type to be searched</param> 339 /// <param name="types">found types will be stored there, needed in order to avoid duplicates</param> 340 /// <param name="namespaceStart">only types from namespaces which start with this will be searched and added</param> 341 private void FindTypes(Type type, HashSet<Type> types, string namespaceStart) { 342 if (!types.Contains(type) && type.Namespace.StartsWith(namespaceStart)) { 343 types.Add(type); 344 345 // constructors 346 foreach (ConstructorInfo info in type.GetConstructors()) { 347 foreach (ParameterInfo paramInfo in info.GetParameters()) { 348 FindTypes(paramInfo.ParameterType, types, namespaceStart); 349 } 350 } 351 352 // interfaces 353 foreach (Type t in type.GetInterfaces()) { 354 FindTypes(t, types, namespaceStart); 355 } 356 357 // events 358 foreach (EventInfo info in type.GetEvents()) { 359 FindTypes(info.EventHandlerType, types, namespaceStart); 360 FindTypes(info.DeclaringType, types, namespaceStart); 361 } 362 363 // properties 364 foreach (PropertyInfo info in type.GetProperties()) { 365 FindTypes(info.PropertyType, types, namespaceStart); 366 } 367 368 // fields 369 foreach (FieldInfo info in type.GetFields()) { 370 FindTypes(info.FieldType, types, namespaceStart); 371 } 372 373 // methods 374 foreach (MethodInfo info in type.GetMethods()) { 375 foreach (ParameterInfo paramInfo in info.GetParameters()) { 376 FindTypes(paramInfo.ParameterType, types, namespaceStart); 377 } 378 FindTypes(info.ReturnType, types, namespaceStart); 379 } 380 } 381 } 382 #endregion 393 383 } 394 384 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Engine/3.3/Job.cs
r4107 r4111 30 30 using HeuristicLab.Common; 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 using HeuristicLab.SequentialEngine; 32 33 33 34 namespace HeuristicLab.Hive.Engine { … … 38 39 public class Job : IJob { 39 40 [Storable] 41 private IOperation initialOperation; 42 public IOperation InitialOperation { 43 get { return initialOperation; } 44 } 45 40 46 private IEngine engine; 41 47 public IEngine Engine { … … 45 51 public Job() 46 52 : base() { 47 48 53 engine = new SequentialEngine.SequentialEngine(); 49 //engine.Priority = ThreadPriority.Lowest;50 54 RegisterEvents(); 51 55 } … … 93 97 get { 94 98 //DoubleValue progress = Engine.GlobalScope.GetVariableValue<DoubleData>("Progress", false, false); [chn] not possible in 3.3? 95 96 99 return engine.ExecutionState == ExecutionState.Stopped ? 1.0 : 0.0; 97 100 } … … 111 114 throw new NotSupportedException(); 112 115 } 113 116 114 117 public void Start() { 115 118 Engine.Start(); … … 118 121 public void Stop() { 119 122 Engine.Stop(); 123 } 124 125 public void Prepare(IOperation initialOperation) { 126 this.initialOperation = initialOperation; 127 Engine.Prepare(initialOperation); 120 128 } 121 129 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.JobBase/3.3/HeuristicLab.Hive.JobBase-3.3.csproj
r4091 r4111 91 91 </PropertyGroup> 92 92 <ItemGroup> 93 <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 93 94 <Reference Include="HeuristicLab.Core-3.3"> 94 95 <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath> … … 115 116 <ItemGroup> 116 117 <Compile Include="Interfaces\IJob.cs" /> 117 <Compile Include="JobBase.cs" />118 118 <Compile Include="JobPlugin.cs" /> 119 119 <Compile Include="Properties\AssemblyInfo.cs" /> 120 <Compile Include="TestJob.cs" />121 120 </ItemGroup> 122 121 <ItemGroup> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.JobBase/3.3/Interfaces/IJob.cs
r4091 r4111 9 9 double Progress { get; } 10 10 void Run(); 11 void Prepare(IOperation initialOperation); 11 12 void Start(); 12 13 void Stop(); -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.JobBase/3.3/JobPlugin.cs
r4091 r4111 9 9 [PluginFile("HeuristicLab.Hive.JobBase-3.3.dll", PluginFileType.Assembly)] 10 10 [PluginDependency("HeuristicLab.Core", "3.3")] 11 [PluginDependency("HeuristicLab.Common", "3.3")] 11 12 [PluginDependency("HeuristicLab.Persistence", "3.3")] 12 13 public class JobBasePlugin: PluginBase { -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Properties/AssemblyInfo.cs
r4107 r4111 55 55 // by using the '*' as shown below: 56 56 // [assembly: AssemblyVersion("1.0.*")] 57 [assembly: AssemblyVersion("3.3.0.410 5")]58 [assembly: AssemblyFileVersion("3.3.0.410 5")]59 [assembly: AssemblyBuildDate("2010/07/2 6 18:07:14")]57 [assembly: AssemblyVersion("3.3.0.4107")] 58 [assembly: AssemblyFileVersion("3.3.0.4107")] 59 [assembly: AssemblyBuildDate("2010/07/27 14:15:12")] -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3/Files.txt
r4107 r4111 16 16 17 17 HeuristicLab.Hive.Engine\3.3:HeuristicLab.Hive.Engine-3.3.dll 18 HeuristicLab.Hive.Experiment\3.3:HeuristicLab.Hive.Experiment-3.3.dll 19 HeuristicLab.Hive.Experiment.Views\3.3:HeuristicLab.Hive.Experiment.Views-3.3.dll 18 20 HeuristicLab.Hive.JobBase\3.3:HeuristicLab.Hive.JobBase-3.3.dll 19 21 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3/Properties/AssemblyInfo.cs
r4107 r4111 51 51 // Revision 52 52 // 53 [assembly: AssemblyVersion("3.3.0.410 5")]54 [assembly: AssemblyFileVersion("3.3.0.410 5")]53 [assembly: AssemblyVersion("3.3.0.4107")] 54 [assembly: AssemblyFileVersion("3.3.0.4107")]
Note: See TracChangeset
for help on using the changeset viewer.