Ejemplo n.º 1
0
  public void write(TProtocol oprot) throws TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.trackers != null) {
      oprot.writeFieldBegin(TRACKERS_FIELD_DESC);
      {
        oprot.writeListBegin(new TList(TType.STRUCT, this.trackers.size()));
        for (ThriftTaskTrackerStatus _iter42 : this.trackers) {
          _iter42.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }
Ejemplo n.º 2
0
  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      _Fields fieldId = _Fields.findByThriftId(field.id);
      if (fieldId == null) {
        TProtocolUtil.skip(iprot, field.type);
      } else {
        switch (fieldId) {
          case TRACKERS:
            if (field.type == TType.LIST) {
              {
                TList _list39 = iprot.readListBegin();
                this.trackers = new ArrayList<ThriftTaskTrackerStatus>(_list39.size);
                for (int _i40 = 0; _i40 < _list39.size; ++_i40) {
                  ThriftTaskTrackerStatus _elem41;
                  _elem41 = new ThriftTaskTrackerStatus();
                  _elem41.read(iprot);
                  this.trackers.add(_elem41);
                }
                iprot.readListEnd();
              }
            } else {
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
        }
        iprot.readFieldEnd();
      }
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
  }