Exemple #1
0
 /// <exception cref="System.IO.IOException"/>
 public virtual void ReadFields(DataInput @in)
 {
     this.taskid.ReadFields(@in);
     this.progress   = @in.ReadFloat();
     this.state      = StringInterner.WeakIntern(Text.ReadString(@in));
     this.startTime  = @in.ReadLong();
     this.finishTime = @in.ReadLong();
     diagnostics     = WritableUtils.ReadStringArray(@in);
     counters        = new Counters();
     counters.ReadFields(@in);
     currentStatus = WritableUtils.ReadEnum <TIPStatus>(@in);
     if (currentStatus == TIPStatus.Running)
     {
         int num = WritableUtils.ReadVInt(@in);
         for (int i = 0; i < num; i++)
         {
             TaskAttemptID t = new TaskAttemptID();
             t.ReadFields(@in);
             runningAttempts.AddItem(t);
         }
     }
     else
     {
         if (currentStatus == TIPStatus.Complete)
         {
             successfulAttempt.ReadFields(@in);
         }
     }
 }
Exemple #2
0
 /// <summary>Creates a new TaskReport object</summary>
 /// <param name="taskid"/>
 /// <param name="progress"/>
 /// <param name="state"/>
 /// <param name="diagnostics"/>
 /// <param name="currentStatus"/>
 /// <param name="startTime"/>
 /// <param name="finishTime"/>
 /// <param name="counters"/>
 public TaskReport(TaskID taskid, float progress, string state, string[] diagnostics
                   , TIPStatus currentStatus, long startTime, long finishTime, Counters counters)
 {
     this.taskid        = taskid;
     this.progress      = progress;
     this.state         = state;
     this.diagnostics   = diagnostics;
     this.currentStatus = currentStatus;
     this.startTime     = startTime;
     this.finishTime    = finishTime;
     this.counters      = counters;
 }
Exemple #3
0
 /// <summary>
 /// Display the information about a job's tasks, of a particular type and
 /// in a particular state
 /// </summary>
 /// <param name="job">the job</param>
 /// <param name="type">the type of the task (map/reduce/setup/cleanup)</param>
 /// <param name="state">
 /// the state of the task
 /// (pending/running/completed/failed/killed)
 /// </param>
 /// <exception cref="System.IO.IOException"/>
 /// <exception cref="System.Exception"/>
 protected internal virtual void DisplayTasks(Job job, string type, string state)
 {
     TaskReport[] reports = job.GetTaskReports(TaskType.ValueOf(StringUtils.ToUpperCase
                                                                    (type)));
     foreach (TaskReport report in reports)
     {
         TIPStatus status = report.GetCurrentStatus();
         if ((Sharpen.Runtime.EqualsIgnoreCase(state, "pending") && status == TIPStatus.Pending
              ) || (Sharpen.Runtime.EqualsIgnoreCase(state, "running") && status == TIPStatus.
                    Running) || (Sharpen.Runtime.EqualsIgnoreCase(state, "completed") && status == TIPStatus
                                 .Complete) || (Sharpen.Runtime.EqualsIgnoreCase(state, "failed") && status == TIPStatus
                                                .Failed) || (Sharpen.Runtime.EqualsIgnoreCase(state, "killed") && status == TIPStatus
                                                             .Killed))
         {
             PrintTaskAttempts(report);
         }
     }
 }
Exemple #4
0
 /// <summary>Creates a new TaskReport object</summary>
 /// <param name="taskid"/>
 /// <param name="progress"/>
 /// <param name="state"/>
 /// <param name="diagnostics"/>
 /// <param name="currentStatus"/>
 /// <param name="startTime"/>
 /// <param name="finishTime"/>
 /// <param name="counters"/>
 internal TaskReport(TaskID taskid, float progress, string state, string[] diagnostics
                     , TIPStatus currentStatus, long startTime, long finishTime, Counters counters)
     : base(taskid, progress, state, diagnostics, currentStatus, startTime, finishTime
            , new Counters(counters))
 {
 }
Exemple #5
0
        public bool OpenPXEImageFromMemoryWithTIP(MemoryStream pxeFile, MemoryStream tipPXEFile, ref TIPStatus tipStatus)
        {
            byte[] pxeData = new byte[pxeFile.Length];

            using (BinaryReader r = new BinaryReader(pxeFile))
            {
                // Read data from Test.data.
                pxeData = r.ReadBytes((int)pxeFile.Length);
            }

            buffersAvailable.Clear();

            byte[] tipPXEData = new byte[tipPXEFile.Length];

            using (BinaryReader r = new BinaryReader(tipPXEFile))
            {
                // Read data from Test.data.
                tipPXEData = r.ReadBytes((int)tipPXEFile.Length);
            }

            buffersAvailable.Clear();

            pxeHeader = OpenAndProcessPXEImageFromMemoryWithTIP(pxeData, (int)pxeData.Length, tipPXEData, (int)tipPXEData.Length, ref tipStatus);

            if (pxeHeader.isValidFile != 1)
            {
                ClearActiveBagBuffer();
                return(false);
            }

            LoadPXEData();

            ClearActiveBagBuffer();
            CloseActiveBag();

            tipPXEFile.Close();
            tipPXEFile.Dispose();

            pxeFile.Close();
            pxeFile.Dispose();

            return(true);
        }
Exemple #6
0
 public static extern PXEHeader OpenAndProcessPXEImageFromMemoryWithTIP(byte[] pxeData, int memSize, byte[] tipPXEData, int tipDataMemSize, ref TIPStatus ts);
Exemple #7
0
        public bool OpenPXEImageFromMemoryWithTIP(MemoryStream pxeFile, MemoryStream tipPXEFile, ref TIPStatus tipStatus)
        {
            byte[] pxeData = new byte[pxeFile.Length];

            using (BinaryReader r = new BinaryReader(pxeFile))
            {
                // Read data from Test.data.
                pxeData = r.ReadBytes((int)pxeFile.Length);
            }

            buffersAvailable.Clear();

            byte[] tipPXEData = new byte[tipPXEFile.Length];

            using (BinaryReader r = new BinaryReader(tipPXEFile))
            {
                // Read data from Test.data.
                tipPXEData = r.ReadBytes((int)tipPXEFile.Length);
            }

            buffersAvailable.Clear(); 
            
            pxeHeader = OpenAndProcessPXEImageFromMemoryWithTIP(pxeData, (int)pxeData.Length, tipPXEData, (int)tipPXEData.Length, ref tipStatus);

            if (pxeHeader.isValidFile != 1)
            {
                ClearActiveBagBuffer();
                return false;
            }

            LoadPXEData();

            ClearActiveBagBuffer();
            CloseActiveBag();

            tipPXEFile.Close();
            tipPXEFile.Dispose();

            pxeFile.Close();
            pxeFile.Dispose();

            return true;
        }
Exemple #8
0
 public static extern PXEHeader OpenAndProcessPXEImageFromMemoryWithTIP(byte[] pxeData, int memSize, byte[] tipPXEData, int tipDataMemSize, ref TIPStatus ts);