mergeset

package
v1.18.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2019 License: Apache-2.0 Imports: 23 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table represents mergeset table.

func OpenTable

func OpenTable(path string) (*Table, error)

OpenTable opens a table on the given path.

The table is created if it doesn't exist yet.

func (*Table) AddItems

func (tb *Table) AddItems(items [][]byte) error

AddItems adds the given items to the tb.

func (*Table) CreateSnapshotAt

func (tb *Table) CreateSnapshotAt(dstDir string) error

CreateSnapshotAt creates tb snapshot in the given dstDir.

Snapshot is created using linux hard links, so it is usually created very quickly.

func (*Table) DebugFlush

func (tb *Table) DebugFlush()

DebugFlush flushes all the added items to the storage, so they become visible to search.

This function is only for debugging and testing.

func (*Table) MustClose

func (tb *Table) MustClose()

MustClose closes the table.

func (*Table) Path

func (tb *Table) Path() string

Path returns the path to tb on the filesystem.

func (*Table) UpdateMetrics

func (tb *Table) UpdateMetrics(m *TableMetrics)

UpdateMetrics updates m with metrics from tb.

type TableMetrics

type TableMetrics struct {
	ActiveMerges   uint64
	MergesCount    uint64
	ItemsMerged    uint64
	AssistedMerges uint64

	PendingItems uint64

	PartsCount uint64

	BlocksCount uint64
	ItemsCount  uint64

	DataBlocksCacheSize     uint64
	DataBlocksCacheRequests uint64
	DataBlocksCacheMisses   uint64

	IndexBlocksCacheSize     uint64
	IndexBlocksCacheRequests uint64
	IndexBlocksCacheMisses   uint64

	PartsRefCount uint64
}

TableMetrics contains essential metrics for the Table.

type TableSearch

type TableSearch struct {
	// Item contains the next item after successful NextItem
	// or FirstItemWithPrefix call.
	//
	// Item contents breaks after the next call to NextItem.
	Item []byte
	// contains filtered or unexported fields
}

TableSearch is a reusable cursor used for searching in the Table.

func (*TableSearch) Error

func (ts *TableSearch) Error() error

Error returns the last error in ts.

func (*TableSearch) FirstItemWithPrefix

func (ts *TableSearch) FirstItemWithPrefix(prefix []byte) error

FirstItemWithPrefix seeks for the first item with the given prefix in the ts.

It returns io.EOF if such an item doesn't exist.

func (*TableSearch) Init

func (ts *TableSearch) Init(tb *Table)

Init initializes ts for searching in the tb.

MustClose must be called when the ts is no longer needed.

func (*TableSearch) MustClose

func (ts *TableSearch) MustClose()

MustClose closes the ts.

func (*TableSearch) NextItem

func (ts *TableSearch) NextItem() bool

NextItem advances to the next item.

func (*TableSearch) Seek

func (ts *TableSearch) Seek(k []byte)

Seek seeks for the first item greater or equal to k in the ts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL