github.com/kchristidis/fabric@v1.0.4-0.20171028114726-837acd08cde1/protos/ledger/rwset/kvrwset/kv_rwset.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: ledger/rwset/kvrwset/kv_rwset.proto 3 4 /* 5 Package kvrwset is a generated protocol buffer package. 6 7 It is generated from these files: 8 ledger/rwset/kvrwset/kv_rwset.proto 9 10 It has these top-level messages: 11 KVRWSet 12 KVRead 13 KVWrite 14 Version 15 RangeQueryInfo 16 QueryReads 17 QueryReadsMerkleSummary 18 */ 19 package kvrwset 20 21 import proto "github.com/golang/protobuf/proto" 22 import fmt "fmt" 23 import math "math" 24 25 // Reference imports to suppress errors if they are not otherwise used. 26 var _ = proto.Marshal 27 var _ = fmt.Errorf 28 var _ = math.Inf 29 30 // This is a compile-time assertion to ensure that this generated file 31 // is compatible with the proto package it is being compiled against. 32 // A compilation error at this line likely means your copy of the 33 // proto package needs to be updated. 34 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 35 36 // KVRWSet encapsulates the read-write set for a chaincode that operates upon a KV or Document data model 37 type KVRWSet struct { 38 Reads []*KVRead `protobuf:"bytes,1,rep,name=reads" json:"reads,omitempty"` 39 RangeQueriesInfo []*RangeQueryInfo `protobuf:"bytes,2,rep,name=range_queries_info,json=rangeQueriesInfo" json:"range_queries_info,omitempty"` 40 Writes []*KVWrite `protobuf:"bytes,3,rep,name=writes" json:"writes,omitempty"` 41 } 42 43 func (m *KVRWSet) Reset() { *m = KVRWSet{} } 44 func (m *KVRWSet) String() string { return proto.CompactTextString(m) } 45 func (*KVRWSet) ProtoMessage() {} 46 func (*KVRWSet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 47 48 func (m *KVRWSet) GetReads() []*KVRead { 49 if m != nil { 50 return m.Reads 51 } 52 return nil 53 } 54 55 func (m *KVRWSet) GetRangeQueriesInfo() []*RangeQueryInfo { 56 if m != nil { 57 return m.RangeQueriesInfo 58 } 59 return nil 60 } 61 62 func (m *KVRWSet) GetWrites() []*KVWrite { 63 if m != nil { 64 return m.Writes 65 } 66 return nil 67 } 68 69 // KVRead captures a read operation performed during transaction simulation 70 // A 'nil' version indicates a non-existing key read by the transaction 71 type KVRead struct { 72 Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` 73 Version *Version `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` 74 } 75 76 func (m *KVRead) Reset() { *m = KVRead{} } 77 func (m *KVRead) String() string { return proto.CompactTextString(m) } 78 func (*KVRead) ProtoMessage() {} 79 func (*KVRead) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } 80 81 func (m *KVRead) GetKey() string { 82 if m != nil { 83 return m.Key 84 } 85 return "" 86 } 87 88 func (m *KVRead) GetVersion() *Version { 89 if m != nil { 90 return m.Version 91 } 92 return nil 93 } 94 95 // KVWrite captures a write (update/delete) operation performed during transaction simulation 96 type KVWrite struct { 97 Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` 98 IsDelete bool `protobuf:"varint,2,opt,name=is_delete,json=isDelete" json:"is_delete,omitempty"` 99 Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` 100 } 101 102 func (m *KVWrite) Reset() { *m = KVWrite{} } 103 func (m *KVWrite) String() string { return proto.CompactTextString(m) } 104 func (*KVWrite) ProtoMessage() {} 105 func (*KVWrite) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } 106 107 func (m *KVWrite) GetKey() string { 108 if m != nil { 109 return m.Key 110 } 111 return "" 112 } 113 114 func (m *KVWrite) GetIsDelete() bool { 115 if m != nil { 116 return m.IsDelete 117 } 118 return false 119 } 120 121 func (m *KVWrite) GetValue() []byte { 122 if m != nil { 123 return m.Value 124 } 125 return nil 126 } 127 128 // Version encapsulates the version of a Key 129 // A version of a committed key is maintained as the height of the transaction that committed the key. 130 // The height is represenetd as a tuple <blockNum, txNum> where the txNum is the height of the transaction 131 // (starting with 1) within block 132 type Version struct { 133 BlockNum uint64 `protobuf:"varint,1,opt,name=block_num,json=blockNum" json:"block_num,omitempty"` 134 TxNum uint64 `protobuf:"varint,2,opt,name=tx_num,json=txNum" json:"tx_num,omitempty"` 135 } 136 137 func (m *Version) Reset() { *m = Version{} } 138 func (m *Version) String() string { return proto.CompactTextString(m) } 139 func (*Version) ProtoMessage() {} 140 func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } 141 142 func (m *Version) GetBlockNum() uint64 { 143 if m != nil { 144 return m.BlockNum 145 } 146 return 0 147 } 148 149 func (m *Version) GetTxNum() uint64 { 150 if m != nil { 151 return m.TxNum 152 } 153 return 0 154 } 155 156 // RangeQueryInfo encapsulates the details of a range query performed by a transaction during simulation. 157 // This helps protect transactions from phantom reads by varifying during validation whether any new items 158 // got committed within the given range between transaction simuation and validation 159 // (in addition to regular checks for updates/deletes of the existing items). 160 // readInfo field contains either the KVReads (for the items read by the range query) or a merkle-tree hash 161 // if the KVReads exceeds a pre-configured numbers 162 type RangeQueryInfo struct { 163 StartKey string `protobuf:"bytes,1,opt,name=start_key,json=startKey" json:"start_key,omitempty"` 164 EndKey string `protobuf:"bytes,2,opt,name=end_key,json=endKey" json:"end_key,omitempty"` 165 ItrExhausted bool `protobuf:"varint,3,opt,name=itr_exhausted,json=itrExhausted" json:"itr_exhausted,omitempty"` 166 // Types that are valid to be assigned to ReadsInfo: 167 // *RangeQueryInfo_RawReads 168 // *RangeQueryInfo_ReadsMerkleHashes 169 ReadsInfo isRangeQueryInfo_ReadsInfo `protobuf_oneof:"reads_info"` 170 } 171 172 func (m *RangeQueryInfo) Reset() { *m = RangeQueryInfo{} } 173 func (m *RangeQueryInfo) String() string { return proto.CompactTextString(m) } 174 func (*RangeQueryInfo) ProtoMessage() {} 175 func (*RangeQueryInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } 176 177 type isRangeQueryInfo_ReadsInfo interface { 178 isRangeQueryInfo_ReadsInfo() 179 } 180 181 type RangeQueryInfo_RawReads struct { 182 RawReads *QueryReads `protobuf:"bytes,4,opt,name=raw_reads,json=rawReads,oneof"` 183 } 184 type RangeQueryInfo_ReadsMerkleHashes struct { 185 ReadsMerkleHashes *QueryReadsMerkleSummary `protobuf:"bytes,5,opt,name=reads_merkle_hashes,json=readsMerkleHashes,oneof"` 186 } 187 188 func (*RangeQueryInfo_RawReads) isRangeQueryInfo_ReadsInfo() {} 189 func (*RangeQueryInfo_ReadsMerkleHashes) isRangeQueryInfo_ReadsInfo() {} 190 191 func (m *RangeQueryInfo) GetReadsInfo() isRangeQueryInfo_ReadsInfo { 192 if m != nil { 193 return m.ReadsInfo 194 } 195 return nil 196 } 197 198 func (m *RangeQueryInfo) GetStartKey() string { 199 if m != nil { 200 return m.StartKey 201 } 202 return "" 203 } 204 205 func (m *RangeQueryInfo) GetEndKey() string { 206 if m != nil { 207 return m.EndKey 208 } 209 return "" 210 } 211 212 func (m *RangeQueryInfo) GetItrExhausted() bool { 213 if m != nil { 214 return m.ItrExhausted 215 } 216 return false 217 } 218 219 func (m *RangeQueryInfo) GetRawReads() *QueryReads { 220 if x, ok := m.GetReadsInfo().(*RangeQueryInfo_RawReads); ok { 221 return x.RawReads 222 } 223 return nil 224 } 225 226 func (m *RangeQueryInfo) GetReadsMerkleHashes() *QueryReadsMerkleSummary { 227 if x, ok := m.GetReadsInfo().(*RangeQueryInfo_ReadsMerkleHashes); ok { 228 return x.ReadsMerkleHashes 229 } 230 return nil 231 } 232 233 // XXX_OneofFuncs is for the internal use of the proto package. 234 func (*RangeQueryInfo) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 235 return _RangeQueryInfo_OneofMarshaler, _RangeQueryInfo_OneofUnmarshaler, _RangeQueryInfo_OneofSizer, []interface{}{ 236 (*RangeQueryInfo_RawReads)(nil), 237 (*RangeQueryInfo_ReadsMerkleHashes)(nil), 238 } 239 } 240 241 func _RangeQueryInfo_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 242 m := msg.(*RangeQueryInfo) 243 // reads_info 244 switch x := m.ReadsInfo.(type) { 245 case *RangeQueryInfo_RawReads: 246 b.EncodeVarint(4<<3 | proto.WireBytes) 247 if err := b.EncodeMessage(x.RawReads); err != nil { 248 return err 249 } 250 case *RangeQueryInfo_ReadsMerkleHashes: 251 b.EncodeVarint(5<<3 | proto.WireBytes) 252 if err := b.EncodeMessage(x.ReadsMerkleHashes); err != nil { 253 return err 254 } 255 case nil: 256 default: 257 return fmt.Errorf("RangeQueryInfo.ReadsInfo has unexpected type %T", x) 258 } 259 return nil 260 } 261 262 func _RangeQueryInfo_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 263 m := msg.(*RangeQueryInfo) 264 switch tag { 265 case 4: // reads_info.raw_reads 266 if wire != proto.WireBytes { 267 return true, proto.ErrInternalBadWireType 268 } 269 msg := new(QueryReads) 270 err := b.DecodeMessage(msg) 271 m.ReadsInfo = &RangeQueryInfo_RawReads{msg} 272 return true, err 273 case 5: // reads_info.reads_merkle_hashes 274 if wire != proto.WireBytes { 275 return true, proto.ErrInternalBadWireType 276 } 277 msg := new(QueryReadsMerkleSummary) 278 err := b.DecodeMessage(msg) 279 m.ReadsInfo = &RangeQueryInfo_ReadsMerkleHashes{msg} 280 return true, err 281 default: 282 return false, nil 283 } 284 } 285 286 func _RangeQueryInfo_OneofSizer(msg proto.Message) (n int) { 287 m := msg.(*RangeQueryInfo) 288 // reads_info 289 switch x := m.ReadsInfo.(type) { 290 case *RangeQueryInfo_RawReads: 291 s := proto.Size(x.RawReads) 292 n += proto.SizeVarint(4<<3 | proto.WireBytes) 293 n += proto.SizeVarint(uint64(s)) 294 n += s 295 case *RangeQueryInfo_ReadsMerkleHashes: 296 s := proto.Size(x.ReadsMerkleHashes) 297 n += proto.SizeVarint(5<<3 | proto.WireBytes) 298 n += proto.SizeVarint(uint64(s)) 299 n += s 300 case nil: 301 default: 302 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 303 } 304 return n 305 } 306 307 // QueryReads encapsulates the KVReads for the items read by a transaction as a result of a query execution 308 type QueryReads struct { 309 KvReads []*KVRead `protobuf:"bytes,1,rep,name=kv_reads,json=kvReads" json:"kv_reads,omitempty"` 310 } 311 312 func (m *QueryReads) Reset() { *m = QueryReads{} } 313 func (m *QueryReads) String() string { return proto.CompactTextString(m) } 314 func (*QueryReads) ProtoMessage() {} 315 func (*QueryReads) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } 316 317 func (m *QueryReads) GetKvReads() []*KVRead { 318 if m != nil { 319 return m.KvReads 320 } 321 return nil 322 } 323 324 // QueryReadsMerkleSummary encapsulates the Merkle-tree hashes for the QueryReads 325 // This allows to reduce the size of RWSet in the presence of query results 326 // by storing certain hashes instead of actual results. 327 // maxDegree field refers to the maximum number of children in the tree at any level 328 // maxLevel field contains the lowest level which has lesser nodes than maxDegree (starting from leaf level) 329 type QueryReadsMerkleSummary struct { 330 MaxDegree uint32 `protobuf:"varint,1,opt,name=max_degree,json=maxDegree" json:"max_degree,omitempty"` 331 MaxLevel uint32 `protobuf:"varint,2,opt,name=max_level,json=maxLevel" json:"max_level,omitempty"` 332 MaxLevelHashes [][]byte `protobuf:"bytes,3,rep,name=max_level_hashes,json=maxLevelHashes,proto3" json:"max_level_hashes,omitempty"` 333 } 334 335 func (m *QueryReadsMerkleSummary) Reset() { *m = QueryReadsMerkleSummary{} } 336 func (m *QueryReadsMerkleSummary) String() string { return proto.CompactTextString(m) } 337 func (*QueryReadsMerkleSummary) ProtoMessage() {} 338 func (*QueryReadsMerkleSummary) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } 339 340 func (m *QueryReadsMerkleSummary) GetMaxDegree() uint32 { 341 if m != nil { 342 return m.MaxDegree 343 } 344 return 0 345 } 346 347 func (m *QueryReadsMerkleSummary) GetMaxLevel() uint32 { 348 if m != nil { 349 return m.MaxLevel 350 } 351 return 0 352 } 353 354 func (m *QueryReadsMerkleSummary) GetMaxLevelHashes() [][]byte { 355 if m != nil { 356 return m.MaxLevelHashes 357 } 358 return nil 359 } 360 361 func init() { 362 proto.RegisterType((*KVRWSet)(nil), "kvrwset.KVRWSet") 363 proto.RegisterType((*KVRead)(nil), "kvrwset.KVRead") 364 proto.RegisterType((*KVWrite)(nil), "kvrwset.KVWrite") 365 proto.RegisterType((*Version)(nil), "kvrwset.Version") 366 proto.RegisterType((*RangeQueryInfo)(nil), "kvrwset.RangeQueryInfo") 367 proto.RegisterType((*QueryReads)(nil), "kvrwset.QueryReads") 368 proto.RegisterType((*QueryReadsMerkleSummary)(nil), "kvrwset.QueryReadsMerkleSummary") 369 } 370 371 func init() { proto.RegisterFile("ledger/rwset/kvrwset/kv_rwset.proto", fileDescriptor0) } 372 373 var fileDescriptor0 = []byte{ 374 // 552 bytes of a gzipped FileDescriptorProto 375 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x53, 0x4d, 0x6b, 0xdb, 0x40, 376 0x10, 0x8d, 0xec, 0xd8, 0x92, 0xa7, 0x4e, 0xea, 0x6e, 0x5a, 0x22, 0x28, 0x05, 0xa3, 0x50, 0x30, 377 0x39, 0x48, 0x90, 0x5e, 0xda, 0x43, 0x2f, 0x25, 0x29, 0x29, 0x69, 0x03, 0xdd, 0x80, 0x03, 0xbd, 378 0x88, 0xb5, 0x35, 0xb6, 0x85, 0xf5, 0x91, 0xee, 0xae, 0x6c, 0xf9, 0x54, 0xfa, 0x53, 0xfa, 0x4f, 379 0xcb, 0x8e, 0x24, 0x3b, 0x01, 0xb7, 0x27, 0xed, 0xbc, 0x37, 0x6f, 0x76, 0xe6, 0x69, 0x16, 0xce, 380 0x12, 0x8c, 0xe6, 0x28, 0x03, 0xb9, 0x56, 0xa8, 0x83, 0xe5, 0xaa, 0xf9, 0x86, 0x74, 0xf0, 0x1f, 381 0x64, 0xae, 0x73, 0x66, 0xd7, 0xb8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