Esempio n. 1
0
        public SchedulerParser(SignInfo sign, SchedulerInfo item)
        {
            Sign = sign;
            Item = item;

            Check.Require(Item, "Item", Check.NotNull);
            Check.Require(Sign, "Sign", Check.NotNull);
        }
Esempio n. 2
0
        public ActionResult Pause(SchedulerInfo taskData)
        {
            _schedulerManager.SetWPIntService(getCurrentService());
            _schedulerManager.SuspendTask(taskData.TaskName, taskData.SchedulerName);
            GetInfoResponse infoResponse = _schedulerManager.GetTaskList();

            infoResponse.TasksInfos = TaskListSort.SortByName(infoResponse.TasksInfos);
            return(PartialView("TableView", infoResponse));
        }
Esempio n. 3
0
 public TestBase()
 {
     Scheduler = new SchedulerInfo();
     Sign      = new SignInfo {
         Name = "Demo Sign", Width = 64, Height = 32
     };
     Saver = new ScheduleSaver {
         Item = Scheduler, Sign = Sign
     };
     Count = 1;
 }
Esempio n. 4
0
        /// <summary>
        /// Function: Init upload uploadAction
        /// </summary>
        /// <param name="sign">SignInfo</param>
        /// <param name="sessionInfo">SchedulerInfo:ProWrite</param>
        public UploadAction(SignInfo sign, SchedulerInfo scheduler)
        {
            ProWrite.UI.Controls.Actions.UFE.Responses.UFEResponseService.Init(sign);

            Log.Info("UploadAction Init.");
            Check.Require(sign, "sign", Check.NotNull);
            Check.Require(scheduler, "sessionInfo", Check.NotNull);


            _sign      = sign;
            _scheduler = scheduler;

            _scheduleSaver.Item = _scheduler;
            _scheduleSaver.Sign = _sign;
        }
 public CrashDebuggerInfo(DbgEngine aDebugEngine)
 {
     iDebugEngine     = aDebugEngine;
     iDebugEngineView = aDebugEngine.CreateView("CrashDebugger");
     //
     iTheCurrentProcess = new DProcess(this);
     iTheCurrentThread  = new DThread(this);
     iCodeSegs          = new CodeSegCollection(this);
     iInfoCpu           = new CpuInfo(this);
     iInfoFault         = new FaultInfo(this);
     iInfoScheduler     = new SchedulerInfo(this);
     iInfoDebugMask     = new DebugMaskInfo(this);
     //
     MakeEmptyContainers();
 }
