예제 #1
0
 ///////////////////////////////////////
 // Writable
 ///////////////////////////////////////
 /// <exception cref="System.IO.IOException"/>
 public virtual void Write(DataOutput @out)
 {
     lock (this)
     {
         jobid.Write(@out);
         @out.WriteFloat(setupProgress);
         @out.WriteFloat(mapProgress);
         @out.WriteFloat(reduceProgress);
         @out.WriteFloat(cleanupProgress);
         WritableUtils.WriteEnum(@out, runState);
         @out.WriteLong(startTime);
         Text.WriteString(@out, user);
         WritableUtils.WriteEnum(@out, priority);
         Text.WriteString(@out, schedulingInfo);
         @out.WriteLong(finishTime);
         @out.WriteBoolean(isRetired);
         Text.WriteString(@out, historyFile);
         Text.WriteString(@out, jobName);
         Text.WriteString(@out, trackingUrl);
         Text.WriteString(@out, jobFile);
         @out.WriteBoolean(isUber);
         // Serialize the job's ACLs
         @out.WriteInt(jobACLs.Count);
         foreach (KeyValuePair <JobACL, AccessControlList> entry in jobACLs)
         {
             WritableUtils.WriteEnum(@out, entry.Key);
             entry.Value.Write(@out);
         }
     }
 }
예제 #2
0
 //////////////////////////////////////////////
 // Writable
 //////////////////////////////////////////////
 /// <exception cref="System.IO.IOException"/>
 public virtual void Write(DataOutput @out)
 {
     taskid.Write(@out);
     @out.WriteFloat(progress);
     Text.WriteString(@out, state);
     @out.WriteLong(startTime);
     @out.WriteLong(finishTime);
     WritableUtils.WriteStringArray(@out, diagnostics);
     counters.Write(@out);
     WritableUtils.WriteEnum(@out, currentStatus);
     if (currentStatus == TIPStatus.Running)
     {
         WritableUtils.WriteVInt(@out, runningAttempts.Count);
         TaskAttemptID[] t = new TaskAttemptID[0];
         t = Sharpen.Collections.ToArray(runningAttempts, t);
         for (int i = 0; i < t.Length; i++)
         {
             t[i].Write(@out);
         }
     }
     else
     {
         if (currentStatus == TIPStatus.Complete)
         {
             successfulAttempt.Write(@out);
         }
     }
 }
예제 #3
0
        public void Write(float? @object, DataOutput stream)
        {
            bool isNull = @object == null;

            stream.WriteBoolean(isNull);
            if (!isNull)
            {
                stream.WriteFloat(@object.Value);
            }
        }
예제 #4
0
 private void WriteArray(float[] array, DataOutput output)
 {
     if (array == null)
     {
         output.WriteInt(-1);
         return;
     }
     output.WriteInt(array.Length);
     foreach (float i in array)
     {
         output.WriteFloat(i);
     }
 }
 private void WriteInternal(float[] @object, DataOutput output)
 {
     if (@object == null)
     {
         output.WriteInt(-1);
         return;
     }
     output.WriteInt(@object.Length);
     foreach (float i in @object)
     {
         output.WriteFloat(i);
     }
 }
예제 #6
0
 // Shouldn't happen since we do implement Clonable
 //////////////////////////////////////////////
 // Writable
 //////////////////////////////////////////////
 /// <exception cref="System.IO.IOException"/>
 public virtual void Write(DataOutput @out)
 {
     taskid.Write(@out);
     @out.WriteFloat(progress);
     @out.WriteInt(numSlots);
     WritableUtils.WriteEnum(@out, runState);
     Text.WriteString(@out, diagnosticInfo);
     Text.WriteString(@out, stateString);
     WritableUtils.WriteEnum(@out, phase);
     @out.WriteLong(startTime);
     @out.WriteLong(finishTime);
     @out.WriteBoolean(includeAllCounters);
     @out.WriteLong(outputSize);
     counters.Write(@out);
     nextRecordRange.Write(@out);
 }
예제 #7
0
        public void ToData(DataOutput output)
        {
            output.WriteDouble(double_field);
            output.WriteFloat(float_field);
            output.WriteInt64(long_field);
            output.WriteInt32(int_field);
            output.WriteInt16(short_field);
            output.WriteUTF(string_field);
            int itemCount = string_vector.Count;

            output.WriteInt32(itemCount);
            for (int idx = 0; idx < itemCount; idx++)
            {
                string s = (string)string_vector[idx];
                output.WriteUTF(s);
            }
        }
예제 #8
0
        public void Float()
        {
            List <Dictionary <string, string> > testfloats = settings.GetValues(MethodBase.GetCurrentMethod(), "float");

            if (testfloats != null)
            {
                foreach (Dictionary <string, string> dEntry in testfloats)
                {
                    DataOutput dataOutput = new DataOutput();
                    float      testfloat  = float.Parse(dEntry["value"]);
                    dataOutput.WriteFloat(testfloat);
                    byte[] buffer        = dataOutput.GetBuffer();
                    byte[] expectedBytes = Util.String2Bytes(dEntry["bytes"]);
                    Util.CompareTestArrays(expectedBytes, buffer);

                    DataInput dataInput = new DataInput(buffer);
                    float     result    = dataInput.ReadFloat();
                    Assert.AreEqual(testfloat, result);
                }
            }
        }
예제 #9
0
 public void Write(float @object, DataOutput stream)
 {
     stream.WriteFloat(@object);
 }
예제 #10
0
 public override void Write(float @object, DataOutput output, byte[] pageFullKey, EventBeanCollatedWriter writer)
 {
     output.WriteFloat(@object);
 }