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 SPACE_ID:
if (field.type == TType.I32) {
this.space_id = iprot.readI32();
this.__isset_space_id = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case PARTS:
if (field.type == TType.MAP) {
{
TMap _map220 = iprot.readMapBegin();
this.parts = <int, ScanCursor>{};
for (int _i221 = 0; _i221 < _map220.length; ++_i221) {
int _key222;
ScanCursor _val223;
_key222 = iprot.readI32();
_val223 = new ScanCursor();
_val223.read(iprot);
this.parts?[_key222] = _val223;
}
iprot.readMapEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case RETURN_COLUMNS:
if (field.type == TType.LIST) {
{
TList _list224 = iprot.readListBegin();
this.return_columns = <VertexProp>[];
for (int _i225 = 0; _i225 < _list224.length; ++_i225) {
VertexProp _elem226;
_elem226 = new VertexProp();
_elem226.read(iprot);
this.return_columns?.add(_elem226);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case LIMIT:
if (field.type == TType.I64) {
this.limit = iprot.readI64();
this.__isset_limit = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case START_TIME:
if (field.type == TType.I64) {
this.start_time = iprot.readI64();
this.__isset_start_time = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case END_TIME:
if (field.type == TType.I64) {
this.end_time = iprot.readI64();
this.__isset_end_time = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case FILTER:
if (field.type == TType.STRING) {
this.filter = iprot.readBinary();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case ONLY_LATEST_VERSION:
if (field.type == TType.BOOL) {
this.only_latest_version = iprot.readBool();
this.__isset_only_latest_version = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case ENABLE_READ_FROM_FOLLOWER:
if (field.type == TType.BOOL) {
this.enable_read_from_follower = iprot.readBool();
this.__isset_enable_read_from_follower = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case COMMON:
if (field.type == TType.STRUCT) {
this.common = new RequestCommon();
this.common?.read(iprot);
} 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();
}