| 1568 | } |
| 1569 | |
| 1570 | func (p *TRegionReplicaSet) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { |
| 1571 | _, size, err := iprot.ReadListBegin(ctx) |
| 1572 | if err != nil { |
| 1573 | return thrift.PrependError("error reading list begin: ", err) |
| 1574 | } |
| 1575 | tSlice := make([]*TDataNodeLocation, 0, size) |
| 1576 | p.DataNodeLocations = tSlice |
| 1577 | for i := 0; i < size; i ++ { |
| 1578 | _elem2 := &TDataNodeLocation{} |
| 1579 | if err := _elem2.Read(ctx, iprot); err != nil { |
| 1580 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) |
| 1581 | } |
| 1582 | p.DataNodeLocations = append(p.DataNodeLocations, _elem2) |
| 1583 | } |
| 1584 | if err := iprot.ReadListEnd(ctx); err != nil { |
| 1585 | return thrift.PrependError("error reading list end: ", err) |
| 1586 | } |
| 1587 | return nil |
| 1588 | } |
| 1589 | |
| 1590 | func (p *TRegionReplicaSet) Write(ctx context.Context, oprot thrift.TProtocol) error { |
| 1591 | if err := oprot.WriteStructBegin(ctx, "TRegionReplicaSet"); err != nil { |