read method

void read(
  1. TProtocol iprot
)
override

Reads the TObject from the given input protocol.

Implementation

read(TProtocol iprot) {
  TField field;
  iprot.readStructBegin();
  while (true) {
    field = iprot.readFieldBegin();
    if (field.type == TType.STOP) {
      break;
    }
    switch (field.id) {
      case ROWS:
        if (field.type == TType.I64) {
          this.rows = iprot.readI64();
          this.__isset_rows = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case EXEC_DURATION_IN_US:
        if (field.type == TType.I64) {
          this.exec_duration_in_us = iprot.readI64();
          this.__isset_exec_duration_in_us = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case TOTAL_DURATION_IN_US:
        if (field.type == TType.I64) {
          this.total_duration_in_us = iprot.readI64();
          this.__isset_total_duration_in_us = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case OTHER_STATS:
        if (field.type == TType.MAP) {
          {
            TMap _map0 = iprot.readMapBegin();
            this.other_stats = new Map<Int8List, Int8List>();
            for (int _i1 = 0; _i1 < _map0.length; ++_i1) {
              Int8List _key2;
              Int8List _val3;
              _key2 = iprot.readBinary();
              _val3 = iprot.readBinary();
              this.other_stats?[_key2] = _val3;
            }
            iprot.readMapEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      default:
        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
  if (!__isset_rows) {
    throw new TProtocolError(
        TProtocolErrorType.UNKNOWN,
        "Required field 'rows' was not found in serialized data! Struct: " +
            toString());
  }

  if (!__isset_exec_duration_in_us) {
    throw new TProtocolError(
        TProtocolErrorType.UNKNOWN,
        "Required field 'exec_duration_in_us' was not found in serialized data! Struct: " +
            toString());
  }

  if (!__isset_total_duration_in_us) {
    throw new TProtocolError(
        TProtocolErrorType.UNKNOWN,
        "Required field 'total_duration_in_us' was not found in serialized data! Struct: " +
            toString());
  }

  validate();
}