Documentation
¶
Index ¶
- func GenerateUniqueSegmentName(time time.Time) string
- func Merge(tables ...*SSTable) <-chan *pb.SSTable_Entry
- func Split(in <-chan *pb.SSTable_Entry, maxSize int, tableOpts *Opts) <-chan *SSTable
- type Opts
- type SSTable
- func (table *SSTable) Close() error
- func (table *SSTable) LoadFilter() error
- func (table *SSTable) Open() error
- func (table *SSTable) Overlaps(anotherTable *SSTable) bool
- func (table *SSTable) SaveFilter() error
- func (table *SSTable) Search(key []byte) ([]byte, bool)
- func (table *SSTable) Sync() (int64, error)
- func (table *SSTable) ToProto() (*pb.SSTable, error)
- func (table *SSTable) WriteTo(writer io.Writer) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateUniqueSegmentName ¶
Generate a unique SSTable filename in the format TIMESTAMP_UNIQUESTRING.segment
func Merge ¶
func Merge(tables ...*SSTable) <-chan *pb.SSTable_Entry
Return sorted output stream of SSTable_Entry from an arbitrary number of tables
Types ¶
type SSTable ¶
type SSTable struct { Entries []*pb.SSTable_Entry // A list of entries sorted by key Filter *filter.BloomFilter // Check if key could be in table Size int64 // Size of file in bytes Name string // full filename First []byte // First key in range Last []byte // Last key in range CreatedOn time.Time // Timestamp // contains filtered or unexported fields }
SSTable represents a Sorted String Table. Entries are sorted by key.
func Overlapping ¶
Return tables from lower_level that overlap upper_table
func (*SSTable) Close ¶
Clears entries, unlocks table, and closes file
Should only be called after prior call to Open()
func (*SSTable) LoadFilter ¶
func (*SSTable) Open ¶
Read entries into memory & locks table
*** You must call Close() after opening table
func (*SSTable) SaveFilter ¶
func (*SSTable) Search ¶
Search searches for a key in the SSTable.
Panics if attempt to search empty entries array
Click to show internal directories.
Click to hide internal directories.