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 CODE:
        if (field.type == TType.I32) {
          this.code = iprot.readI32();
          this.__isset_code = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case LEADER:
        if (field.type == TType.STRUCT) {
          this.leader = new t_nebula.HostAddr();
          this.leader?.read(iprot);
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case KILLED_QUERIES:
        if (field.type == TType.MAP) {
          {
            TMap _map354 = iprot.readMapBegin();
            this.killed_queries = new Map<int, Map<int, QueryDesc>>();
            for (int _i355 = 0; _i355 < _map354.length; ++_i355) {
              int _key356;
              Map<int, QueryDesc> _val357;
              _key356 = iprot.readI64();
              {
                TMap _map358 = iprot.readMapBegin();
                _val357 = new Map<int, QueryDesc>();
                for (int _i359 = 0; _i359 < _map358.length; ++_i359) {
                  int _key360;
                  QueryDesc _val361;
                  _key360 = iprot.readI64();
                  _val361 = new QueryDesc();
                  _val361.read(iprot);
                  _val357[_key360] = _val361;
                }
                iprot.readMapEnd();
              }
              this.killed_queries?[_key356] = _val357;
            }
            iprot.readMapEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case KILLED_SESSIONS:
        if (field.type == TType.LIST) {
          {
            TList _list362 = iprot.readListBegin();
            this.killed_sessions = <int>[];
            for (int _i363 = 0; _i363 < _list362.length; ++_i363) {
              int _elem364;
              _elem364 = iprot.readI64();
              this.killed_sessions?.add(_elem364);
            }
            iprot.readListEnd();
          }
        } 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
  validate();
}