diff options
Diffstat (limited to 'transaction.go')
-rw-r--r-- | transaction.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/transaction.go b/transaction.go index d21693a..1b940d6 100644 --- a/transaction.go +++ b/transaction.go @@ -10,7 +10,6 @@ const ( type txnid uint64 type Transaction struct { - id int db *DB meta *meta buckets *buckets @@ -27,8 +26,13 @@ func (t *Transaction) init(db *DB) { t.buckets.read(t.page(t.meta.buckets)) } +// id returns the transaction id. +func (t *Transaction) id() txnid { + return t.meta.txnid +} + func (t *Transaction) Close() { - // TODO: Close buckets. + t.db.removeTransaction(t) } func (t *Transaction) DB() *DB { @@ -73,12 +77,6 @@ func (t *Transaction) Get(name string, key []byte) []byte { return c.Get(key) } -// stat returns information about a bucket's internal structure. -func (t *Transaction) stat(name string) *Stat { - // TODO - return nil -} - // page returns a reference to the page with a given id. // If page has been written to then a temporary bufferred page is returned. func (t *Transaction) page(id pgid) *page { |