Documentation
¶
Index ¶
- Variables
- func After(a, b []byte) bool
- func GenerateMockHfile(path string, keyCount, blockSize int, compress, progress bool) error
- func GenerateMockMultiHfile(path string, keyCount, blockSize int, compress, progress bool) error
- func MockKeyInt(i int) []byte
- func MockMultiValueInt(i, k int) []byte
- func MockValueForMockKey(key []byte) []byte
- func MockValueInt(i int) []byte
- func WriteMockIntPairs(w *Writer, keyCount int, progress bool, multi bool) error
- type Block
- type FileInfo
- type Iterator
- func (it *Iterator) AllForPrefixes(prefixes [][]byte, limit int32, lastKey []byte) (map[string][][]byte, []byte, error)
- func (it *Iterator) Key() []byte
- func (it *Iterator) Next() (bool, error)
- func (it *Iterator) Release()
- func (it *Iterator) Reset()
- func (it *Iterator) Seek(requested []byte) (bool, error)
- func (it *Iterator) Value() []byte
- type OrderedOps
- type Reader
- func (r *Reader) CalculateBloom(falsePosRate float64) error
- func (r *Reader) DisableBloom()
- func (r *Reader) EnableBloom()
- func (r *Reader) FindBlock(from int, key []byte) int
- func (r *Reader) FirstKey() ([]byte, error)
- func (r *Reader) GetBlockBuf(i int, dst []byte) ([]byte, error)
- func (r *Reader) GetIterator() *Iterator
- func (r *Reader) GetScanner() *Scanner
- func (r *Reader) MightContain(key []byte) bool
- func (r *Reader) PrintDebugInfo(out io.Writer, includeStartKeys int)
- type Scanner
- type Trailer
- type Writer
Constants ¶
This section is empty.
Variables ¶
var CompressionNone = uint32(2)
var CompressionSnappy = uint32(3)
var DataMagic = []byte("DATABLK*")
var IndexMagic = []byte("IDXBLK)+")
var TrailerMagic = []byte("TRABLK\"$")
Functions ¶
func GenerateMockHfile ¶
func GenerateMockMultiHfile ¶
func MockKeyInt ¶
func MockMultiValueInt ¶
func MockValueForMockKey ¶
func MockValueInt ¶
Types ¶
type Iterator ¶
type Iterator struct {
OrderedOps
// contains filtered or unexported fields
}
func NewIterator ¶
func (*Iterator) AllForPrefixes ¶
func (*Iterator) Key ¶
A copy of the current key it.key is a pointer into a buffer that may get recycled for another block, thus the copy.
func (*Iterator) Next ¶
Load a kv pair into it.key/it.value and advance the iterator. Return true if a kv pair was loaded (eg can call Key), or false if at EOF.
func (*Iterator) Seek ¶
Position the iterator at-or-after requested key by seeking forward from current position.
If already at-or-after, this is a no-op. Otherwise, if the requested key exists, it will be positioned there, otherwise at the first key greater than the requested one. Returns true if, after positioning, the iterator is on a valid key (eg not at EOF), same as Next.
type OrderedOps ¶
type OrderedOps struct {
// contains filtered or unexported fields
}
func (*OrderedOps) CheckIfKeyOutOfOrder ¶
func (s *OrderedOps) CheckIfKeyOutOfOrder(key []byte) error
func (*OrderedOps) ResetState ¶
func (s *OrderedOps) ResetState()
func (*OrderedOps) Same ¶
func (s *OrderedOps) Same(key []byte) bool
type Reader ¶
func (*Reader) CalculateBloom ¶
func (*Reader) DisableBloom ¶
func (r *Reader) DisableBloom()
func (*Reader) EnableBloom ¶
func (r *Reader) EnableBloom()
func (*Reader) GetIterator ¶
func (*Reader) GetScanner ¶
func (*Reader) MightContain ¶
type Scanner ¶
type Scanner struct {
// When off, maybe be faster but may return incorrect results rather than error on out-of-order keys.
EnforceKeyOrder bool
OrderedOps
// contains filtered or unexported fields
}
func NewScanner ¶
type Writer ¶
type Writer struct {
OrderedOps
// contains filtered or unexported fields
}