github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/cdc/redo/common/redo_meta_gen.go (about) 1 package common 2 3 // Code generated by github.com/tinylib/msgp DO NOT EDIT. 4 5 import ( 6 "github.com/tinylib/msgp/msgp" 7 ) 8 9 // DecodeMsg implements msgp.Decodable 10 func (z *LogMeta) DecodeMsg(dc *msgp.Reader) (err error) { 11 var field []byte 12 _ = field 13 var zb0001 uint32 14 zb0001, err = dc.ReadMapHeader() 15 if err != nil { 16 err = msgp.WrapError(err) 17 return 18 } 19 for zb0001 > 0 { 20 zb0001-- 21 field, err = dc.ReadMapKeyPtr() 22 if err != nil { 23 err = msgp.WrapError(err) 24 return 25 } 26 switch msgp.UnsafeString(field) { 27 case "checkpointTs": 28 z.CheckpointTs, err = dc.ReadUint64() 29 if err != nil { 30 err = msgp.WrapError(err, "CheckpointTs") 31 return 32 } 33 case "resolvedTs": 34 z.ResolvedTs, err = dc.ReadUint64() 35 if err != nil { 36 err = msgp.WrapError(err, "ResolvedTs") 37 return 38 } 39 default: 40 err = dc.Skip() 41 if err != nil { 42 err = msgp.WrapError(err) 43 return 44 } 45 } 46 } 47 return 48 } 49 50 // EncodeMsg implements msgp.Encodable 51 func (z LogMeta) EncodeMsg(en *msgp.Writer) (err error) { 52 // map header, size 2 53 // write "checkpointTs" 54 err = en.Append(0x82, 0xac, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x73) 55 if err != nil { 56 return 57 } 58 err = en.WriteUint64(z.CheckpointTs) 59 if err != nil { 60 err = msgp.WrapError(err, "CheckpointTs") 61 return 62 } 63 // write "resolvedTs" 64 err = en.Append(0xaa, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x54, 0x73) 65 if err != nil { 66 return 67 } 68 err = en.WriteUint64(z.ResolvedTs) 69 if err != nil { 70 err = msgp.WrapError(err, "ResolvedTs") 71 return 72 } 73 return 74 } 75 76 // MarshalMsg implements msgp.Marshaler 77 func (z LogMeta) MarshalMsg(b []byte) (o []byte, err error) { 78 o = msgp.Require(b, z.Msgsize()) 79 // map header, size 2 80 // string "checkpointTs" 81 o = append(o, 0x82, 0xac, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x73) 82 o = msgp.AppendUint64(o, z.CheckpointTs) 83 // string "resolvedTs" 84 o = append(o, 0xaa, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x54, 0x73) 85 o = msgp.AppendUint64(o, z.ResolvedTs) 86 return 87 } 88 89 // UnmarshalMsg implements msgp.Unmarshaler 90 func (z *LogMeta) UnmarshalMsg(bts []byte) (o []byte, err error) { 91 var field []byte 92 _ = field 93 var zb0001 uint32 94 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 95 if err != nil { 96 err = msgp.WrapError(err) 97 return 98 } 99 for zb0001 > 0 { 100 zb0001-- 101 field, bts, err = msgp.ReadMapKeyZC(bts) 102 if err != nil { 103 err = msgp.WrapError(err) 104 return 105 } 106 switch msgp.UnsafeString(field) { 107 case "checkpointTs": 108 z.CheckpointTs, bts, err = msgp.ReadUint64Bytes(bts) 109 if err != nil { 110 err = msgp.WrapError(err, "CheckpointTs") 111 return 112 } 113 case "resolvedTs": 114 z.ResolvedTs, bts, err = msgp.ReadUint64Bytes(bts) 115 if err != nil { 116 err = msgp.WrapError(err, "ResolvedTs") 117 return 118 } 119 default: 120 bts, err = msgp.Skip(bts) 121 if err != nil { 122 err = msgp.WrapError(err) 123 return 124 } 125 } 126 } 127 o = bts 128 return 129 } 130 131 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 132 func (z LogMeta) Msgsize() (s int) { 133 s = 1 + 13 + msgp.Uint64Size + 11 + msgp.Uint64Size 134 return 135 }