示例#1
0
        public void SortJobs()
        {
            for (int i = 0; i < jobs.Count; i++)
            {
                var projectId    = jobs.Keys.ElementAt(i);
                var unsortedJobs = jobs.Values.ElementAt(i);

                var sortedJobs = new HiveItemCollection <RefreshableJob>();
                sortedJobs.AddRange(unsortedJobs.Where(j => j.Job.State == JobState.DeletionPending));
                sortedJobs.AddRange(unsortedJobs.Where(j => j.Job.State == JobState.StatisticsPending));
                sortedJobs.AddRange(unsortedJobs.Where(j => j.Job.State == JobState.Online));

                jobs[projectId] = sortedJobs;
            }
        }
示例#2
0
        public void Refresh()
        {
            OnRefreshing();

            try {
                jobs = new HiveItemCollection <RefreshableJob>();
                var jobsLoaded = HiveServiceLocator.Instance.CallHiveService <IEnumerable <Job> >(s => s.GetJobs());

                foreach (var j in jobsLoaded)
                {
                    jobs.Add(new RefreshableJob(j));
                }
            }
            catch {
                jobs = null;
                throw;
            }
            finally {
                OnRefreshed();
            }
        }
示例#3
0
        public void Refresh()
        {
            OnRefreshing();

            try {
                projects      = new ItemList <Project>();
                resources     = new ItemList <Resource>();
                jobs          = new HiveItemCollection <RefreshableJob>();
                projectNames  = new Dictionary <Guid, string>();
                resourceNames = new Dictionary <Guid, string>();

                projectAncestors    = new Dictionary <Guid, HashSet <Guid> >();
                projectDescendants  = new Dictionary <Guid, HashSet <Guid> >();
                resourceAncestors   = new Dictionary <Guid, HashSet <Guid> >();
                resourceDescendants = new Dictionary <Guid, HashSet <Guid> >();

                HiveServiceLocator.Instance.CallHiveService(service => {
                    service.GetProjects().ForEach(p => projects.Add(p));
                    service.GetSlaveGroups().ForEach(g => resources.Add(g));
                    service.GetSlaves().ForEach(s => resources.Add(s));
                    service.GetJobs().ForEach(p => jobs.Add(new RefreshableJob(p)));
                    projectNames  = service.GetProjectNames();
                    resourceNames = service.GetResourceNames();
                });

                RefreshResourceGenealogy();
                RefreshProjectGenealogy();
                RefreshDisabledParentProjects();
                RefreshDisabledParentResources();
            } catch {
                jobs      = null;
                projects  = null;
                resources = null;
                throw;
            } finally {
                OnRefreshed();
            }
        }
示例#4
0
        public void Refresh()
        {
            OnRefreshing();

            try {
                jobs = new HiveItemCollection <RefreshableJob>();
                var jobsLoaded = HiveServiceLocator.Instance.CallHiveService <IEnumerable <Job> >(s => s.GetJobs());

                try {
                    foreach (var j in jobsLoaded)
                    {
                        jobs.Add(new RefreshableJob(j));
                    }
                } catch (NullReferenceException) {
                    // jobs was set to null during ClearHiveClient
                }
            } catch {
                jobs = null;
                throw;
            } finally {
                OnRefreshed();
            }
        }
 protected HiveItemCollection(HiveItemCollection <T> original, Cloner cloner) : base(original, cloner)
 {
 }