Esempio n. 6
0
        public void UpdateSchedulerInfo(SchedulerInfo model)
        {
            //var Employee = context.Employees.Where(p => p.EmployeeId == model.Resources.EmployeeId);

            //if (Employee != null)
            //{
            //    context.Entry(model.Resources).State = EntityState.Modified;
            //    context.SaveChanges();
            //}
            //var ProjectNumber = context.ProjectNumbers.Where(p => p.ProjectNumberId == model.ProjectNumber.ProjectNumberId);
            //if (ProjectNumber != null)
            //{
            //    context.Entry(model.ProjectNumber).State = EntityState.Modified;
            //    context.SaveChanges();
            //}
            //var data = context.ProjectDevelopers.Where(p => p.ProjectDeveloperId == model.ProjectDeveloper.ProjectDeveloperId);
            //if (data != null)
            //{
            //    context.Entry(model.ProjectDeveloper).State = EntityState.Modified;
            //    context.SaveChanges();
            //}

            //var locData = context.ProjectManagers.Where(p => p.ProjectManagerId == model.ProjectManager.ProjectManagerId);
            //if (locData != null)
            //{
            //    context.Entry(model.ProjectDeveloper).State = EntityState.Modified;
            //    context.SaveChanges();
            //}

            //var listofval = context.ListOfValues.Where(p => p.Id == model.ListOfValue.Id);
            //if (listofval != null)
            //{
            //    context.Entry(model.ListOfValue).State = EntityState.Modified;
            //    context.SaveChanges();
            //}
            //var deptt = context.Departments.Where(p => p.DepartmentId == model.Departments.DepartmentId);
            //if (deptt != null)
            //{
            //    context.Entry(model.Departments).State = EntityState.Modified;
            //    context.SaveChanges();
            //}
        }
        private void PrepareMandatoryParagraph()
        {
            {
                SchedulerInfo info = CrashDebugger.InfoScheduler;

                ParserParagraph para = new ParserParagraph("SCHEDULER_INFO");
                //
                ParserLine l1 = ParserLine.NewSymFormat("SCHEDULER @%08x: CurrentThread %08x\r\n");
                l1.SetTargetProperties(info, "Address", "CurrentNThreadAddress");
                //
                ParserLine l2 = ParserLine.NewSymFormat("RescheduleNeeded=%02x DfcPending=%02x KernCSLocked=%08x\r\n");
                l2.SetTargetProperties(info, "RescheduleNeeded", "DfcPending", "KernCSLocked");
                //
                ParserLine l3 = ParserLine.NewSymFormat("DFCS: next %08x prev %08x\r\n");
                l3.SetTargetProperties(info.DFCs, "Next", "Previous");
                //
                ParserLine l4 = ParserLine.NewSymFormat("ProcessHandler=%08x, AddressSpace=%08x\r\n");
                l4.SetTargetProperties(info, "ProcessHandlerAddress", "AddressSpace");
                //
                ParserLine l5 = ParserLine.NewSymFormat("SYSLOCK: HoldingThread %08x iWaiting %08x\r\n");
                l5.SetTargetProperties(info.SysLockInfo, "HoldingThreadAddress", "WaitingThreadAddress");
                //
                ParserLine l6 = ParserLine.NewSymFormat("Extras 0: %08x 1: %08x 2: %08x 3: %08x\r\n");
                l6.SetTargetMethod(info.ExtraRegisters, "Add");
                //
                ParserLine l7 = ParserLine.NewSymFormat("Extras 4: %08x 5: %08x 6: %08x 7: %08x\r\n");
                l7.SetTargetMethod(info.ExtraRegisters, "Add");
                //
                ParserLine l8 = ParserLine.NewSymFormat("Extras 8: %08x 9: %08x A: %08x B: %08x\r\n");
                l8.SetTargetMethod(info.ExtraRegisters, "Add");
                //
                ParserLine l9 = ParserLine.NewSymFormat("Extras C: %08x D: %08x E: %08x F: %08x\r\n");
                l9.SetTargetMethod(info.ExtraRegisters, "Add");
                //
                para.Add(l1, l2, l3, l4, l5, l6, l7, l8, l9);
                ParserEngine.Add(para);
            }
        }
Esempio n. 8
0
        private void GetLockBefore()
        {
            var ftpMgr = _sign.Controller.Connection.FtpManager;//SFtpManager.Current;

            _waitForm.Info(Resource.GetString(Resource.Strings.UploadSchedulerConnectFTPServer));

            if (ftpMgr == null || !ftpMgr.IsConnected.HasValue || ftpMgr.IsConnected.Equals(false))
            {
                _waitForm.CancelFtp(Resource.GetString(Resource.Strings.UploadFtpServerDisConnection));
                return;
            }

            SchedulerInfo schedule = LibraryGroup.Current.Schedulers.GetByName(_scheduler.Name);

            _scheduleSaver.Item = schedule;

            _files.Clear();
            // delete old upload files
            LocalFilePathMapping.DeleteFiles();

            var task = _sign.Controller.FileManager.GetLock();

            _waitForm.Info(Resource.GetString(Resource.Strings.UploadGetLockStart));
        }
 public IEnumerable<AppointmentData> CreateRecurrenceException(SchedulerInfo schedulerInfo, AppointmentData recurrenceExceptionData)
 {
     return Controller.CreateRecurrenceException(schedulerInfo, recurrenceExceptionData);
 }
Esempio n. 10
0
        public static Future <ParseResult> ParseAsync(SignInfo sign, SchedulerInfo item)
        {
            var parser = new SchedulerParser(sign, item);

            return(Future.Create <ParseResult>(() => { return parser.Parse(); }));
        }
        public IEnumerable<AppointmentData> UpdateAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData)
        {
            if (appointmentData.ID == null)
                return Controller.InsertAppointment(schedulerInfo, appointmentData); //Inserts Or Updates the Appointment

            return Controller.UpdateAppointment(schedulerInfo, appointmentData);
        }
 public IEnumerable<AppointmentData> RemoveRecurrenceExceptions(SchedulerInfo schedulerInfo, AppointmentData masterAppointmentData)
 {
     return Controller.RemoveRecurrenceExceptions(schedulerInfo, masterAppointmentData);
 }
 public IEnumerable<AppointmentData> InsertAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData)
 {
     return Controller.InsertAppointment(schedulerInfo, appointmentData);
 }
 public IEnumerable<ResourceData> GetResources(SchedulerInfo schedulerInfo)
 {
     return Controller.GetResources(schedulerInfo);
 }
 public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo)
 {
     return Controller.GetAppointments(schedulerInfo);
 }
 public IEnumerable<AppointmentData> DeleteAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData, bool deleteSeries)
 {
     if (appointmentData.ID == null)
         return null;
     return Controller.DeleteAppointment(schedulerInfo, appointmentData, deleteSeries);
 }
