Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4111


Ignore:
Timestamp:
07/27/10 14:20:42 (13 years ago)
Author:
cneumuel
Message:

added experiment plugins (#1115)

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  
    5757// by using the '*' as shown below:
    5858// [assembly: AssemblyVersion("1.0.*")]
    59 [assembly: AssemblyVersion("3.3.0.4105")]
    60 [assembly: AssemblyFileVersion("3.3.0.4105")]
    61 [assembly: AssemblyBuildDate("2010/07/26 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  
    88Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Hive-3.3", "HeuristicLab.Hive\3.3\HeuristicLab.Hive-3.3.csproj", "{C92AAC8C-4D88-449C-ABA5-2B935D769842}"
    99  ProjectSection(ProjectDependencies) = postProject
     10    {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE} = {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE}
    1011    {55B89815-F3E7-4D09-9442-273F849141DD} = {55B89815-F3E7-4D09-9442-273F849141DD}
    1112    {4D5A2A16-66C2-431D-9AA3-BD3041E64B84} = {4D5A2A16-66C2-431D-9AA3-BD3041E64B84}
    1213    {21187322-52DD-4243-80A4-A85F0263E63B} = {21187322-52DD-4243-80A4-A85F0263E63B}
     14    {A84C0A25-13D0-40A6-924F-53556D9691DC} = {A84C0A25-13D0-40A6-924F-53556D9691DC}
    1315    {A04AE929-D0E1-466D-A9D3-BF3C4B2C209F} = {A04AE929-D0E1-466D-A9D3-BF3C4B2C209F}
    1416    {D59E852C-F205-4647-8C05-EB9ED1CF44E9} = {D59E852C-F205-4647-8C05-EB9ED1CF44E9}
    1517    {CE2DFB48-6A9C-4507-96C6-5FC40E92035C} = {CE2DFB48-6A9C-4507-96C6-5FC40E92035C}
     18    {89F4BC52-C174-481E-9BD2-3814171020E8} = {89F4BC52-C174-481E-9BD2-3814171020E8}
    1619    {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}
    1722    {D17A4D6A-4CAA-4470-8A19-F42463C021FD} = {D17A4D6A-4CAA-4470-8A19-F42463C021FD}
    1823    {42A1D075-6C12-4DD9-B0C2-C6F5210A8119} = {42A1D075-6C12-4DD9-B0C2-C6F5210A8119}
    1924    {679E977A-117B-456E-8594-2A4DEADB658B} = {679E977A-117B-456E-8594-2A4DEADB658B}
    2025    {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}
    2128    {48D4AEB1-2247-4B58-8B63-20B81BF8D4B1} = {48D4AEB1-2247-4B58-8B63-20B81BF8D4B1}
    2229    {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11} = {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}
     
    95102EndProject
    96103Project("{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}"
     104EndProject
     105Project("{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}"
     106EndProject
     107Project("{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}"
    97108EndProject
    98109Global
     
    483494    {FD1AFEC2-7A79-45CF-9365-5195B04A2C9F}.Release|x86.ActiveCfg = Release|x86
    484495    {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
    485522  EndGlobalSection
    486523  GlobalSection(SolutionProperties) = preSolution
     
    503540    {21187322-52DD-4243-80A4-A85F0263E63B} = {84899895-AC52-4053-8A91-61753EF8E0A8}
    504541    {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}
    505544    {CE2DFB48-6A9C-4507-96C6-5FC40E92035C} = {3721CE4A-1148-49E1-B8DD-D9F5309AB8D9}
    506545    {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  
    7979      <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
    8080    </Reference>
     81    <Reference Include="HeuristicLab.DataAccess-3.3, Version=3.3.0.4091, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    8182    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
    8283      <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     
    148149  </ItemGroup>
    149150  <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>
    154151    <ProjectReference Include="..\..\HeuristicLab.Hive.Client.Common\3.3\HeuristicLab.Hive.Client.Common-3.3.csproj">
    155152      <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  
    5757// by using the '*' as shown below:
    5858// [assembly: AssemblyVersion("1.0.*")]
    59 [assembly: AssemblyVersion("3.3.0.4091")]
    60 [assembly: AssemblyFileVersion("3.3.0.4091")]
    61 [assembly: AssemblyBuildDate("2010/07/26 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  
    5555    public void Start(byte[] serializedJob) {
    5656      CreationTime = DateTime.Now;
    57       //throw new NotImplementedException("TODO[chn] use persistency-3.3");
    58       // Job = (IJob)PersistenceManager.RestoreFromGZip(serializedJob);
    59 
    6057      Job = XmlParser.Deserialize<IJob>(new MemoryStream(serializedJob));
    61 
    62       //debug
    63       //Job = new TestJob();
    6458
    6559      Job.JobStopped += new EventHandler(Job_JobStopped);
     
    135129      CurrentMessage = MessageContainer.MessageType.NoMessage;
    136130      JobIsFinished = false;
    137       Job = new TestJob();
     131      //Job = new TestJob();
    138132    }
    139133
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Engine/3.3/HeuristicLab.Hive.Engine-3.3.csproj

    r4107 r4111  
    9797      <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
    9898    </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" />
    102101    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    103102    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
     
    136135  </ItemGroup>
    137136  <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>
    142137    <ProjectReference Include="..\..\HeuristicLab.Hive.Contracts\3.3\HeuristicLab.Hive.Contracts-3.3.csproj">
    143138      <Project>{134F93D7-E7C8-4ECD-9923-7F63259A60D8}</Project>
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Engine/3.3/HiveEngine.cs

    r4107 r4111  
    7070
    7171    //public OperatorGraph OperatorGraph {
    72     //  get { return job.Engine.OperatorGraph; }
     72    //  get { return currentJob.Engine.; }
    7373    //}
    7474
     
    7676    //  get { return job.Engine.GlobalScope; }
    7777    //}
    78 
    79     public TimeSpan ExecutionTime {
    80       get { return job.Engine.ExecutionTime; }
    81     }
    8278
    8379    public ThreadPriority Priority {
     
    8682    }
    8783
    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();
    10691      IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl);
    10792
    10893      List<string> groups = new List<string>();
    109       if (!String.Empty.Equals(RessourceIds)) {
     94      if (!String.IsNullOrEmpty(RessourceIds)) {
    11095        groups.AddRange(RessourceIds.Split(';'));
    11196      }
    11297
    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;
    135100
    136101      StartResultPollingThread();
     
    165130        job = restoredJob;
    166131
     132        // [chn] how to show the View in 3.3?
    167133        //ControlManager.Manager.ShowControl(job.Engine.CreateView());
    168134        //OnChanged();
     
    174140    }
    175141
    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
    180166      MemoryStream memStream = new MemoryStream();
    181167      XmlGenerator.Serialize(job, memStream);
    182168
    183169      // convert memStream to byte-array
    184       HeuristicLab.Hive.Contracts.BusinessObjects.SerializedJob executableJobObj = new HeuristicLab.Hive.Contracts.BusinessObjects.SerializedJob();
    185       executableJobObj.JobInfo = jobObj;
     170      SerializedJob executableJobObj = new SerializedJob();
     171      executableJobObj.JobInfo = jobDto;
    186172      executableJobObj.SerializedJobData = memStream.ToArray();
    187173
     
    195181        }).ToList();
    196182
    197       jobObj.CoresNeeded = 1;
    198       jobObj.PluginsNeeded = pluginsNeeded;
    199       jobObj.State = HeuristicLab.Hive.Contracts.BusinessObjects.State.offline;
     183      jobDto.CoresNeeded = 1;
     184      jobDto.PluginsNeeded = pluginsNeeded;
     185      jobDto.State = State.offline;
    200186      return executableJobObj;
    201187    }
    202188
    203     /// <summary>
    204     /// Returns a list of plugins in which the type itself and all members
    205     /// 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 types
    211                                                 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 namespaceStart
    217     /// </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 attributes
    224 
    225       if (!types.Contains(type) && type.Namespace.StartsWith(namespaceStart)) {
    226         types.Add(type);
    227 
    228         // interfaces
    229         foreach (Type t in type.GetInterfaces()) {
    230           FindTypes(t, types, namespaceStart);
    231         }
    232 
    233         // events
    234         foreach (EventInfo info in type.GetEvents()) {
    235           FindTypes(info.EventHandlerType, types, namespaceStart);
    236           FindTypes(info.DeclaringType, types, namespaceStart);
    237         }
    238 
    239         // properties
    240         foreach (PropertyInfo info in type.GetProperties()) {
    241           FindTypes(info.PropertyType, types, namespaceStart);
    242         }
    243 
    244         // fields
    245         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         // methods
    257         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     }
    265189
    266190    //public event EventHandler Initialized;
     
    321245    //}
    322246
    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
    393383  }
    394384}
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Engine/3.3/Job.cs

    r4107 r4111  
    3030using HeuristicLab.Common;
    3131using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     32using HeuristicLab.SequentialEngine;
    3233
    3334namespace HeuristicLab.Hive.Engine {
     
    3839  public class Job : IJob {
    3940    [Storable]
     41    private IOperation initialOperation;
     42    public IOperation InitialOperation {
     43      get { return initialOperation; }
     44    }
     45
    4046    private IEngine engine;
    4147    public IEngine Engine {
     
    4551    public Job()
    4652      : base() {
    47      
    4853      engine = new SequentialEngine.SequentialEngine();
    49       //engine.Priority = ThreadPriority.Lowest;
    5054      RegisterEvents();
    5155    }
     
    9397      get {
    9498        //DoubleValue progress = Engine.GlobalScope.GetVariableValue<DoubleData>("Progress", false, false); [chn] not possible in 3.3?
    95 
    9699        return engine.ExecutionState == ExecutionState.Stopped ? 1.0 : 0.0;
    97100      }
     
    111114      throw new NotSupportedException();
    112115    }
    113 
     116   
    114117    public void Start() {
    115118      Engine.Start();
     
    118121    public void Stop() {
    119122      Engine.Stop();
     123    }
     124
     125    public void Prepare(IOperation initialOperation) {
     126      this.initialOperation = initialOperation;
     127      Engine.Prepare(initialOperation);
    120128    }
    121129
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.JobBase/3.3/HeuristicLab.Hive.JobBase-3.3.csproj

    r4091 r4111  
    9191  </PropertyGroup>
    9292  <ItemGroup>
     93    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    9394    <Reference Include="HeuristicLab.Core-3.3">
    9495      <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
     
    115116  <ItemGroup>
    116117    <Compile Include="Interfaces\IJob.cs" />
    117     <Compile Include="JobBase.cs" />
    118118    <Compile Include="JobPlugin.cs" />
    119119    <Compile Include="Properties\AssemblyInfo.cs" />
    120     <Compile Include="TestJob.cs" />
    121120  </ItemGroup>
    122121  <ItemGroup>
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.JobBase/3.3/Interfaces/IJob.cs

    r4091 r4111  
    99    double Progress { get; }
    1010    void Run();
     11    void Prepare(IOperation initialOperation);
    1112    void Start();
    1213    void Stop();
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.JobBase/3.3/JobPlugin.cs

    r4091 r4111  
    99  [PluginFile("HeuristicLab.Hive.JobBase-3.3.dll", PluginFileType.Assembly)]
    1010  [PluginDependency("HeuristicLab.Core", "3.3")]
     11  [PluginDependency("HeuristicLab.Common", "3.3")]
    1112  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    1213  public class JobBasePlugin: PluginBase {
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Properties/AssemblyInfo.cs

    r4107 r4111  
    5555// by using the '*' as shown below:
    5656// [assembly: AssemblyVersion("1.0.*")]
    57 [assembly: AssemblyVersion("3.3.0.4105")]
    58 [assembly: AssemblyFileVersion("3.3.0.4105")]
    59 [assembly: AssemblyBuildDate("2010/07/26 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  
    1616
    1717HeuristicLab.Hive.Engine\3.3:HeuristicLab.Hive.Engine-3.3.dll
     18HeuristicLab.Hive.Experiment\3.3:HeuristicLab.Hive.Experiment-3.3.dll
     19HeuristicLab.Hive.Experiment.Views\3.3:HeuristicLab.Hive.Experiment.Views-3.3.dll
    1820HeuristicLab.Hive.JobBase\3.3:HeuristicLab.Hive.JobBase-3.3.dll
    1921
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3/Properties/AssemblyInfo.cs

    r4107 r4111  
    5151//      Revision
    5252//
    53 [assembly: AssemblyVersion("3.3.0.4105")]
    54 [assembly: AssemblyFileVersion("3.3.0.4105")]
     53[assembly: AssemblyVersion("3.3.0.4107")]
     54[assembly: AssemblyFileVersion("3.3.0.4107")]
Note: See TracChangeset for help on using the changeset viewer.