@Override
 public void readFields(DataInput in) throws IOException {
   progress = in.readFloat();
   if (in.readBoolean()) {
     tezCounters = new TezCounters();
     tezCounters.readFields(in);
   }
   if (in.readBoolean()) {
     statistics = new TaskStatistics();
     statistics.readFields(in);
   }
 }
 @Override
 public void write(DataOutput out) throws IOException {
   out.writeFloat(progress);
   if (tezCounters != null) {
     out.writeBoolean(true);
     tezCounters.write(out);
   } else {
     out.writeBoolean(false);
   }
   if (statistics != null) {
     out.writeBoolean(true);
     statistics.write(out);
   } else {
     out.writeBoolean(false);
   }
 }