Documentation
¶
Index ¶
- type KVRead
- type KVWrite
- type NsReadWriteSet
- type RWSet
- func (rws *RWSet) AddToRangeQuerySet(ns string, rqi *RangeQueryInfo)
- func (rws *RWSet) AddToReadSet(ns string, key string, version *version.Height)
- func (rws *RWSet) AddToWriteSet(ns string, key string, value []byte)
- func (rws *RWSet) GetFromWriteSet(ns string, key string) ([]byte, bool)
- func (rws *RWSet) GetTxReadWriteSet() *TxReadWriteSet
- type RangeQueryInfo
- func (rqi *RangeQueryInfo) AddResult(kvRead *KVRead)
- func (rqi *RangeQueryInfo) GetResultHash() []byte
- func (rqi *RangeQueryInfo) GetResults() []*KVRead
- func (rqi *RangeQueryInfo) Marshal(buf *proto.Buffer) error
- func (rqi *RangeQueryInfo) String() string
- func (rqi *RangeQueryInfo) Unmarshal(buf *proto.Buffer) error
- type TxReadWriteSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KVRead ¶
KVRead - a tuple of key and its version at the time of transaction simulation
type KVWrite ¶
KVWrite - a tuple of key and it's value that a transaction wants to set during simulation. In addition, IsDelete is set to true iff the operation performed on the key is a delete operation
func NewKVWrite ¶
NewKVWrite constructs a new `KVWrite`
type NsReadWriteSet ¶
type NsReadWriteSet struct { NameSpace string Reads []*KVRead Writes []*KVWrite RangeQueriesInfo []*RangeQueryInfo }
NsReadWriteSet - a collection of all the reads and writes that belong to a common namespace
func (*NsReadWriteSet) Marshal ¶
func (nsRW *NsReadWriteSet) Marshal(buf *proto.Buffer) error
Marshal serializes a `NsReadWriteSet`
func (*NsReadWriteSet) String ¶
func (nsRW *NsReadWriteSet) String() string
String prints a `NsReadWriteSet`
type RWSet ¶
type RWSet struct {
// contains filtered or unexported fields
}
RWSet maintains the read-write set
func (*RWSet) AddToRangeQuerySet ¶
func (rws *RWSet) AddToRangeQuerySet(ns string, rqi *RangeQueryInfo)
AddToRangeQuerySet adds a range query info for performing phantom read validation
func (*RWSet) AddToReadSet ¶
AddToReadSet adds a key and corresponding version to the read-set
func (*RWSet) AddToWriteSet ¶
AddToWriteSet adds a key and value to the write-set
func (*RWSet) GetFromWriteSet ¶
GetFromWriteSet return the value of a key from the write-set
func (*RWSet) GetTxReadWriteSet ¶
func (rws *RWSet) GetTxReadWriteSet() *TxReadWriteSet
GetTxReadWriteSet returns the read-write set in the form that can be serialized
type RangeQueryInfo ¶
type RangeQueryInfo struct { StartKey string EndKey string ItrExhausted bool // contains filtered or unexported fields }
RangeQueryInfo captures a range query executed by a transaction and the tuples <key,version> that are read by the transaction This it to be used to perform a phantom-read validation during commit
func (*RangeQueryInfo) AddResult ¶
func (rqi *RangeQueryInfo) AddResult(kvRead *KVRead)
AddResult appends the result
func (*RangeQueryInfo) GetResultHash ¶
func (rqi *RangeQueryInfo) GetResultHash() []byte
GetResultHash returns the resultHash
func (*RangeQueryInfo) GetResults ¶
func (rqi *RangeQueryInfo) GetResults() []*KVRead
GetResults returns the results of the range query
func (*RangeQueryInfo) Marshal ¶
func (rqi *RangeQueryInfo) Marshal(buf *proto.Buffer) error
Marshal serializes a `RangeQueryInfo`
func (*RangeQueryInfo) String ¶
func (rqi *RangeQueryInfo) String() string
String prints a range query info
type TxReadWriteSet ¶
type TxReadWriteSet struct {
NsRWs []*NsReadWriteSet
}
TxReadWriteSet - a collection of all the reads and writes collected as a result of a transaction simulation
func (*TxReadWriteSet) Marshal ¶
func (txRW *TxReadWriteSet) Marshal() ([]byte, error)
Marshal serializes a `TxReadWriteSet`
func (*TxReadWriteSet) String ¶
func (txRW *TxReadWriteSet) String() string
String prints a `TxReadWriteSet`
func (*TxReadWriteSet) Unmarshal ¶
func (txRW *TxReadWriteSet) Unmarshal(b []byte) error
Unmarshal deserializes a `TxReadWriteSet`