/////////////////////////////////////// // 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); } } }
////////////////////////////////////////////// // 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); } } }
public void Write(float? @object, DataOutput stream) { bool isNull = @object == null; stream.WriteBoolean(isNull); if (!isNull) { stream.WriteFloat(@object.Value); } }
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); } }
// 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); }
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); } }
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); } } }
public void Write(float @object, DataOutput stream) { stream.WriteFloat(@object); }
public override void Write(float @object, DataOutput output, byte[] pageFullKey, EventBeanCollatedWriter writer) { output.WriteFloat(@object); }