Skip to content

Commit 4baa7fd

Browse files
author
Jan Mercl
committed
Improve documentation. Updates cznic#8
1 parent 9c824b0 commit 4baa7fd

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

doc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ isolated iff their execution is serialized.
5454
5555
Durability
5656
57-
Transactions are commited using the two phase commit protocol(2PC)[2] and a
57+
Transactions are committed using the two phase commit protocol(2PC)[2] and a
5858
write ahead log(WAL)[3]. DB recovery after a crash is performed automatically
5959
using data from the WAL. Last transaction data, either of an in progress
60-
transaction or a transaction being commited at the moment of the crash, can get
60+
transaction or a transaction being committed at the moment of the crash, can get
6161
lost.
6262
6363
No protection from non readable files, files corrupted by other processes or by

kv.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,12 @@ func (db *DB) Put(dst, key []byte, upd func(key, old []byte) (new []byte, write
672672
return
673673
}
674674

675-
// Seek returns an enumerator with "position" or an error if any. Normally the
676-
// position is on a KV pair such that key >= KV.key. Then hit is key == KV.key.
677-
// The position is possibly "after" the last KV pair, but that is not an error.
675+
// Seek returns an enumerator or an error if any. Normally the enumerator is
676+
// positioned on a KV pair such that 'key' >= KV.key and 'hit' is key ==
677+
// KV.key. If 'key' collates after any existing key in the DB then the
678+
// enumerator's position is effectively "after" the last KV pair, but that is
679+
// not an error. However, such enumerator will return err set to io.EOF from
680+
// its Next/Prev methods.
678681
//
679682
// Seek is atomic and it is safe for concurrent use by multiple goroutines.
680683
func (db *DB) Seek(key []byte) (enum *Enumerator, hit bool, err error) {
@@ -697,7 +700,7 @@ func (db *DB) Seek(key []byte) (enum *Enumerator, hit bool, err error) {
697700
}
698701

699702
// SeekFirst returns an enumerator positioned on the first KV pair in the DB,
700-
// if any. For an empty DB, err == io.EOF is returend.
703+
// if any. For an empty DB, err == io.EOF is returned.
701704
//
702705
// SeekFirst is atomic and it is safe for concurrent use by multiple
703706
// goroutines.
@@ -721,7 +724,7 @@ func (db *DB) SeekFirst() (enum *Enumerator, err error) {
721724
}
722725

723726
// SeekLast returns an enumerator positioned on the last KV pair in the DB,
724-
// if any. For an empty DB, err == io.EOF is returend.
727+
// if any. For an empty DB, err == io.EOF is returned.
725728
//
726729
// SeekLast is atomic and it is safe for concurrent use by multiple
727730
// goroutines.
@@ -763,7 +766,7 @@ func (db *DB) Set(key, value []byte) (err error) {
763766
// enumerator is aware of any mutations made to the tree in the process of
764767
// enumerating it and automatically resumes the enumeration.
765768
//
766-
// Multiple consurrently executing enumerations may be in progress.
769+
// Multiple concurrently executing enumerations may be in progress.
767770
type Enumerator struct {
768771
db *DB
769772
enum *lldb.BTreeEnumerator

0 commit comments

Comments
 (0)