- Timestamp:
- 06/16/11 12:39:32 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentView.Designer.cs
r6419 r6426 52 52 this.jobsTabPage = new System.Windows.Forms.TabPage(); 53 53 this.jobsTreeView = new HeuristicLab.Clients.Hive.Views.ExperimentManager.HiveJobItemTreeView(); 54 this.stateTabPage = new System.Windows.Forms.TabPage(); 55 this.stateLogViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 54 56 this.logTabPage = new System.Windows.Forms.TabPage(); 55 57 this.logView = new HeuristicLab.Core.Views.LogView(); … … 62 64 this.resourceIdsLabel = new System.Windows.Forms.Label(); 63 65 this.resourceNamesTextBox = new System.Windows.Forms.TextBox(); 64 this.useLocalPluginsCheckBox = new System.Windows.Forms.CheckBox();65 66 this.nameLabel = new System.Windows.Forms.Label(); 66 67 this.nameTextBox = new System.Windows.Forms.TextBox(); … … 76 77 this.calculatingLabel = new System.Windows.Forms.Label(); 77 78 this.jobsLabel = new System.Windows.Forms.Label(); 78 this.stateTabPage = new System.Windows.Forms.TabPage();79 this.stateLogViewHost = new ViewHost();80 79 this.tabControl.SuspendLayout(); 81 80 this.jobsTabPage.SuspendLayout(); 81 this.stateTabPage.SuspendLayout(); 82 82 this.logTabPage.SuspendLayout(); 83 83 this.infoGroupBox.SuspendLayout(); 84 this.stateTabPage.SuspendLayout();85 84 this.SuspendLayout(); 86 85 // … … 126 125 this.jobsTreeView.DragOver += new System.Windows.Forms.DragEventHandler(this.jobsTreeView_DragOver); 127 126 // 127 // stateTabPage 128 // 129 this.stateTabPage.Controls.Add(this.stateLogViewHost); 130 this.stateTabPage.Location = new System.Drawing.Point(4, 22); 131 this.stateTabPage.Name = "stateTabPage"; 132 this.stateTabPage.Size = new System.Drawing.Size(709, 426); 133 this.stateTabPage.TabIndex = 6; 134 this.stateTabPage.Text = "State"; 135 this.stateTabPage.UseVisualStyleBackColor = true; 136 // 137 // stateLogViewHost 138 // 139 this.stateLogViewHost.Caption = "StateLog View"; 140 this.stateLogViewHost.Content = null; 141 this.stateLogViewHost.Dock = System.Windows.Forms.DockStyle.Fill; 142 this.stateLogViewHost.Enabled = false; 143 this.stateLogViewHost.Location = new System.Drawing.Point(0, 0); 144 this.stateLogViewHost.Name = "stateLogViewHost"; 145 this.stateLogViewHost.ReadOnly = false; 146 this.stateLogViewHost.Size = new System.Drawing.Size(709, 426); 147 this.stateLogViewHost.TabIndex = 0; 148 this.stateLogViewHost.ViewsLabelVisible = true; 149 this.stateLogViewHost.ViewType = null; 150 // 128 151 // logTabPage 129 152 // … … 234 257 this.resourceNamesTextBox.TabIndex = 14; 235 258 this.resourceNamesTextBox.Validated += new System.EventHandler(this.resourceNamesTextBox_Validated); 236 //237 // useLocalPluginsCheckBox238 //239 this.useLocalPluginsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));240 this.useLocalPluginsCheckBox.AutoSize = true;241 this.useLocalPluginsCheckBox.Location = new System.Drawing.Point(469, 56);242 this.useLocalPluginsCheckBox.Name = "useLocalPluginsCheckBox";243 this.useLocalPluginsCheckBox.Size = new System.Drawing.Size(105, 17);244 this.useLocalPluginsCheckBox.TabIndex = 19;245 this.useLocalPluginsCheckBox.Text = "UseLocalPlugins";246 this.useLocalPluginsCheckBox.UseVisualStyleBackColor = true;247 this.useLocalPluginsCheckBox.CheckedChanged += new System.EventHandler(this.useLocalPluginsCheckBox_CheckedChanged);248 259 // 249 260 // nameLabel … … 370 381 this.jobsLabel.TabIndex = 0; 371 382 this.jobsLabel.Text = "Jobs:"; 372 //373 // stateTabPage374 //375 this.stateTabPage.Controls.Add(this.stateLogViewHost);376 this.stateTabPage.Location = new System.Drawing.Point(4, 22);377 this.stateTabPage.Name = "stateTabPage";378 this.stateTabPage.Size = new System.Drawing.Size(709, 426);379 this.stateTabPage.TabIndex = 6;380 this.stateTabPage.Text = "State";381 this.stateTabPage.UseVisualStyleBackColor = true;382 //383 // stateLogViewHost384 //385 this.stateLogViewHost.Caption = "StateLog View";386 this.stateLogViewHost.Content = null;387 this.stateLogViewHost.Dock = System.Windows.Forms.DockStyle.Fill;388 this.stateLogViewHost.Location = new System.Drawing.Point(0, 0);389 this.stateLogViewHost.Name = "stateLogViewHost";390 this.stateLogViewHost.ReadOnly = false;391 this.stateLogViewHost.Size = new System.Drawing.Size(709, 426);392 this.stateLogViewHost.TabIndex = 0;393 383 // 394 384 // RefreshableHiveExperimentView … … 410 400 this.Controls.Add(this.resourceIdsLabel); 411 401 this.Controls.Add(this.stopButton); 412 this.Controls.Add(this.useLocalPluginsCheckBox);413 402 this.Controls.Add(this.resetButton); 414 403 this.Name = "RefreshableHiveExperimentView"; … … 416 405 this.tabControl.ResumeLayout(false); 417 406 this.jobsTabPage.ResumeLayout(false); 407 this.stateTabPage.ResumeLayout(false); 418 408 this.logTabPage.ResumeLayout(false); 419 409 this.infoGroupBox.ResumeLayout(false); 420 410 this.infoGroupBox.PerformLayout(); 421 this.stateTabPage.ResumeLayout(false);422 411 this.ResumeLayout(false); 423 412 this.PerformLayout(); … … 437 426 private System.Windows.Forms.TabPage logTabPage; 438 427 private Core.Views.LogView logView; 439 private System.Windows.Forms.CheckBox useLocalPluginsCheckBox;440 428 private System.Windows.Forms.TabPage jobsTabPage; 441 429 private HiveJobItemTreeView jobsTreeView; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentView.cs
r6419 r6426 104 104 executionTimeTextBox.Text = string.Empty; 105 105 resourceNamesTextBox.Text = string.Empty; 106 useLocalPluginsCheckBox.Checked = false;107 106 isPrivilegedCheckBox.Checked = false; 108 107 logView.Content = null; … … 113 112 executionTimeTextBox.Text = Content.HiveExperiment.ExecutionTime.ToString(); 114 113 resourceNamesTextBox.Text = Content.HiveExperiment.ResourceNames; 115 useLocalPluginsCheckBox.Checked = Content.HiveExperiment.UseLocalPlugins;116 114 isPrivilegedCheckBox.Checked = Content.HiveExperiment.IsPrivileged; 117 115 refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically; … … 141 139 this.jobsTreeView.ReadOnly = !Content.IsControllable || Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded; 142 140 143 this.isPrivilegedCheckBox.Enabled = Content.IsControllable && !(Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded); // TODO: check if user has the rights to do this 144 this.useLocalPluginsCheckBox.Enabled = Content.IsControllable && !(Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded); 141 this.isPrivilegedCheckBox.Enabled = Content.IsControllable && !(Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded); // TODO: check if user has the rights to do this 145 142 this.refreshAutomaticallyCheckBox.Enabled = Content.IsControllable && alreadyUploaded && jobsLoaded && Content.HiveExperiment.ExecutionState == ExecutionState.Started; 146 143 this.refreshButton.Enabled = Content.IsControllable && alreadyUploaded; … … 312 309 Content.RefreshAutomatically = refreshAutomaticallyCheckBox.Checked; 313 310 } 314 }315 316 private void useLocalPluginsCheckBox_CheckedChanged(object sender, EventArgs e) {317 if (Content != null) Content.HiveExperiment.UseLocalPlugins = useLocalPluginsCheckBox.Checked;318 311 } 319 312 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs
r6419 r6426 71 71 var plugins = new List<IPluginDescription>(); 72 72 PluginUtil.CollectDeclaringPlugins(plugins, types); 73 job.PluginsNeededIds = PluginUtil.GetPluginDependencies(s, new List<Plugin>(), new List<Plugin>(), plugins , false);73 job.PluginsNeededIds = PluginUtil.GetPluginDependencies(s, new List<Plugin>(), new List<Plugin>(), plugins); 74 74 return s.AddChildJob(parentJobId, job, jobData); 75 75 }); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveClient.cs
r6419 r6426 219 219 this.OnlinePlugins = service.GetPlugins(); 220 220 this.AlreadyUploadedPlugins = new List<Plugin>(); 221 Plugin configFilePlugin = UploadConfigurationFile(service );221 Plugin configFilePlugin = UploadConfigurationFile(service, onlinePlugins); 222 222 this.alreadyUploadedPlugins.Add(configFilePlugin); 223 223 … … 226 226 227 227 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); 229 229 } 230 230 … … 240 240 /// Uploads the local configuration file as plugin 241 241 /// </summary> 242 private static Plugin UploadConfigurationFile(IHiveService service ) {242 private static Plugin UploadConfigurationFile(IHiveService service, List<Plugin> onlinePlugins) { 243 243 string exeFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "HeuristicLab 3.3.exe"); 244 244 string configFileName = Path.GetFileName(ConfigurationManager.OpenExeConfiguration(exeFilePath).FilePath); … … 251 251 } 252 252 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 }; 254 254 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 } 257 264 } 258 265 … … 264 271 /// <param name="parentHiveJob">shall be null if its the root job</param> 265 272 /// <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) { 267 274 jobCount++; 268 275 progress.Status = string.Format("Serializing job {0} of {1}", jobCount, totalJobCount); … … 281 288 282 289 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); 284 291 }, -1, "Failed to upload plugins"); 285 292 hiveJob.Job.PluginsNeededIds.Add(configPluginId); … … 300 307 301 308 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); 303 310 } 304 311 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperiment.cs
r6419 r6426 30 30 namespace HeuristicLab.Clients.Hive { 31 31 public partial class HiveExperiment : IDeepCloneable, IContent, IProgressReporter { 32 private bool useLocalPlugins;33 public bool UseLocalPlugins {34 get { return useLocalPlugins; }35 set { useLocalPlugins = value; }36 }37 32 38 33 private bool isPrivileged; … … 115 110 this.Id = original.Id; 116 111 this.HiveJobs = cloner.Clone(original.HiveJobs); 117 this.UseLocalPlugins = original.UseLocalPlugins;118 112 this.ExecutionTime = original.ExecutionTime; 119 113 this.IsPrivileged = original.IsPrivileged; … … 213 207 OnHiveJobsAdded(e); 214 208 } 215 209 216 210 private void item_StateLogChanged(object sender, EventArgs e) { 217 211 OnStateLogListChanged(); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveServiceClient.cs
r6407 r6426 514 514 515 515 [System.Runtime.Serialization.OptionalFieldAttribute()] 516 private bool IsLocalField;517 518 [System.Runtime.Serialization.OptionalFieldAttribute()]519 516 private System.Guid UserIdField; 520 517 … … 544 541 this.HashField = value; 545 542 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");559 543 } 560 544 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Plugin.cs
r6372 r6426 33 33 this.UserId = original.UserId; 34 34 this.DateCreated = original.DateCreated; 35 this.IsLocal = original.IsLocal;36 35 } 37 36 … … 41 40 42 41 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()); 44 43 } 45 44 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/Util/PluginUtil.cs
r6408 r6426 38 38 /// <param name="alreadyUploadedPlugins">List of plugins which have been uploaded from this HiveExperiment</param> 39 39 /// <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>41 40 /// <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) { 43 42 var pluginIds = new List<Guid>(); 44 43 Dictionary<IPluginDescription, byte[]> checksumsNeededPlugins = CalcChecksumsForPlugins(neededPlugins); … … 55 54 }); 56 55 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); 59 58 List<PluginData> pd = CreatePluginDatas(neededPlugin.Key); 60 59 try { … … 76 75 } 77 76 78 private static Plugin CreatePlugin(IPluginDescription plugin, b ool 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 }; 80 79 } 81 80 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 }; 84 83 } 85 84 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Views/3.4/HiveEngineView.Designer.cs
r6419 r6426 38 38 this.executionTimeLabel = new System.Windows.Forms.Label(); 39 39 this.executionTimeTextBox = new System.Windows.Forms.TextBox(); 40 this.useLocalPluginsCheckBox = new System.Windows.Forms.CheckBox();41 40 this.isPrivilegedCheckBox = new System.Windows.Forms.CheckBox(); 42 41 this.tabControl.SuspendLayout(); … … 180 179 this.executionTimeTextBox.Size = new System.Drawing.Size(577, 20); 181 180 this.executionTimeTextBox.TabIndex = 11; 182 //183 // useLocalPluginsCheckBox184 //185 this.useLocalPluginsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));186 this.useLocalPluginsCheckBox.AutoSize = true;187 this.useLocalPluginsCheckBox.Location = new System.Drawing.Point(598, 55);188 this.useLocalPluginsCheckBox.Name = "useLocalPluginsCheckBox";189 this.useLocalPluginsCheckBox.Size = new System.Drawing.Size(105, 17);190 this.useLocalPluginsCheckBox.TabIndex = 12;191 this.useLocalPluginsCheckBox.Text = "UseLocalPlugins";192 this.useLocalPluginsCheckBox.UseVisualStyleBackColor = true;193 this.useLocalPluginsCheckBox.CheckedChanged += new System.EventHandler(this.useLocalPluginsCheckBox_CheckedChanged);194 181 // 195 182 // isPrivilegedCheckBox … … 210 197 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 211 198 this.Controls.Add(this.isPrivilegedCheckBox); 212 this.Controls.Add(this.useLocalPluginsCheckBox);213 199 this.Controls.Add(this.executionTimeTextBox); 214 200 this.Controls.Add(this.executionTimeLabel); … … 243 229 private System.Windows.Forms.Label executionTimeLabel; 244 230 private System.Windows.Forms.TextBox executionTimeTextBox; 245 private System.Windows.Forms.CheckBox useLocalPluginsCheckBox;246 231 private HeuristicLab.Core.Views.LogView logView; 247 232 private RefreshableHiveExperimentListView hiveExperimentListView; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Views/3.4/HiveEngineView.cs
r6419 r6426 73 73 priorityTextBox.Text = string.Empty; 74 74 executionTimeOnHiveTextBox.Text = string.Empty; 75 useLocalPluginsCheckBox.Checked = false;76 75 isPrivilegedCheckBox.Checked = false; 77 76 hiveExperimentListView.Content = null; … … 81 80 priorityTextBox.Text = Content.Priority.ToString(); 82 81 executionTimeOnHiveTextBox.Text = Content.ExecutionTimeOnHive.ToString(); 83 useLocalPluginsCheckBox.Checked = Content.UseLocalPlugins;84 82 isPrivilegedCheckBox.Checked = Content.IsPrivileged; 85 83 hiveExperimentListView.Content = Content.HiveExperiments; … … 94 92 resourceIdsTextBox.ReadOnly = this.ReadOnly; 95 93 priorityTextBox.ReadOnly = this.ReadOnly; 96 useLocalPluginsCheckBox.Enabled = !this.ReadOnly;97 94 isPrivilegedCheckBox.Enabled = !this.ReadOnly; // TODO: check for user rights 98 95 } else { 99 96 resourceIdsTextBox.ReadOnly = false; 100 97 priorityTextBox.ReadOnly = false; 101 useLocalPluginsCheckBox.Enabled = false;102 98 isPrivilegedCheckBox.Enabled = false; 103 99 } 104 100 } 105 101 106 102 #region Event Handlers (child controls) 107 103 private void resourceIdsTextBox_Validated(object sender, EventArgs e) { … … 111 107 private void priorityTextBox_Validated(object sender, EventArgs e) { 112 108 Content.Priority = int.Parse(priorityTextBox.Text); 113 }114 115 private void useLocalPluginsCheckBox_CheckedChanged(object sender, EventArgs e) {116 Content.UseLocalPlugins = useLocalPluginsCheckBox.Checked;117 109 } 118 110 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs
r6419 r6426 68 68 69 69 [Storable] 70 private bool useLocalPlugins;71 public bool UseLocalPlugins {72 get { return useLocalPlugins; }73 set { useLocalPlugins = value; }74 }75 76 [Storable]77 70 private bool isPrivileged; 78 71 public bool IsPrivileged { … … 114 107 this.priority = original.priority; 115 108 this.executionTimeOnHive = original.executionTimeOnHive; 116 this.useLocalPlugins = original.useLocalPlugins;117 109 this.IsPrivileged = original.IsPrivileged; 118 110 // this.hiveExperiments = cloner.Clone(original.hiveExperiments); do not clone hiveExperiments - otherwise they would be sent with every job … … 149 141 if (firstRun) { 150 142 TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException); 151 this.OnlinePlugins = ServiceLocator.Instance.CallHiveService(s => s.GetPlugins()).Where(x => x. IsLocal == false).ToList();143 this.OnlinePlugins = ServiceLocator.Instance.CallHiveService(s => s.GetPlugins()).Where(x => x.Hash != null).ToList(); 152 144 this.AlreadyUploadedPlugins = new List<Plugin>(); 153 145 firstRun = false; … … 338 330 hiveExperiment.Name = "HiveEngine Run " + hiveExperiments.Count; 339 331 hiveExperiment.DateCreated = DateTime.Now; 340 hiveExperiment.UseLocalPlugins = this.UseLocalPlugins;341 332 hiveExperiment.ResourceNames = this.ResourceNames; 342 333 hiveExperiment.IsPrivileged = this.IsPrivileged; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Plugin.cs
r6407 r6426 37 37 38 38 [DataMember] 39 public bool IsLocal { get; set; }40 41 [DataMember]42 39 public byte[] Hash { get; set; } 43 40 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs
r6407 r6426 167 167 public static DT.Plugin ToDto(Plugin source) { 168 168 if (source == null) return null; 169 return new DT.Plugin { Id = source.PluginId, Name = source.Name, Version = new Version(source.Version), UserId = source.UserId, IsLocal = source.IsLocal,DateCreated = source.DateCreated, Hash = source.Hash };169 return new DT.Plugin { Id = source.PluginId, Name = source.Name, Version = new Version(source.Version), UserId = source.UserId, DateCreated = source.DateCreated, Hash = source.Hash }; 170 170 } 171 171 public static Plugin ToEntity(DT.Plugin source) { … … 176 176 public static void ToEntity(DT.Plugin source, Plugin target) { 177 177 if ((source != null) && (target != null)) { 178 target.PluginId = source.Id; target.Name = source.Name; target.Version = source.Version.ToString(); target.UserId = source.UserId; target. IsLocal = source.IsLocal; target.DateCreated = source.DateCreated; target.Hash = source.Hash;178 target.PluginId = source.Id; target.Name = source.Name; target.Version = source.Version.ToString(); target.UserId = source.UserId; target.DateCreated = source.DateCreated; target.Hash = source.Hash; 179 179 } 180 180 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml
r6407 r6426 14 14 <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 15 15 <Column Name="Version" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 16 <Column Name="IsLocal" Type="System.Boolean" DbType="Bit" CanBeNull="false" />17 16 <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" /> 18 17 <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" /> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout
r6407 r6426 9 9 </nestedChildShapes> 10 10 </classShape> 11 <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="8.875, 5.5, 2, 2.1554996744791666">11 <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="8.875, 5.5, 2, 1.9631982421874996"> 12 12 <DataClassMoniker Name="/HiveDataContext/Plugin" /> 13 13 <nestedChildShapes> 14 <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="8.89, 5.9600000000000009, 1.9700000000000002, 1. 5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />14 <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="8.89, 5.9600000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 15 15 </nestedChildShapes> 16 16 </classShape> … … 76 76 </nodes> 77 77 </associationConnector> 78 <associationConnector edgePoints="[(7.5 : 4.30930826822917); (7.5 : 4.84780160677083); (8.875 : 4.84780160677083)]" fixedFrom=" NotFixed" fixedTo="NotFixed">78 <associationConnector edgePoints="[(7.5 : 4.30930826822917); (7.5 : 4.84780160677083); (8.875 : 4.84780160677083)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 79 79 <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" /> 80 80 <nodes> … … 116 116 </nestedChildShapes> 117 117 </classShape> 118 <associationConnector edgePoints="[(10.875 : 6.28929768880208); (11.25 : 6.28929768880208)]" fixedFrom=" NotFixed" fixedTo="NotFixed">118 <associationConnector edgePoints="[(10.875 : 6.28929768880208); (11.25 : 6.28929768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 119 119 <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" /> 120 120 <nodes> … … 130 130 </nodes> 131 131 </associationConnector> 132 <associationConnector edgePoints="[(8.875 : 6.19314697265625); (8.5 : 6.19314697265625)]" fixedFrom=" NotFixed" fixedTo="NotFixed">132 <associationConnector edgePoints="[(8.875 : 6.19314697265625); (8.5 : 6.19314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 133 133 <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" /> 134 134 <nodes> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs
r6407 r6426 438 438 private string _Version; 439 439 440 private bool _IsLocal;441 442 440 private System.Guid _UserId; 443 441 … … 460 458 partial void OnVersionChanging(string value); 461 459 partial void OnVersionChanged(); 462 partial void OnIsLocalChanging(bool value);463 partial void OnIsLocalChanged();464 460 partial void OnUserIdChanging(System.Guid value); 465 461 partial void OnUserIdChanged(); … … 533 529 this.SendPropertyChanged("Version"); 534 530 this.OnVersionChanged(); 535 }536 }537 }538 539 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsLocal", DbType="Bit")]540 public bool IsLocal541 {542 get543 {544 return this._IsLocal;545 }546 set547 {548 if ((this._IsLocal != value))549 {550 this.OnIsLocalChanging(value);551 this.SendPropertyChanging();552 this._IsLocal = value;553 this.SendPropertyChanged("IsLocal");554 this.OnIsLocalChanged();555 531 } 556 532 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
r6419 r6426 98 98 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave); 99 99 //trans.UseTransaction(() => { // cneumuel: try without transaction 100 101 102 100 jobData.LastUpdate = DateTime.Now; 101 dao.UpdateJob(job); 102 dao.UpdateJobData(jobData); 103 103 //}, false, true); 104 104 } … … 285 285 plugin.UserId = author.UserId; 286 286 plugin.DateCreated = DateTime.Now; 287 if (!plugin.IsLocal) { 288 var existing = dao.GetPlugins(x => x.Hash != null && !x.IsLocal).Where(x => x.Hash.SequenceEqual(plugin.Hash)); 289 290 if (existing.Count() > 0) { 291 // a plugin with the same name and version already exists. 292 throw new FaultException<PluginAlreadyExistsFault>(new PluginAlreadyExistsFault(existing.Single().Id)); 293 } 294 } 287 288 var existing = dao.GetPlugins(x => x.Hash != null).Where(x => x.Hash.SequenceEqual(plugin.Hash)); 289 if (existing.Count() > 0) { 290 // a plugin already exists. 291 throw new FaultException<PluginAlreadyExistsFault>(new PluginAlreadyExistsFault(existing.Single().Id)); 292 } 293 295 294 Guid pluginId = dao.AddPlugin(plugin); 296 295 foreach (PluginData pluginData in pluginDatas) { … … 309 308 public IEnumerable<Plugin> GetPlugins() { 310 309 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave); 311 return dao.GetPlugins(x => x. IsLocal == false);310 return dao.GetPlugins(x => x.Hash != null); 312 311 } 313 312
Note: See TracChangeset
for help on using the changeset viewer.