MCPcopy Create free account
hub / github.com/apache/iotdb-client-go / Read

Method Read

common/common.go:1844–1915  ·  view source on GitHub ↗
(ctx context.Context, iprot thrift.TProtocol)

Source from the content-addressed store, hash-verified

1842}
1843
1844func (p *TConfigNodeLocation) Read(ctx context.Context, iprot thrift.TProtocol) error {
1845 if _, err := iprot.ReadStructBegin(ctx); err != nil {
1846 return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
1847 }
1848
1849 var issetConfigNodeId bool = false;
1850 var issetInternalEndPoint bool = false;
1851 var issetConsensusEndPoint bool = false;
1852
1853 for {
1854 _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
1855 if err != nil {
1856 return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
1857 }
1858 if fieldTypeId == thrift.STOP { break; }
1859 switch fieldId {
1860 case 1:
1861 if fieldTypeId == thrift.I32 {
1862 if err := p.ReadField1(ctx, iprot); err != nil {
1863 return err
1864 }
1865 issetConfigNodeId = true
1866 } else {
1867 if err := iprot.Skip(ctx, fieldTypeId); err != nil {
1868 return err
1869 }
1870 }
1871 case 2:
1872 if fieldTypeId == thrift.STRUCT {
1873 if err := p.ReadField2(ctx, iprot); err != nil {
1874 return err
1875 }
1876 issetInternalEndPoint = true
1877 } else {
1878 if err := iprot.Skip(ctx, fieldTypeId); err != nil {
1879 return err
1880 }
1881 }
1882 case 3:
1883 if fieldTypeId == thrift.STRUCT {
1884 if err := p.ReadField3(ctx, iprot); err != nil {
1885 return err
1886 }
1887 issetConsensusEndPoint = true
1888 } else {
1889 if err := iprot.Skip(ctx, fieldTypeId); err != nil {
1890 return err
1891 }
1892 }
1893 default:
1894 if err := iprot.Skip(ctx, fieldTypeId); err != nil {
1895 return err
1896 }
1897 }
1898 if err := iprot.ReadFieldEnd(ctx); err != nil {
1899 return err
1900 }
1901 }

Callers 1

ReadField1Method · 0.95

Calls 3

ReadField1Method · 0.95
ReadField2Method · 0.95
ReadField3Method · 0.95

Tested by

no test coverage detected