Documentation ¶
Index ¶
- type Inspector
- func (i *Inspector) AppendRWSet(raw []byte, nss ...string) error
- func (i *Inspector) Bytes() ([]byte, error)
- func (i *Inspector) Clear(ns string) error
- func (i *Inspector) DeleteState(namespace string, key string) error
- func (i *Inspector) Done()
- func (i *Inspector) Equals(other interface{}, nss ...string) error
- func (i *Inspector) GetReadAt(ns string, pos int) (string, []byte, error)
- func (i *Inspector) GetReadKeyAt(ns string, pos int) (string, error)
- func (i *Inspector) GetState(namespace string, key string, opts ...driver.GetStateOpt) ([]byte, error)
- func (i *Inspector) GetStateMetadata(namespace, key string, opts ...driver.GetStateOpt) (map[string][]byte, error)
- func (i *Inspector) GetWriteAt(ns string, pos int) (string, []byte, error)
- func (i *Inspector) IsValid() error
- func (i *Inspector) Namespaces() []string
- func (i *Inspector) NumReads(ns string) int
- func (i *Inspector) NumWrites(ns string) int
- func (i *Inspector) SetState(namespace string, key string, value []byte) error
- func (i *Inspector) SetStateMetadata(namespace, key string, metadata map[string][]byte) error
- type Interceptor
- func (i *Interceptor) AppendRWSet(raw []byte, nss ...string) error
- func (i *Interceptor) Bytes() ([]byte, error)
- func (i *Interceptor) Clear(ns string) error
- func (i *Interceptor) DeleteState(namespace string, key string) error
- func (i *Interceptor) Done()
- func (i *Interceptor) Equals(other interface{}, nss ...string) error
- func (i *Interceptor) GetReadAt(ns string, pos int) (string, []byte, error)
- func (i *Interceptor) GetReadKeyAt(ns string, pos int) (string, error)
- func (i *Interceptor) GetState(namespace string, key string, opts ...driver.GetStateOpt) ([]byte, error)
- func (i *Interceptor) GetStateMetadata(namespace, key string, opts ...driver.GetStateOpt) (map[string][]byte, error)
- func (i *Interceptor) GetWriteAt(ns string, pos int) (string, []byte, error)
- func (i *Interceptor) IsValid() error
- func (i *Interceptor) Namespaces() []string
- func (i *Interceptor) NumReads(ns string) int
- func (i *Interceptor) NumWrites(ns string) int
- func (i *Interceptor) Reopen(qe QueryExecutor) error
- func (i *Interceptor) SetState(namespace string, key string, value []byte) error
- func (i *Interceptor) SetStateMetadata(namespace string, key string, value map[string][]byte) error
- type QueryExecutor
- type TXIDStore
- type TXIDStoreReader
- type Vault
- func (db *Vault) Close() error
- func (db *Vault) CommitTX(txID string, block uint64, indexInBloc int) error
- func (db *Vault) DiscardTx(txID string) error
- func (db *Vault) GetExistingRWSet(txID string) (*Interceptor, error)
- func (db *Vault) GetRWSet(txID string, rwsetBytes []byte) (*Interceptor, error)
- func (db *Vault) InspectRWSet(rwsetBytes []byte, namespaces ...string) (*Inspector, error)
- func (db *Vault) Match(txID string, rwsRaw []byte) error
- func (db *Vault) NewQueryExecutor() (fdriver.QueryExecutor, error)
- func (db *Vault) NewRWSet(txID string) (*Interceptor, error)
- func (db *Vault) RWSExists(txID string) bool
- func (db *Vault) SetBusy(txID string) error
- func (db *Vault) Status(txID string) (fdriver.ValidationCode, error)
- func (db *Vault) UnmapInterceptor(txID string) (*Interceptor, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Inspector ¶
type Inspector struct {
Rws readWriteSet
}
func NewInspector ¶ added in v0.3.0
func NewInspector() *Inspector
func (*Inspector) GetReadKeyAt ¶
func (*Inspector) GetStateMetadata ¶
func (*Inspector) GetWriteAt ¶
func (*Inspector) Namespaces ¶
type Interceptor ¶
type Interceptor struct { QE QueryExecutor TxIDStore TXIDStoreReader Rws readWriteSet Closed bool TxID string }
func NewInterceptor ¶ added in v0.3.0
func NewInterceptor(qe QueryExecutor, txidStore TXIDStoreReader, txid string) *Interceptor
func (*Interceptor) AppendRWSet ¶
func (i *Interceptor) AppendRWSet(raw []byte, nss ...string) error
func (*Interceptor) Bytes ¶
func (i *Interceptor) Bytes() ([]byte, error)
func (*Interceptor) Clear ¶
func (i *Interceptor) Clear(ns string) error
func (*Interceptor) DeleteState ¶
func (i *Interceptor) DeleteState(namespace string, key string) error
func (*Interceptor) Done ¶
func (i *Interceptor) Done()
func (*Interceptor) Equals ¶
func (i *Interceptor) Equals(other interface{}, nss ...string) error
func (*Interceptor) GetReadKeyAt ¶
func (i *Interceptor) GetReadKeyAt(ns string, pos int) (string, error)
func (*Interceptor) GetState ¶
func (i *Interceptor) GetState(namespace string, key string, opts ...driver.GetStateOpt) ([]byte, error)
func (*Interceptor) GetStateMetadata ¶
func (i *Interceptor) GetStateMetadata(namespace, key string, opts ...driver.GetStateOpt) (map[string][]byte, error)
func (*Interceptor) GetWriteAt ¶
func (*Interceptor) IsValid ¶
func (i *Interceptor) IsValid() error
func (*Interceptor) Namespaces ¶
func (i *Interceptor) Namespaces() []string
func (*Interceptor) NumReads ¶
func (i *Interceptor) NumReads(ns string) int
func (*Interceptor) NumWrites ¶
func (i *Interceptor) NumWrites(ns string) int
func (*Interceptor) Reopen ¶ added in v0.3.0
func (i *Interceptor) Reopen(qe QueryExecutor) error
func (*Interceptor) SetState ¶
func (i *Interceptor) SetState(namespace string, key string, value []byte) error
func (*Interceptor) SetStateMetadata ¶
type QueryExecutor ¶
type TXIDStore ¶
type TXIDStore interface { TXIDStoreReader Set(txID string, code fdriver.ValidationCode) error }
type TXIDStoreReader ¶
type TXIDStoreReader interface {
Get(txID string) (fdriver.ValidationCode, error)
}
type Vault ¶
type Vault struct { TXIDStore TXIDStore InterceptorsLock sync.RWMutex Interceptors map[string]*Interceptor Counter atomic.Int32 // the vault handles access concurrency to the Store using StoreLock. // In particular: // * when a directQueryExecutor is returned, it holds a read-lock; // when Done is called on it, the lock is released. // * when an interceptor is returned (using NewRWSet (in case the // transaction context is generated from nothing) or GetRWSet // (in case the transaction context is received from another node)), // it holds a read-lock; when Done is called on it, the lock is released. // * an exclusive lock is held when Commit is called. Store driver.VersionedPersistence StoreLock sync.RWMutex }
Vault models a key-value Store that can be modified by committing rwsets
func New ¶
func New(store driver.VersionedPersistence, txIDStore TXIDStore) *Vault
New returns a new instance of Vault
func (*Vault) GetExistingRWSet ¶ added in v0.3.0
func (db *Vault) GetExistingRWSet(txID string) (*Interceptor, error)
func (*Vault) GetRWSet ¶
func (db *Vault) GetRWSet(txID string, rwsetBytes []byte) (*Interceptor, error)
func (*Vault) InspectRWSet ¶
func (*Vault) NewQueryExecutor ¶
func (db *Vault) NewQueryExecutor() (fdriver.QueryExecutor, error)
func (*Vault) UnmapInterceptor ¶ added in v0.3.0
func (db *Vault) UnmapInterceptor(txID string) (*Interceptor, error)
Click to show internal directories.
Click to hide internal directories.