Documentation ¶
Overview ¶
Package txn implements a full transaction interface on top of GoJournal.
Transactions in this package do not have to implement concurrency control, since the package uses two-phase locking to automatically synchronize transactions. Lock ordering is still up to the caller to avoid deadlocks.
Index ¶
- type Log
- type Txn
- func (txn *Txn) Acquire(addr addr.Addr)
- func (txn *Txn) Commit(wait bool) bool
- func (txn *Txn) NDirty() uint64
- func (txn *Txn) OverWrite(addr addr.Addr, sz uint64, data []byte)
- func (txn *Txn) OverWriteBit(addr addr.Addr, data bool)
- func (txn *Txn) ReadBuf(addr addr.Addr, sz uint64) []byte
- func (txn *Txn) ReadBufBit(addr addr.Addr) bool
- func (txn *Txn) ReleaseAll()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Txn ¶
type Txn struct {
// contains filtered or unexported fields
}
func (*Txn) NDirty ¶ added in v0.3.0
NDirty reports an upper bound on the size of this transaction when committed.
TODO: number of locks acquired also bounds size of transaction
The caller cannot rely on any particular properties of this function for safety.
func (*Txn) ReleaseAll ¶ added in v0.3.0
func (txn *Txn) ReleaseAll()
Click to show internal directories.
Click to hide internal directories.