Documentation ¶
Overview ¶
Package kvrwset is a generated protocol buffer package.
It is generated from these files:
ledger/rwset/kvrwset/kv_rwset.proto
It has these top-level messages:
KVRWSet KVRead KVWrite Version RangeQueryInfo QueryReads QueryReadsMerkleSummary
Index ¶
- type KVRWSet
- type KVRead
- type KVWrite
- type QueryReads
- type QueryReadsMerkleSummary
- func (*QueryReadsMerkleSummary) Descriptor() ([]byte, []int)
- func (ms *QueryReadsMerkleSummary) Equal(anotherMS *QueryReadsMerkleSummary) bool
- func (m *QueryReadsMerkleSummary) GetMaxDegree() uint32
- func (m *QueryReadsMerkleSummary) GetMaxLevel() uint32
- func (m *QueryReadsMerkleSummary) GetMaxLevelHashes() [][]byte
- func (*QueryReadsMerkleSummary) ProtoMessage()
- func (m *QueryReadsMerkleSummary) Reset()
- func (m *QueryReadsMerkleSummary) String() string
- type RangeQueryInfo
- func (*RangeQueryInfo) Descriptor() ([]byte, []int)
- func (m *RangeQueryInfo) GetEndKey() string
- func (m *RangeQueryInfo) GetItrExhausted() bool
- func (m *RangeQueryInfo) GetRawReads() *QueryReads
- func (m *RangeQueryInfo) GetReadsInfo() isRangeQueryInfo_ReadsInfo
- func (m *RangeQueryInfo) GetReadsMerkleHashes() *QueryReadsMerkleSummary
- func (m *RangeQueryInfo) GetStartKey() string
- func (*RangeQueryInfo) ProtoMessage()
- func (m *RangeQueryInfo) Reset()
- func (rqi *RangeQueryInfo) SetMerkelSummary(merkleSummary *QueryReadsMerkleSummary)
- func (rqi *RangeQueryInfo) SetRawReads(kvReads []*KVRead)
- func (m *RangeQueryInfo) String() string
- func (*RangeQueryInfo) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type RangeQueryInfo_RawReads
- type RangeQueryInfo_ReadsMerkleHashes
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KVRWSet ¶
type KVRWSet struct { Reads []*KVRead `protobuf:"bytes,1,rep,name=reads" json:"reads,omitempty"` RangeQueriesInfo []*RangeQueryInfo `protobuf:"bytes,2,rep,name=range_queries_info,json=rangeQueriesInfo" json:"range_queries_info,omitempty"` Writes []*KVWrite `protobuf:"bytes,3,rep,name=writes" json:"writes,omitempty"` }
KVRWSet encapsulates the read-write set for a chaincode that operates upon a KV or Document data model
func (*KVRWSet) Descriptor ¶
func (*KVRWSet) GetRangeQueriesInfo ¶
func (m *KVRWSet) GetRangeQueriesInfo() []*RangeQueryInfo
func (*KVRWSet) ProtoMessage ¶
func (*KVRWSet) ProtoMessage()
type KVRead ¶
type KVRead struct { Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` Version *Version `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` }
KVRead captures a read operation performed during transaction simulation A 'nil' version indicates a non-existing key read by the transaction
func (*KVRead) Descriptor ¶
func (*KVRead) GetVersion ¶
func (*KVRead) ProtoMessage ¶
func (*KVRead) ProtoMessage()
type KVWrite ¶
type KVWrite struct { Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` IsDelete bool `protobuf:"varint,2,opt,name=is_delete,json=isDelete" json:"is_delete,omitempty"` Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` }
KVWrite captures a write (update/delete) operation performed during transaction simulation
func (*KVWrite) Descriptor ¶
func (*KVWrite) GetIsDelete ¶
func (*KVWrite) ProtoMessage ¶
func (*KVWrite) ProtoMessage()
type QueryReads ¶
type QueryReads struct {
KvReads []*KVRead `protobuf:"bytes,1,rep,name=kv_reads,json=kvReads" json:"kv_reads,omitempty"`
}
QueryReads encapsulates the KVReads for the items read by a transaction as a result of a query execution
func (*QueryReads) Descriptor ¶
func (*QueryReads) Descriptor() ([]byte, []int)
func (*QueryReads) GetKvReads ¶
func (m *QueryReads) GetKvReads() []*KVRead
func (*QueryReads) ProtoMessage ¶
func (*QueryReads) ProtoMessage()
func (*QueryReads) Reset ¶
func (m *QueryReads) Reset()
func (*QueryReads) String ¶
func (m *QueryReads) String() string
type QueryReadsMerkleSummary ¶
type QueryReadsMerkleSummary struct { MaxDegree uint32 `protobuf:"varint,1,opt,name=max_degree,json=maxDegree" json:"max_degree,omitempty"` MaxLevel uint32 `protobuf:"varint,2,opt,name=max_level,json=maxLevel" json:"max_level,omitempty"` MaxLevelHashes [][]byte `protobuf:"bytes,3,rep,name=max_level_hashes,json=maxLevelHashes,proto3" json:"max_level_hashes,omitempty"` }
QueryReadsMerkleSummary encapsulates the Merkle-tree hashes for the QueryReads This allows to reduce the size of RWSet in the presence of query results by storing certain hashes instead of actual results. maxDegree field refers to the maximum number of children in the tree at any level maxLevel field contains the lowest level which has lesser nodes than maxDegree (starting from leaf level)
func (*QueryReadsMerkleSummary) Descriptor ¶
func (*QueryReadsMerkleSummary) Descriptor() ([]byte, []int)
func (*QueryReadsMerkleSummary) Equal ¶
func (ms *QueryReadsMerkleSummary) Equal(anotherMS *QueryReadsMerkleSummary) bool
Equal verifies whether the give MerkleSummary is equals to this
func (*QueryReadsMerkleSummary) GetMaxDegree ¶
func (m *QueryReadsMerkleSummary) GetMaxDegree() uint32
func (*QueryReadsMerkleSummary) GetMaxLevel ¶
func (m *QueryReadsMerkleSummary) GetMaxLevel() uint32
func (*QueryReadsMerkleSummary) GetMaxLevelHashes ¶
func (m *QueryReadsMerkleSummary) GetMaxLevelHashes() [][]byte
func (*QueryReadsMerkleSummary) ProtoMessage ¶
func (*QueryReadsMerkleSummary) ProtoMessage()
func (*QueryReadsMerkleSummary) Reset ¶
func (m *QueryReadsMerkleSummary) Reset()
func (*QueryReadsMerkleSummary) String ¶
func (m *QueryReadsMerkleSummary) String() string
type RangeQueryInfo ¶
type RangeQueryInfo struct { StartKey string `protobuf:"bytes,1,opt,name=start_key,json=startKey" json:"start_key,omitempty"` EndKey string `protobuf:"bytes,2,opt,name=end_key,json=endKey" json:"end_key,omitempty"` ItrExhausted bool `protobuf:"varint,3,opt,name=itr_exhausted,json=itrExhausted" json:"itr_exhausted,omitempty"` // Types that are valid to be assigned to ReadsInfo: // *RangeQueryInfo_RawReads // *RangeQueryInfo_ReadsMerkleHashes ReadsInfo isRangeQueryInfo_ReadsInfo `protobuf_oneof:"reads_info"` }
RangeQueryInfo encapsulates the details of a range query performed by a transaction during simulation. This helps protect transactions from phantom reads by varifying during validation whether any new items got committed within the given range between transaction simuation and validation (in addition to regular checks for updates/deletes of the existing items). readInfo field contains either the KVReads (for the items read by the range query) or a merkle-tree hash if the KVReads exceeds a pre-configured numbers
func (*RangeQueryInfo) Descriptor ¶
func (*RangeQueryInfo) Descriptor() ([]byte, []int)
func (*RangeQueryInfo) GetEndKey ¶
func (m *RangeQueryInfo) GetEndKey() string
func (*RangeQueryInfo) GetItrExhausted ¶
func (m *RangeQueryInfo) GetItrExhausted() bool
func (*RangeQueryInfo) GetRawReads ¶
func (m *RangeQueryInfo) GetRawReads() *QueryReads
func (*RangeQueryInfo) GetReadsInfo ¶
func (m *RangeQueryInfo) GetReadsInfo() isRangeQueryInfo_ReadsInfo
func (*RangeQueryInfo) GetReadsMerkleHashes ¶
func (m *RangeQueryInfo) GetReadsMerkleHashes() *QueryReadsMerkleSummary
func (*RangeQueryInfo) GetStartKey ¶
func (m *RangeQueryInfo) GetStartKey() string
func (*RangeQueryInfo) ProtoMessage ¶
func (*RangeQueryInfo) ProtoMessage()
func (*RangeQueryInfo) Reset ¶
func (m *RangeQueryInfo) Reset()
func (*RangeQueryInfo) SetMerkelSummary ¶
func (rqi *RangeQueryInfo) SetMerkelSummary(merkleSummary *QueryReadsMerkleSummary)
SetMerkelSummary sets the 'readsInfo' field to merkle summary of the raw KVReads of query results
func (*RangeQueryInfo) SetRawReads ¶
func (rqi *RangeQueryInfo) SetRawReads(kvReads []*KVRead)
SetRawReads sets the 'readsInfo' field to raw KVReads performed by the query
func (*RangeQueryInfo) String ¶
func (m *RangeQueryInfo) String() string
func (*RangeQueryInfo) XXX_OneofFuncs ¶
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{})
XXX_OneofFuncs is for the internal use of the proto package.
type RangeQueryInfo_RawReads ¶
type RangeQueryInfo_RawReads struct {
RawReads *QueryReads `protobuf:"bytes,4,opt,name=raw_reads,json=rawReads,oneof"`
}
type RangeQueryInfo_ReadsMerkleHashes ¶
type RangeQueryInfo_ReadsMerkleHashes struct {
ReadsMerkleHashes *QueryReadsMerkleSummary `protobuf:"bytes,5,opt,name=reads_merkle_hashes,json=readsMerkleHashes,oneof"`
}
type Version ¶
type Version struct { BlockNum uint64 `protobuf:"varint,1,opt,name=block_num,json=blockNum" json:"block_num,omitempty"` TxNum uint64 `protobuf:"varint,2,opt,name=tx_num,json=txNum" json:"tx_num,omitempty"` }
Version encapsulates the version of a Key A version of a committed key is maintained as the height of the transaction that committed the key. The height is represenetd as a tuple <blockNum, txNum> where the txNum is the height of the transaction (starting with 1) within block
func (*Version) Descriptor ¶
func (*Version) GetBlockNum ¶
func (*Version) ProtoMessage ¶
func (*Version) ProtoMessage()