예제 #1
0
        /// <summary>
        /// Create a cluster browser object which stores the databases in the specified directory.
        /// </summary>
        public ClusterBrowser()
        {
            this.InitializeComponent();
            this.status = new StatusWriter(this.statuslabel, this.statusStrip, this.Status);

            BackgroundWorker queueWorker = new BackgroundWorker();
            this.queue = new BackgroundWorkQueue(queueWorker, null, null);

            this.completeJobsList = new List<ClusterJobInformation>();
            this.refreshTimer = new Timer();
            this.refreshTimer.Interval = 30000; // 30 seconds
            this.refreshTimer.Tick += this.refreshTimer_Tick;
            this.toolStripMenuItem_job.Enabled = false;

            this.clusterJobs = new DGVData<ClusterJobInformation>();
            this.filteredDataGridView.SetDataSource(this.clusterJobs);
            this.filteredDataGridView.DataGridView.Columns["IsUnavailable"].Visible = false;
            this.filteredDataGridView.DataGridView.Columns["Cluster"].Visible = false;
            this.filteredDataGridView.DataGridView.Columns["Name"].FillWeight = 50;
            this.filteredDataGridView.DataGridView.Columns["Status"].FillWeight = 10;
            this.filteredDataGridView.ViewChanged += this.filteredDataGridView_ViewChanged;

            #region TOOLTIPS
            //ToolTip help = new ToolTip();
            //help.SetToolTip(this.combo_cluster, "Cluster whose jobs are visualized (or a \"Cache\" cluster with previously seen data).");
            //help.SetToolTip(this.autoRefreshToolStripMenuItem, "Select to refresh the cluster view every 30 seconds.");
            #endregion

            this.Status("Please pick a cluster.", StatusKind.OK);
        }
