Skip to content

Commit 81b3cb9

Browse files
authored
fix(docs): fix typos (#2227)
**Description** Fix typos found via `codespell -S CHANGELOG.md -L fo,committs,nd,hights,abd,hel,mmaped,siz` **Checklist** - [x] Code compiles correctly and linting passes locally - [ ] For all _code_ changes, an entry added to the `CHANGELOG.md` file describing and linking to this PR - [ ] Tests added for new functionality, or regression tests for bug fixes added as applicable - [ ] For public APIs, new features, etc., PR on [docs repo](https://github.com/hypermodeinc/docs) staged and linked here
1 parent b61f866 commit 81b3cb9

19 files changed

+27
-27
lines changed

badger/cmd/bank.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func get(txn *badger.Txn, k []byte) (*badger.Item, error) {
206206
return nil, badger.ErrKeyNotFound
207207
}
208208

209-
// seekTotal retrives the total of all accounts by seeking for each account key.
209+
// seekTotal retrieves the total of all accounts by seeking for each account key.
210210
func seekTotal(txn *badger.Txn) ([]account, error) {
211211
expected := uint64(numAccounts) * initialBal
212212
var accounts []account
@@ -298,7 +298,7 @@ func compareTwo(db *badger.DB, before, after uint64) {
298298

299299
func runDisect(cmd *cobra.Command, args []string) error {
300300
// The total did not match up. So, let's disect the DB to find the
301-
// transction which caused the total mismatch.
301+
// transaction which caused the total mismatch.
302302
db, err := badger.OpenManaged(badger.DefaultOptions(sstDir).
303303
WithValueDir(vlogDir).
304304
WithReadOnly(true).

badger/cmd/read_bench.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func getSampleKeys(db *badger.DB, sampleSize int) ([][]byte, error) {
185185
count := 0
186186
stream := db.NewStreamAt(math.MaxUint64)
187187

188-
// overide stream.KeyToList as we only want keys. Also
188+
// override stream.KeyToList as we only want keys. Also
189189
// we can take only first version for the key.
190190
stream.KeyToList = func(key []byte, itr *badger.Iterator) (*pb.KVList, error) {
191191
l := &pb.KVList{}

badger/cmd/write_bench.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func init() {
102102
"If it is true, badger will encrypt all the data stored on the disk.")
103103
writeBenchCmd.Flags().BoolVar(&wo.loadBloomsOnOpen, "load-blooms", true,
104104
"Load Bloom filter on DB open.")
105-
writeBenchCmd.Flags().BoolVar(&wo.detectConflicts, "conficts", false,
105+
writeBenchCmd.Flags().BoolVar(&wo.detectConflicts, "conflicts", false,
106106
"If true, it badger will detect the conflicts")
107107
writeBenchCmd.Flags().BoolVar(&wo.zstdComp, "zstd", false,
108108
"If true, badger will use ZSTD mode. Otherwise, use default.")

db.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ func (db *DB) dropAll() (func(), error) {
17001700
return f, err
17011701
}
17021702
// prepareToDrop will stop all the incoming write and flushes any pending memtables.
1703-
// Before we drop, we'll stop the compaction because anyways all the datas are going to
1703+
// Before we drop, we'll stop the compaction because anyways all the data are going to
17041704
// be deleted.
17051705
db.stopCompactions()
17061706
resume := func() {

db2_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ func TestL0GCBug(t *testing.T) {
605605
t.Fatalf(err.Error())
606606
}
607607
}
608-
// Ensure alteast one GC call was successful.
608+
// Ensure at least one GC call was successful.
609609
require.NotZero(t, success)
610610
// CheckKeys reads all the keys previously stored.
611611
checkKeys := func(db *DB) {
@@ -700,7 +700,7 @@ func TestWindowsDataLoss(t *testing.T) {
700700
require.NoError(t, db.valueDirGuard.release())
701701
}
702702
// Don't use vlog.Close here. We don't want to fix the file size. Only un-mmap
703-
// the data so that we can truncate the file durning the next vlog.Open.
703+
// the data so that we can truncate the file during the next vlog.Open.
704704
require.NoError(t, z.Munmap(db.vlog.filesMap[db.vlog.maxFid].Data))
705705
for _, f := range db.vlog.filesMap {
706706
require.NoError(t, f.Fd.Close())

db_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
// have occurred on the channel `ch`. We log messages or generate errors using `t`.
3535
func waitForMessage(ch chan string, expected string, count int, timeout int, t *testing.T) {
3636
if count <= 0 {
37-
t.Logf("Will skip waiting for %s since exected count <= 0.",
37+
t.Logf("Will skip waiting for %s since expected count <= 0.",
3838
expected)
3939
return
4040
}
@@ -504,7 +504,7 @@ func dirSize(path string) (int64, error) {
504504
// New keys are created with each for-loop iteration. During each
505505
// iteration, the previous for-loop iteration's keys are deleted.
506506
//
507-
// To reproduce continous growth problem due to `badgerMove` keys,
507+
// To reproduce continuous growth problem due to `badgerMove` keys,
508508
// update `value.go` `discardEntry` line 1628 to return false
509509
//
510510
// Also with PR #1303, the delete keys are properly cleaned which
@@ -2169,7 +2169,7 @@ func TestForceFlushMemtable(t *testing.T) {
21692169
ops.ValueLogMaxEntries = 1
21702170

21712171
db, err := Open(ops)
2172-
require.NoError(t, err, "error while openning db")
2172+
require.NoError(t, err, "error while opening db")
21732173
defer func() { require.NoError(t, db.Close()) }()
21742174

21752175
for i := 0; i < 3; i++ {

dir_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func acquireDirectoryLock(dirPath string, pidFileName string, readOnly bool) (*d
7474
// FILE_ATTRIBUTE_TEMPORARY is used to tell Windows to try to create the handle in memory.
7575
// FILE_FLAG_DELETE_ON_CLOSE is not specified in syscall_windows.go but tells Windows to delete
7676
// the file when all processes holding the handler are closed.
77-
// XXX: this works but it's a bit klunky. i'd prefer to use LockFileEx but it needs unsafe pkg.
77+
// XXX: this works but it's a bit clunky. i'd prefer to use LockFileEx but it needs unsafe pkg.
7878
h, err := syscall.CreateFile(
7979
syscall.StringToUTF16Ptr(absLockFilePath), 0, 0, nil,
8080
syscall.OPEN_ALWAYS,

errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var (
3333
// ErrReadOnlyTxn is returned if an update function is called on a read-only transaction.
3434
ErrReadOnlyTxn = stderrors.New("No sets or deletes are allowed in a read-only transaction")
3535

36-
// ErrDiscardedTxn is returned if a previously discarded transaction is re-used.
36+
// ErrDiscardedTxn is returned if a previously discarded transaction is reused.
3737
ErrDiscardedTxn = stderrors.New("This transaction has been discarded. Create a new one")
3838

3939
// ErrEmptyKey is returned if an empty key is passed on an update function.

key_registry.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ func WriteKeyRegistry(reg *KeyRegistry, opt KeyRegistryOptions) error {
246246
var err error
247247
eSanity, err = y.XORBlockAllocate(eSanity, opt.EncryptionKey, iv)
248248
if err != nil {
249-
return y.Wrapf(err, "Error while encrpting sanity text in WriteKeyRegistry")
249+
return y.Wrapf(err, "Error while encrypting sanity text in WriteKeyRegistry")
250250
}
251251
}
252252
y.Check2(buf.Write(iv))
@@ -310,7 +310,7 @@ func (kr *KeyRegistry) LatestDataKey() (*pb.DataKey, error) {
310310
// validKey return datakey if the last generated key duration less than
311311
// rotation duration.
312312
validKey := func() (*pb.DataKey, bool) {
313-
// Time diffrence from the last generated time.
313+
// Time difference from the last generated time.
314314
diff := time.Since(time.Unix(kr.lastCreated, 0))
315315
if diff < kr.opt.EncryptionKeyRotationDuration {
316316
return kr.dataKeys[kr.nextKeyID], true

levels.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@ func (s *levelsController) addLevel0Table(t *table.Table) error {
15731573
}
15741574

15751575
for !s.levels[0].tryAddLevel0Table(t) {
1576-
// Before we unstall, we need to make sure that level 0 is healthy.
1576+
// Before we uninstall, we need to make sure that level 0 is healthy.
15771577
timeStart := time.Now()
15781578
for s.levels[0].numTables() >= s.kv.opt.NumLevelZeroTablesStall {
15791579
time.Sleep(10 * time.Millisecond)

0 commit comments

Comments
 (0)