Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinitto committed Jan 5, 2023
1 parent 9df039a commit 107d63d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scdb/internal/buffers/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Buffer struct {
RightOffset uint64
}

// NewBuffer creates a new Buffer with the given left_offset
// NewBuffer creates a new Buffer with the given leftOffset
// FIXME: Add test for this
func NewBuffer(leftOffset uint64, data []byte, capacity uint64) *Buffer {
upperBound := uint64(math.Min(float64(len(data)), float64(capacity)))
Expand Down Expand Up @@ -50,7 +50,7 @@ func (b *Buffer) Contains(addr uint64) bool {
//
// It is possible for data appended to this buffer to make it exceed
// its capacity. However, after that Buffer.CanAppend will always return false
// So make sure you call `can_append()` always.
// So make sure you call `canAppend()` always.
// This is a trade-off that allows us to limit the number of re-allocations for buffers
func (b *Buffer) Append(data []byte) uint64 {
dataLength := len(data)
Expand Down
2 changes: 1 addition & 1 deletion scdb/internal/buffers/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (bp *BufferPool) AddrBelongsToKey(kvAddress uint64, key []byte) (bool, erro
}

// loop in reverse, starting at the back
// since the latest kv_buffers are the ones updated when new changes occur
// since the latest kvBuffers are the ones updated when new changes occur
kvBufLen := len(bp.kvBuffers)
for i := kvBufLen - 1; i >= 0; i-- {
buf := bp.kvBuffers[i]
Expand Down
2 changes: 1 addition & 1 deletion scdb/internal/entries/db_file_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (h *DbFileHeader) GetIndexOffset(key []byte) uint64 {
return HeaderSizeInBytes + (hash * IndexEntrySizeInBytes)
}

// GetIndexOffsetInNthBlock returns the index offset for the nth index block if `initial_offset` is the offset
// GetIndexOffsetInNthBlock returns the index offset for the nth index block if `initialOffset` is the offset
// in the top most index block `n` starts at zero where zero is the top most index block
func (h *DbFileHeader) GetIndexOffsetInNthBlock(initialOffset uint64, n uint64) (uint64, error) {
if n >= h.NumberOfIndexBlocks {
Expand Down

0 comments on commit 107d63d

Please sign in to comment.