read method
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 FAILED_PARTS:
if (field.type == TType.LIST) {
{
TList _list0 = iprot.readListBegin();
this.failed_parts = <PartitionResult>[];
for (int _i1 = 0; _i1 < _list0.length; ++_i1) {
PartitionResult _elem2;
_elem2 = new PartitionResult();
_elem2.read(iprot);
this.failed_parts?.add(_elem2);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case LATENCY_IN_US:
if (field.type == TType.I64) {
this.latency_in_us = iprot.readI64();
this.__isset_latency_in_us = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case LATENCY_DETAIL_US:
if (field.type == TType.MAP) {
{
TMap _map3 = iprot.readMapBegin();
this.latency_detail_us = <String, int>{};
for (int _i4 = 0; _i4 < _map3.length; ++_i4) {
String _key5;
int _val6;
_key5 = iprot.readString();
_val6 = iprot.readI32();
this.latency_detail_us?[_key5] = _val6;
}
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_latency_in_us) {
throw new TProtocolError(TProtocolErrorType.UNKNOWN,
"Required field 'latency_in_us' was not found in serialized data! Struct: ${toString()}");
}
validate();
}