예제 #2
0
파일: JobBrowser.cs 프로젝트: pszmyd/Dryad
        /// <summary>
        /// Initialize a job browser for a specified job.
        /// </summary>
        /// <param name="job">Job to display.</param>
        public JobBrowser(DryadLinqJobInfo job)
        {
            this.doingStartup = true;
            this.InitializeComponent();

            this.queueWorker = new BackgroundWorker();
            this.queue = new BackgroundWorkQueue(this.queueWorker, this.toolStripStatusLabel_currentWork, this.toolStripStatusLabel_backgroundWork);

            this.WarnedAboutDebugging = false;
            this.status = new StatusWriter(this.toolStripStatusLabel, this.statusStrip, this.Status);

            this.refreshTimer = new System.Windows.Forms.Timer();
            this.refreshTimer.Interval = 30000; // 30 seconds
            this.refreshTimer.Tick += this.refreshTimer_Tick;

            #region SET_JOB_HEADER
            this.jobHeaderData = new BindingListSortable<PropertyEnumerator<DryadLinqJobInfo>.PropertyValue>();
            this.dataGridView_jobHeader.DataSource = this.jobHeaderData;
            this.SetDataGridViewColumnsSize(this.dataGridView_jobHeader);
            this.jobPropertyEnumerator = new PropertyEnumerator<DryadLinqJobInfo>();
            this.jobPropertyEnumerator.ValueFormatter = this.PropertyValueFormatter;
            List<string> jobPropertiesToSkip = new List<string>
            {
                "ClusterConfiguration", "Processes", "Vertices", "JM", "Name", 
                "JobManagerVertex", "JMStdoutIncomplete", "JobInfoCannotBeCollected"
            };

            this.jobPropertyEnumerator.Skip(jobPropertiesToSkip);
            this.jobPropertyEnumerator.Expand("Summary");
            #endregion

            #region SET_STAGE_HEADER
            this.stageHeaderData = new BindingListSortable<PropertyEnumerator<DryadLinqJobStage>.PropertyValue>();
            this.stagePropertyEnumerator = new PropertyEnumerator<DryadLinqJobStage>();
            this.stagePropertyEnumerator.ValueFormatter = this.PropertyValueFormatter;
            List<string> stagePropertiesToSkip = new List<string> 
            {
                "Vertices", "Name"
            };
            this.stagePropertyEnumerator.Skip(stagePropertiesToSkip);

            this.tableHeaderData = new BindingListSortable<PropertyEnumerator<StaticPartitionedTableInformation>.PropertyValue>();
            this.tablePropertyEnumerator = new PropertyEnumerator<StaticPartitionedTableInformation>();
            this.tablePropertyEnumerator.ValueFormatter = this.PropertyValueFormatter;
            this.tablePropertyEnumerator.Skip("Partitions", "Header", "Code");

            this.SetNoStageOrTable("", false);
            #endregion

            #region SET_STAGE_DATA
            this.stageData = new BindingListSortable<ExecutedVertexInstance>();
            this.tablePartitionsData = new BindingListSortable<StaticPartitionedTableInformation.StaticPartitionInformation>();
            #endregion

            #region SET_VERTEX_HEADER
            this.vertexHeaderData = new BindingListSortable<PropertyEnumerator<ExecutedVertexInstance>.PropertyValue>();
            this.dataGridView_vertexHeader.DataSource = this.vertexHeaderData;
            this.SetDataGridViewColumnsSize(this.dataGridView_vertexHeader);
            this.vertexPropertyEnumerator = new PropertyEnumerator<ExecutedVertexInstance>();
            this.vertexPropertyEnumerator.ValueFormatter = this.PropertyValueFormatter;
            List<string> vertexPropertiesToSkip = new List<string>
            {
                "JobSummary", "InputChannels", "OutputChannels", "Name", "LogFilesPattern", "IsManager"
            };
            this.vertexPropertyEnumerator.Skip(vertexPropertiesToSkip);
            #endregion

            // Disable the vertex context menu, since none of these operatios work at this point
            this.contextMenu_stageVertex.Enabled = false;

            this.plansHaveBeenBuilt = false;
            this.graphViewer = new Msagl.GraphViewerGdi.GViewer();
            this.graphViewer.Dock = DockStyle.Fill;
            this.graphViewer.NavigationVisible = false;
            this.graphViewer.ToolBarIsVisible = false;
            this.graphViewer.MouseClick += this.graphViewer_MouseClick;
            this.graphViewer.MouseDoubleClick += this.graphViewer_MouseDoubleClick;
            this.graphViewer.InsertingEdge = false;
            this.staticGraphZoomLevel = 0;

            this.planDrawSurface = new DrawingSurface2D(this.panel_jobSchedule);
            this.planDrawSurface.SetMargins(4, 4, 4, 4);
            this.panel_jobSchedule.MouseDoubleClick += this.panel_jobSchedule_MouseDoubleClick;
            this.planDrawSurface.FastDrawing = false;
            this.colorByStagestatusToolStripMenuItem.Checked = true;

            this.defaultBackColor = this.label_job.BackColor;
            this.planVisible = PlanVisible.None;

            this.linkCache = new Dictionary<string, IClusterResidentObject>();
            this.mouseIsHeld = false;
            this.draggingMouse = false;
            this.drawingSurfaceSize = 0.0;

            #region TOOLTIPS
            ToolTip help = new ToolTip();
            help.SetToolTip(this.richTextBox_file, "Click on links to follow; control-click to open in explorer; alt-click to follow an input channel to its source.");
            help.SetToolTip(this.panel_scheduleContainer, "Displays the job schedule; click to select.");
            help.SetToolTip(this.checkBox_refresh, "Refreshes the job status ever 30s.");
            help.SetToolTip(this.graphViewer, "Click to select stages; Ctrl +/- to zoom.");
            help.SetToolTip(this.dataGridView_jobHeader, "Selecting some rows filters the data.");
            help.SetToolTip(this.comboBox_plan, "Display the job plan in various forms.");
            help.SetToolTip(this.comboBox_vertexInformation, "Display more information about the vertex.");
            help.SetToolTip(this.label_job, "Global job information.");
            help.SetToolTip(this.label_stage, "Information about the selected stage/table. Select rows for filtering.");
            help.SetToolTip(this.label_Vertex, "Information about the selected vertex.");
            help.SetToolTip(this.panel_jobSchedule, "Click on the stages or tables for more information; drag to zoom.");
            help.SetToolTip(this.textBox_stageCode, "Code executed by the selected stage.");
            help.SetToolTip(this.textBox_find, "Type a string to find.");
            help.SetToolTip(this.button_clearFind, "Stop finding.");
            help.SetToolTip(this.button_filter, "Show only lines matching string to find (case-sensitive).");
            help.SetToolTip(this.button_findNext, "Find next occurence of string.");
            help.SetToolTip(this.button_findPrev, "Find previous occurence of string.");
            help.SetToolTip(this.label_title, "File currently displayed.");
            #endregion

            this.Job = job;
        }