Esempio n. 17
0
        public JsonModel GetSchedulerInfoList()
        {
            var employeeList   = context.Employees.ToList();
            var departmentList = context.Departments.Select(p => new ViewModelDepartments {
                DepartmentId = p.DepartmentId, DepartmentName = p.DepartmentName
            }).ToList();
            var locations = context.Locations.Select(p => new  ViewModelLocations {
                LocationId = p.LocationId, LocationName = p.LocationName
            }).ToList();
            var listOfValues   = context.ListOfValues.ToList();
            var projectNumbers = context.ProjectNumbers.Select(p => new ViewModelProjectNumber {
                ProjectNumberId = p.ProjectNumberId, ProjectNumber = p.ProjectNumber
            }).ToList();
            //var projectManager = context.ProjectManagers.ToList();
            var projectDeveloper = context.ProjectDevelopers.Select(p => new { p.ProjectDeveloperId, p.ProjectDeveloperName }).ToList();


            var clients = context.Clients.Select(p => new ViewModelClient {
                ClientId = p.ClientId, ClientName = p.ClientName, AddressLine1 = p.AddressLine1
            }).ToList();

            //var projectDeveloprLocationsdata = (from ep in context.XProjectDeveloperLocations
            //                                join p in context.Locations on ep.LocationId equals p.LocationId
            //                                join d in context.ProjectDevelopers on ep.ProjectDeveloperId equals d.ProjectDeveloperId
            //                                where ep.LocationId == p.LocationId && projectDeveloper.Select(p => p.ProjectDeveloperId).Contains(d.ProjectDeveloperId)
            //                                select new ProjectDeveloperLocations
            //                                {
            //                                    Children = null,
            //                                    Name = p.LocationName,
            //                                    Id = p.LocationId
            //                                }

            //                                ).Distinct().ToList();


            var projectDevelopr = (from ep in context.XProjectDeveloperLocations
                                   join p in context.Locations on ep.LocationId equals p.LocationId
                                   join d in context.ProjectDevelopers on ep.ProjectDeveloperId equals d.ProjectDeveloperId
                                   where ep.LocationId == p.LocationId
                                   select new ProjectDeveloperList
            {
                Name = d.ProjectDeveloperName,
                Id = d.ProjectDeveloperId,
                LocationId = p.LocationId
            }).Distinct().ToList();

            ProjectDeveloperLocations obj = new ProjectDeveloperLocations();

            var projectDeveloprLocations = (from ep in context.XProjectDeveloperLocations
                                            join p in context.Locations on ep.LocationId equals p.LocationId
                                            join d in context.ProjectDevelopers on ep.ProjectDeveloperId equals d.ProjectDeveloperId
                                            where ep.LocationId == p.LocationId && projectDeveloper.Select(p => p.ProjectDeveloperId).Contains(d.ProjectDeveloperId)
                                            select new ProjectDeveloperLocations
            {
                Children = projectDevelopr,
                Name = p.LocationName,
                Id = p.LocationId
            }
                                            ).Distinct().ToList();


            foreach (var x in projectDeveloprLocations)
            {
                x.Children = x.Children.Where(p => p.LocationId == x.Id).ToList();
            }


            var projectManagerList = (from ep in context.XProjectManagerLocations
                                      join p in context.Locations on ep.LocationId equals p.LocationId
                                      join d in context.ProjectManagers on ep.ProjectManagerID equals d.ProjectManagerID
                                      where ep.LocationId == p.LocationId
                                      select new ProjectManagerList
            {
                Name = d.ProjectManagerName,
                Id = d.ProjectManagerID,
                LocationId = p.LocationId
            }
                                      ).Distinct().ToList();


            var projectManagerLocations = (from ep in context.XProjectManagerLocations
                                           join p in context.Locations on ep.LocationId equals p.LocationId
                                           join d in context.XProjectManagerLocations on ep.ProjectManagerID equals d.ProjectManagerID
                                           where ep.LocationId == p.LocationId
                                           select new ProjectManagerLocations
            {
                Children = projectManagerList,
                Name = p.LocationName,
                Id = p.LocationId
            }
                                           ).Distinct().ToList();

            foreach (var x in  projectManagerLocations)
            {
                x.Children = x.Children.Where(p => p.LocationId == x.Id).ToList();
            }



            var schedularList = new SchedulerInfo {
                Resources = employeeList.Select(p => new Employee {
                    DepartmentId = p.DepartmentId, DisplayName = p.DisplayName, EmployeeId = p.EmployeeId, FirstName = p.FirstName, LastName = p.LastName
                }).ToList(),
                Departments = departmentList,
                Location    = locations,
                ListOfValue = listOfValues,
                Clients     = clients,
                // ProjectDeveloper = projectDeveloper.Select(p => new ProjectDeveloper { ProjectDeveloperId = p.ProjectDeveloperId, ProjectDeveloperName = p.ProjectDeveloperName }).ToList(),
                // ProjectManager = projectManager.Select(p => new ProjectManager { ProjectManagerId = p.ProjectManagerId, ProjectManagerName = p.ProjectManagerName }).ToList(),
                ProjectNumber             = projectNumbers,
                ProjectManagerLocations   = projectManagerLocations,
                ProjectDeveloperLocations = projectDeveloprLocations
            };


            //var listData = new JsonModel(
            //    schedularList,
            //    string.Empty,
            //   200,
            //   string.Empty
            //);
            //return listData;
            return(new JsonModel(schedularList, "", (int)Repository.ViewModel.HttpStatusCode.OK, ""));
        }
