Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/16/11 12:39:32 (13 years ago)
Author:
ascheibe
Message:

#1233 removed useLocalPlugins

Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveClient.cs

    r6419 r6426  
    219219          this.OnlinePlugins = service.GetPlugins();
    220220          this.AlreadyUploadedPlugins = new List<Plugin>();
    221           Plugin configFilePlugin = UploadConfigurationFile(service);
     221          Plugin configFilePlugin = UploadConfigurationFile(service, onlinePlugins);
    222222          this.alreadyUploadedPlugins.Add(configFilePlugin);
    223223
     
    226226
    227227          foreach (HiveJob hiveJob in refreshableHiveExperiment.HiveExperiment.HiveJobs) {
    228             UploadJobWithChildren(refreshableHiveExperiment.HiveExperiment.Progress, service, hiveJob, null, resourceIds, ref jobCount, totalJobCount, configFilePlugin.Id, refreshableHiveExperiment.HiveExperiment.UseLocalPlugins, refreshableHiveExperiment.HiveExperiment.Id, refreshableHiveExperiment.Log, refreshableHiveExperiment.HiveExperiment.IsPrivileged);
     228            UploadJobWithChildren(refreshableHiveExperiment.HiveExperiment.Progress, service, hiveJob, null, resourceIds, ref jobCount, totalJobCount, configFilePlugin.Id, refreshableHiveExperiment.HiveExperiment.Id, refreshableHiveExperiment.Log, refreshableHiveExperiment.HiveExperiment.IsPrivileged);
    229229          }
    230230
     
    240240    /// Uploads the local configuration file as plugin
    241241    /// </summary>
    242     private static Plugin UploadConfigurationFile(IHiveService service) {
     242    private static Plugin UploadConfigurationFile(IHiveService service, List<Plugin> onlinePlugins) {
    243243      string exeFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "HeuristicLab 3.3.exe");
    244244      string configFileName = Path.GetFileName(ConfigurationManager.OpenExeConfiguration(exeFilePath).FilePath);
     
    251251      }
    252252
    253       Plugin configPlugin = new Plugin() { Name = "Configuration", IsLocal = true, Version = new Version(), Hash = hash };
     253      Plugin configPlugin = new Plugin() { Name = "Configuration", Version = new Version(), Hash = hash };
    254254      PluginData configFile = new PluginData() { FileName = configFileName, Data = data };
    255       configPlugin.Id = service.AddPlugin(configPlugin, new List<PluginData> { configFile });
    256       return configPlugin;
     255
     256      IEnumerable<Plugin> onlineConfig = onlinePlugins.Where(p => p.Hash.SequenceEqual(hash));
     257
     258      if (onlineConfig.Count() > 0) {
     259        return onlineConfig.First();
     260      } else {
     261        configPlugin.Id = service.AddPlugin(configPlugin, new List<PluginData> { configFile });
     262        return configPlugin;
     263      }
    257264    }
    258265
     
    264271    /// <param name="parentHiveJob">shall be null if its the root job</param>
    265272    /// <param name="groups"></param>
    266     private void UploadJobWithChildren(IProgress progress, IHiveService service, HiveJob hiveJob, HiveJob parentHiveJob, IEnumerable<Guid> groups, ref int jobCount, int totalJobCount, Guid configPluginId, bool useLocalPlugins, Guid hiveExperimentId, ILog log, bool isPrivileged) {
     273    private void UploadJobWithChildren(IProgress progress, IHiveService service, HiveJob hiveJob, HiveJob parentHiveJob, IEnumerable<Guid> groups, ref int jobCount, int totalJobCount, Guid configPluginId, Guid hiveExperimentId, ILog log, bool isPrivileged) {
    267274      jobCount++;
    268275      progress.Status = string.Format("Serializing job {0} of {1}", jobCount, totalJobCount);
     
    281288
    282289      TryAndRepeat(() => {
    283         hiveJob.Job.PluginsNeededIds = PluginUtil.GetPluginDependencies(service, this.onlinePlugins, this.alreadyUploadedPlugins, plugins, useLocalPlugins);
     290        hiveJob.Job.PluginsNeededIds = PluginUtil.GetPluginDependencies(service, this.onlinePlugins, this.alreadyUploadedPlugins, plugins);
    284291      }, -1, "Failed to upload plugins");
    285292      hiveJob.Job.PluginsNeededIds.Add(configPluginId);
     
    300307
    301308      foreach (HiveJob child in hiveJob.ChildHiveJobs) {
    302         UploadJobWithChildren(progress, service, child, hiveJob, groups, ref jobCount, totalJobCount, configPluginId, useLocalPlugins, hiveExperimentId, log, isPrivileged);
     309        UploadJobWithChildren(progress, service, child, hiveJob, groups, ref jobCount, totalJobCount, configPluginId, hiveExperimentId, log, isPrivileged);
    303310      }
    304311    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperiment.cs

    r6419 r6426  
    3030namespace HeuristicLab.Clients.Hive {
    3131  public partial class HiveExperiment : IDeepCloneable, IContent, IProgressReporter {
    32     private bool useLocalPlugins;
    33     public bool UseLocalPlugins {
    34       get { return useLocalPlugins; }
    35       set { useLocalPlugins = value; }
    36     }
    3732
    3833    private bool isPrivileged;
     
    115110      this.Id = original.Id;
    116111      this.HiveJobs = cloner.Clone(original.HiveJobs);
    117       this.UseLocalPlugins = original.UseLocalPlugins;
    118112      this.ExecutionTime = original.ExecutionTime;
    119113      this.IsPrivileged = original.IsPrivileged;
     
    213207      OnHiveJobsAdded(e);
    214208    }
    215    
     209
    216210    private void item_StateLogChanged(object sender, EventArgs e) {
    217211      OnStateLogListChanged();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveServiceClient.cs

    r6407 r6426  
    514514
    515515    [System.Runtime.Serialization.OptionalFieldAttribute()]
    516     private bool IsLocalField;
    517 
    518     [System.Runtime.Serialization.OptionalFieldAttribute()]
    519516    private System.Guid UserIdField;
    520517
     
    544541          this.HashField = value;
    545542          this.RaisePropertyChanged("Hash");
    546         }
    547       }
    548     }
    549 
    550     [System.Runtime.Serialization.DataMemberAttribute()]
    551     public bool IsLocal {
    552       get {
    553         return this.IsLocalField;
    554       }
    555       set {
    556         if ((this.IsLocalField.Equals(value) != true)) {
    557           this.IsLocalField = value;
    558           this.RaisePropertyChanged("IsLocal");
    559543        }
    560544      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Plugin.cs

    r6372 r6426  
    3333      this.UserId = original.UserId;
    3434      this.DateCreated = original.DateCreated;
    35       this.IsLocal = original.IsLocal;
    3635    }
    3736
     
    4140
    4241    public override string ToString() {
    43       return string.Format("{0}-{1}", this.Name, this.Version.ToString()) + (this.IsLocal ? ", Local" : string.Empty);
     42      return string.Format("{0}-{1}", this.Name, this.Version.ToString());
    4443    }
    4544  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/Util/PluginUtil.cs

    r6408 r6426  
    3838    /// <param name="alreadyUploadedPlugins">List of plugins which have been uploaded from this HiveExperiment</param>
    3939    /// <param name="neededPlugins">List of plugins which need to be uploaded</param>
    40     /// <param name="useLocalPlugins">If true, the plugins which are already online are ignored. All local plugins are uploaded, but only once.</param>
    4140    /// <returns></returns>
    42     public static List<Guid> GetPluginDependencies(IHiveService service, List<Plugin> onlinePlugins, List<Plugin> alreadyUploadedPlugins, IEnumerable<IPluginDescription> neededPlugins, bool useLocalPlugins) {
     41    public static List<Guid> GetPluginDependencies(IHiveService service, List<Plugin> onlinePlugins, List<Plugin> alreadyUploadedPlugins, IEnumerable<IPluginDescription> neededPlugins) {
    4342      var pluginIds = new List<Guid>();
    4443      Dictionary<IPluginDescription, byte[]> checksumsNeededPlugins = CalcChecksumsForPlugins(neededPlugins);
     
    5554          });
    5655
    57           if (useLocalPlugins || foundPlugin == null) {
    58             Plugin p = CreatePlugin(neededPlugin.Key, useLocalPlugins, neededPlugin.Value);
     56          if (foundPlugin == null) {
     57            Plugin p = CreatePlugin(neededPlugin.Key, neededPlugin.Value);
    5958            List<PluginData> pd = CreatePluginDatas(neededPlugin.Key);
    6059            try {
     
    7675    }
    7776
    78     private static Plugin CreatePlugin(IPluginDescription plugin, bool useLocalPlugins, byte[] hash) {
    79       return new Plugin() { Name = plugin.Name, Version = plugin.Version, IsLocal = useLocalPlugins, Hash = hash };
     77    private static Plugin CreatePlugin(IPluginDescription plugin, byte[] hash) {
     78      return new Plugin() { Name = plugin.Name, Version = plugin.Version, Hash = hash };
    8079    }
    8180
    82     public static Plugin CreatePlugin(IPluginDescription plugin, bool useLocalPlugins) {
    83       return new Plugin() { Name = plugin.Name, Version = plugin.Version, IsLocal = useLocalPlugins };
     81    public static Plugin CreatePlugin(IPluginDescription plugin) {
     82      return new Plugin() { Name = plugin.Name, Version = plugin.Version };
    8483    }
    8584
Note: See TracChangeset for help on using the changeset viewer.