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_NAME:
if (field.type == TType.STRING) {
this.space_name = iprot.readBinary();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case PARTITION_NUM:
if (field.type == TType.I32) {
this.partition_num = iprot.readI32();
this.__isset_partition_num = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case REPLICA_FACTOR:
if (field.type == TType.I32) {
this.replica_factor = iprot.readI32();
this.__isset_replica_factor = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case CHARSET_NAME:
if (field.type == TType.STRING) {
this.charset_name = iprot.readBinary();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case COLLATE_NAME:
if (field.type == TType.STRING) {
this.collate_name = iprot.readBinary();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case VID_TYPE:
if (field.type == TType.STRUCT) {
this.vid_type = new ColumnTypeDef();
this.vid_type?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case ZONE_NAMES:
if (field.type == TType.LIST) {
{
TList _list4 = iprot.readListBegin();
this.zone_names = <Int8List>[];
for (int _i5 = 0; _i5 < _list4.length; ++_i5) {
Int8List _elem6;
_elem6 = iprot.readBinary();
this.zone_names?.add(_elem6);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case ISOLATION_LEVEL:
if (field.type == TType.I32) {
this.isolation_level = iprot.readI32();
this.__isset_isolation_level = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case COMMENT:
if (field.type == TType.STRING) {
this.comment = iprot.readBinary();
} 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();
}