Documentation ¶
Index ¶
- Constants
- Variables
- func NewFilename(id uint64, dir string) string
- func ParseFileID(name string) (uint64, bool)
- type Block
- type BlockIterator
- func (itr *BlockIterator) Close()
- func (itr *BlockIterator) Error() error
- func (itr *BlockIterator) Init()
- func (itr *BlockIterator) Key() []byte
- func (itr *BlockIterator) Next()
- func (itr *BlockIterator) Prev()
- func (itr *BlockIterator) Reset()
- func (itr *BlockIterator) Seek(key []byte, whence int)
- func (itr *BlockIterator) SeekToFirst()
- func (itr *BlockIterator) SeekToLast()
- func (itr *BlockIterator) Valid() bool
- func (itr *BlockIterator) Value() []byte
- type ConcatIterator
- func (s *ConcatIterator) Close()
- func (s *ConcatIterator) Key() []byte
- func (s *ConcatIterator) Name() string
- func (s *ConcatIterator) Next()
- func (s *ConcatIterator) Rewind()
- func (s *ConcatIterator) Seek(key []byte)
- func (s *ConcatIterator) Valid() bool
- func (s *ConcatIterator) Value() y.ValueStruct
- type Table
- func (t *Table) Biggest() []byte
- func (s *Table) Close()
- func (s *Table) DecrRef()
- func (t *Table) DoesNotHave(key []byte) bool
- func (t *Table) Filename() string
- func (t *Table) ID() uint64
- func (s *Table) IncrRef()
- func (t *Table) LoadToRAM()
- func (t *Table) Metadata() []byte
- func (t *Table) NewIterator(reversed bool) *TableIterator
- func (s *Table) Ref() int32
- func (t *Table) SetMetadata(meta []byte)
- func (t *Table) Size() int64
- func (t *Table) Smallest() []byte
- type TableBuilder
- type TableIterator
- func (itr *TableIterator) Close()
- func (itr *TableIterator) Error() error
- func (itr *TableIterator) Init()
- func (itr *TableIterator) Key() []byte
- func (s *TableIterator) Name() string
- func (s *TableIterator) Next()
- func (s *TableIterator) Rewind()
- func (s *TableIterator) Seek(key []byte)
- func (itr *TableIterator) Valid() bool
- func (itr *TableIterator) Value() y.ValueStruct
Constants ¶
const ( Nothing = iota MemoryMap LoadToRAM )
Variables ¶
var ( ORIGIN = 0 CURRENT = 1 )
var EOF = errors.New("End of mapped region")
Functions ¶
func NewFilename ¶
func ParseFileID ¶
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
func (Block) NewIterator ¶
func (b Block) NewIterator() *BlockIterator
type BlockIterator ¶
type BlockIterator struct {
// contains filtered or unexported fields
}
func (*BlockIterator) Close ¶
func (itr *BlockIterator) Close()
func (*BlockIterator) Error ¶
func (itr *BlockIterator) Error() error
func (*BlockIterator) Init ¶
func (itr *BlockIterator) Init()
func (*BlockIterator) Key ¶
func (itr *BlockIterator) Key() []byte
func (*BlockIterator) Next ¶
func (itr *BlockIterator) Next()
func (*BlockIterator) Prev ¶
func (itr *BlockIterator) Prev()
func (*BlockIterator) Reset ¶
func (itr *BlockIterator) Reset()
func (*BlockIterator) Seek ¶
func (itr *BlockIterator) Seek(key []byte, whence int)
Seek brings us to the first block element that is >= input key.
func (*BlockIterator) SeekToFirst ¶
func (itr *BlockIterator) SeekToFirst()
func (*BlockIterator) SeekToLast ¶
func (itr *BlockIterator) SeekToLast()
SeekToLast brings us to the last element. Valid should return true.
func (*BlockIterator) Valid ¶
func (itr *BlockIterator) Valid() bool
func (*BlockIterator) Value ¶
func (itr *BlockIterator) Value() []byte
type ConcatIterator ¶
type ConcatIterator struct {
// contains filtered or unexported fields
}
func NewConcatIterator ¶
func NewConcatIterator(tbls []*Table, reversed bool) *ConcatIterator
func (*ConcatIterator) Close ¶
func (s *ConcatIterator) Close()
func (*ConcatIterator) Key ¶
func (s *ConcatIterator) Key() []byte
func (*ConcatIterator) Name ¶
func (s *ConcatIterator) Name() string
func (*ConcatIterator) Rewind ¶
func (s *ConcatIterator) Rewind()
func (*ConcatIterator) Seek ¶
func (s *ConcatIterator) Seek(key []byte)
Seek brings us to element >= key if reversed is false. Otherwise, <= key.
func (*ConcatIterator) Valid ¶
func (s *ConcatIterator) Valid() bool
func (*ConcatIterator) Value ¶
func (s *ConcatIterator) Value() y.ValueStruct
type Table ¶
func (*Table) DoesNotHave ¶
func (*Table) NewIterator ¶
func (t *Table) NewIterator(reversed bool) *TableIterator
func (*Table) SetMetadata ¶
SetMetadata updates our metadata to the new metadata. For now, they must be of the same size.
type TableBuilder ¶
type TableBuilder struct {
// contains filtered or unexported fields
}
func NewTableBuilder ¶
func NewTableBuilder() *TableBuilder
func (*TableBuilder) Add ¶
func (b *TableBuilder) Add(key []byte, value y.ValueStruct) error
Add adds a key-value pair to the block. If doNotRestart is true, we will not restart even if b.counter >= restartInterval.
func (*TableBuilder) Close ¶
func (b *TableBuilder) Close()
Close closes the TableBuilder. Do not use buf field anymore.
func (*TableBuilder) Empty ¶
func (b *TableBuilder) Empty() bool
func (*TableBuilder) Finish ¶
func (b *TableBuilder) Finish(metadata []byte) []byte
Finish finishes the table by appending the index.
func (*TableBuilder) ReachedCapacity ¶
func (b *TableBuilder) ReachedCapacity(cap int64) bool
FinalSize returns the *rough* final size of the array, counting the header which is not yet written. TODO: Look into why there is a discrepancy. I suspect it is because of Write(empty, empty) at the end. The diff can vary.
type TableIterator ¶
type TableIterator struct {
// contains filtered or unexported fields
}
func (*TableIterator) Close ¶
func (itr *TableIterator) Close()
func (*TableIterator) Error ¶
func (itr *TableIterator) Error() error
func (*TableIterator) Init ¶
func (itr *TableIterator) Init()
func (*TableIterator) Key ¶
func (itr *TableIterator) Key() []byte
func (*TableIterator) Name ¶
func (s *TableIterator) Name() string
func (*TableIterator) Next ¶
func (s *TableIterator) Next()
func (*TableIterator) Rewind ¶
func (s *TableIterator) Rewind()
func (*TableIterator) Seek ¶
func (s *TableIterator) Seek(key []byte)
func (*TableIterator) Valid ¶
func (itr *TableIterator) Valid() bool
func (*TableIterator) Value ¶
func (itr *TableIterator) Value() y.ValueStruct