Esempio n. 18
0
        protected override void Render(HtmlBlock.Block html)
        {
            //Yes this is a hack, but there is no other way to insert
            //CSS in the correct spot
            html.Style(".metrics {margin-bottom:5px}");
            ClusterMetricsInfo clusterMetrics = new ClusterMetricsInfo(this.rm);

            Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> div = html.Div().$class("metrics"
                                                                                             );
            div.H3("Cluster Metrics").Table("#metricsoverview").Thead().$class("ui-widget-header"
                                                                               ).Tr().Th().$class("ui-state-default").("Apps Submitted").().Th().$class("ui-state-default"
                                                                                                                                                        ).("Apps Pending").().Th().$class("ui-state-default").("Apps Running").().Th().$class
                ("ui-state-default").("Apps Completed").().Th().$class("ui-state-default").("Containers Running"
                                                                                            ).().Th().$class("ui-state-default").("Memory Used").().Th().$class("ui-state-default"
                                                                                                                                                                ).("Memory Total").().Th().$class("ui-state-default").("Memory Reserved").().Th(
                ).$class("ui-state-default").("VCores Used").().Th().$class("ui-state-default").
            ("VCores Total").().Th().$class("ui-state-default").("VCores Reserved").().Th().
            $class("ui-state-default").("Active Nodes").().Th().$class("ui-state-default").(
                "Decommissioned Nodes").().Th().$class("ui-state-default").("Lost Nodes").().Th(
                ).$class("ui-state-default").("Unhealthy Nodes").().Th().$class("ui-state-default"
                                                                                ).("Rebooted Nodes").().().().Tbody().$class("ui-widget-content").Tr().Td(clusterMetrics
                                                                                                                                                          .GetAppsSubmitted().ToString()).Td(clusterMetrics.GetAppsPending().ToString()).Td
                (clusterMetrics.GetAppsRunning().ToString()).Td((clusterMetrics.GetAppsCompleted
                                                                     () + clusterMetrics.GetAppsFailed() + clusterMetrics.GetAppsKilled()).ToString()
                                                                ).Td(clusterMetrics.GetContainersAllocated().ToString()).Td(StringUtils.ByteDesc
                                                                                                                                (clusterMetrics.GetAllocatedMB() * BytesInMb)).Td(StringUtils.ByteDesc(clusterMetrics
                                                                                                                                                                                                       .GetTotalMB() * BytesInMb)).Td(StringUtils.ByteDesc(clusterMetrics.GetReservedMB
                                                                                                                                                                                                                                                               () * BytesInMb)).Td(clusterMetrics.GetAllocatedVirtualCores().ToString()).Td(clusterMetrics
                                                                                                                                                                                                                                                                                                                                            .GetTotalVirtualCores().ToString()).Td(clusterMetrics.GetReservedVirtualCores().
                                                                                                                                                                                                                                                                                                                                                                                   ToString()).Td().A(Url("nodes"), clusterMetrics.GetActiveNodes().ToString()).().
            Td().A(Url("nodes/decommissioned"), clusterMetrics.GetDecommissionedNodes().ToString
                       ()).().Td().A(Url("nodes/lost"), clusterMetrics.GetLostNodes().ToString()).().Td
                ().A(Url("nodes/unhealthy"), clusterMetrics.GetUnhealthyNodes().ToString()).().Td
                ().A(Url("nodes/rebooted"), clusterMetrics.GetRebootedNodes().ToString()).().().
            ().();
            string user = Request().GetRemoteUser();

            if (user != null)
            {
                UserMetricsInfo userMetrics = new UserMetricsInfo(this.rm, user);
                if (userMetrics.MetricsAvailable())
                {
                    div.H3("User Metrics for " + user).Table("#usermetricsoverview").Thead().$class("ui-widget-header"
                                                                                                    ).Tr().Th().$class("ui-state-default").("Apps Submitted").().Th().$class("ui-state-default"
                                                                                                                                                                             ).("Apps Pending").().Th().$class("ui-state-default").("Apps Running").().Th().$class
                        ("ui-state-default").("Apps Completed").().Th().$class("ui-state-default").("Containers Running"
                                                                                                    ).().Th().$class("ui-state-default").("Containers Pending").().Th().$class("ui-state-default"
                                                                                                                                                                               ).("Containers Reserved").().Th().$class("ui-state-default").("Memory Used").().
                    Th().$class("ui-state-default").("Memory Pending").().Th().$class("ui-state-default"
                                                                                      ).("Memory Reserved").().Th().$class("ui-state-default").("VCores Used").().Th()
                    .$class("ui-state-default").("VCores Pending").().Th().$class("ui-state-default"
                                                                                  ).("VCores Reserved").().().().Tbody().$class("ui-widget-content").Tr().Td(userMetrics
                                                                                                                                                             .GetAppsSubmitted().ToString()).Td(userMetrics.GetAppsPending().ToString()).Td(userMetrics
                                                                                                                                                                                                                                            .GetAppsRunning().ToString()).Td((userMetrics.GetAppsCompleted() + userMetrics.GetAppsFailed
                                                                                                                                                                                                                                                                                  () + userMetrics.GetAppsKilled()).ToString()).Td(userMetrics.GetRunningContainers
                                                                                                                                                                                                                                                                                                                                       ().ToString()).Td(userMetrics.GetPendingContainers().ToString()).Td(userMetrics.
                                                                                                                                                                                                                                                                                                                                                                                                           GetReservedContainers().ToString()).Td(StringUtils.ByteDesc(userMetrics.GetAllocatedMB
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           () * BytesInMb)).Td(StringUtils.ByteDesc(userMetrics.GetPendingMB() * BytesInMb)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ).Td(StringUtils.ByteDesc(userMetrics.GetReservedMB() * BytesInMb)).Td(userMetrics
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      .GetAllocatedVirtualCores().ToString()).Td(userMetrics.GetPendingVirtualCores().
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ToString()).Td(userMetrics.GetReservedVirtualCores().ToString()).().().();
                }
            }
            SchedulerInfo schedulerInfo = new SchedulerInfo(this.rm);

            div.H3("Scheduler Metrics").Table("#schedulermetricsoverview").Thead().$class("ui-widget-header"
                                                                                          ).Tr().Th().$class("ui-state-default").("Scheduler Type").().Th().$class("ui-state-default"
                                                                                                                                                                   ).("Scheduling Resource Type").().Th().$class("ui-state-default").("Minimum Allocation"
                                                                                                                                                                                                                                      ).().Th().$class("ui-state-default").("Maximum Allocation").().().().Tbody().$class
                ("ui-widget-content").Tr().Td(schedulerInfo.GetSchedulerType().ToString()).Td(schedulerInfo
                                                                                              .GetSchedulerResourceTypes().ToString()).Td(schedulerInfo.GetMinAllocation().ToString
                                                                                                                                              ()).Td(schedulerInfo.GetMaxAllocation().ToString()).().().();
            div.();
        }