Documentation ¶
Overview ¶
Package nbf provides TableReadCloser and TableWriteCloser implementations for working with dolt tables in noms.
Index ¶
- func SqlRowFromTuples(sch schema.Schema, key, val types.Tuple) (sql.Row, error)
- type CardinalityCounter
- type InRangeCheck
- type InRangeCheckAlways
- type InRangeCheckNever
- type InRangeCheckPartial
- type KeyIterator
- type NomsMapReader
- type NomsMapReaderForKeys
- type NomsRangeReader
- func (nrr *NomsRangeReader) Close(ctx context.Context) error
- func (nrr *NomsRangeReader) GetSchema() schema.Schema
- func (nrr *NomsRangeReader) ReadKV(ctx context.Context) (types.Tuple, types.Tuple, error)
- func (nrr *NomsRangeReader) ReadKey(ctx context.Context) (types.Tuple, error)
- func (nrr *NomsRangeReader) ReadRow(ctx context.Context) (row.Row, error)
- func (nrr *NomsRangeReader) VerifySchema(outSch schema.Schema) (bool, error)
- type ReadRange
- func NewRangeEndingAt(key types.Tuple, inRangeCheck InRangeCheck) *ReadRange
- func NewRangeEndingBefore(key types.Tuple, inRangeCheck InRangeCheck) *ReadRange
- func NewRangeStartingAfter(key types.Tuple, inRangeCheck InRangeCheck) *ReadRange
- func NewRangeStartingAt(key types.Tuple, inRangeCheck InRangeCheck) *ReadRange
- type SliceOfKeysIterator
- type StatsCB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CardinalityCounter ¶
type CardinalityCounter struct {
// contains filtered or unexported fields
}
func NewCardinalityCounter ¶
func NewCardinalityCounter() *CardinalityCounter
type InRangeCheck ¶
type InRangeCheck interface { // Check is a call made as the reader reads through values to check that the next value either being read is valid // and whether it should be skipped or returned. Check(ctx context.Context, tuple types.Tuple) (valid bool, skip bool, err error) }
InRangeCheck evaluates tuples to determine whether they are valid and/or should be skipped.
type InRangeCheckAlways ¶
type InRangeCheckAlways struct{}
InRangeCheckAlways will always return that the given tuple is valid and not to be skipped.
type InRangeCheckNever ¶
type InRangeCheckNever struct{}
InRangeCheckNever will always return that the given tuple is not valid.
type InRangeCheckPartial ¶
InRangeCheckPartial will check if the given tuple contains the aliased tuple as a partial key.
type KeyIterator ¶
type KeyIterator interface { // Next returns the next key in the collection. When all keys are exhausted nil, io.EOF must be returned. Next() (types.Value, error) }
KeyIterator is an interface for iterating through a collection of keys
type NomsMapReader ¶
type NomsMapReader struct {
// contains filtered or unexported fields
}
NomsMapReader is a TableReader that reads rows from a noms table which is stored in a types.Map where the key is a types.Value and the value is a types.Tuple of field values.
func NewNomsMapReader ¶
NewNomsMapReader creates a NomsMapReader for a given noms types.Map
func (*NomsMapReader) Close ¶
func (nmr *NomsMapReader) Close(ctx context.Context) error
Close should release resources being held
func (*NomsMapReader) GetSchema ¶
func (nmr *NomsMapReader) GetSchema() schema.Schema
GetSchema gets the schema of the rows that this reader will return
func (*NomsMapReader) ReadRow ¶
ReadRow reads a row from a table. If there is a bad row the returned error will be non nil, and callin IsBadRow(err) will be return true. This is a potentially non-fatal error and callers can decide if they want to continue on a bad row, or fail.
func (*NomsMapReader) VerifySchema ¶
func (nmr *NomsMapReader) VerifySchema(outSch schema.Schema) (bool, error)
VerifySchema checks that the incoming schema matches the schema from the existing table
type NomsMapReaderForKeys ¶
type NomsMapReaderForKeys struct {
// contains filtered or unexported fields
}
NomsMapReaderForKeys implements TableReadCloser
func NewNomsMapReaderForKeyItr ¶
func NewNomsMapReaderForKeyItr(m types.Map, sch schema.Schema, keyItr KeyIterator) *NomsMapReaderForKeys
NewNomsMapReaderForKeyItr creates a NomsMapReaderForKeys for a given noms types.Map, and a list of keys
func NewNomsMapReaderForKeys ¶
func NewNomsMapReaderForKeys(m types.Map, sch schema.Schema, keys []types.Tuple) *NomsMapReaderForKeys
NewNomsMapReaderForKeys creates a NomsMapReaderForKeys for a given noms types.Map, and a list of keys
func (*NomsMapReaderForKeys) Close ¶
func (nmr *NomsMapReaderForKeys) Close(ctx context.Context) error
Close should release resources being held
func (*NomsMapReaderForKeys) GetSchema ¶
func (nmr *NomsMapReaderForKeys) GetSchema() schema.Schema
GetSchema gets the schema of the rows being read.
func (*NomsMapReaderForKeys) ReadRow ¶
ReadRow reads a row from a table. If there is a bad row the returned error will be non nil, and calling IsBadRow(err) will be return true. This is a potentially non-fatal error and callers can decide if they want to continue on a bad row, or fail.
func (*NomsMapReaderForKeys) VerifySchema ¶
func (nmr *NomsMapReaderForKeys) VerifySchema(outSch schema.Schema) (bool, error)
VerifySchema checks that the incoming schema matches the schema from the existing table
type NomsRangeReader ¶
type NomsRangeReader struct {
// contains filtered or unexported fields
}
NomsRangeReader reads values in one or more ranges from a map
func NewNomsRangeReader ¶
NewNomsRangeReader creates a NomsRangeReader
func (*NomsRangeReader) Close ¶
func (nrr *NomsRangeReader) Close(ctx context.Context) error
Close should release resources being held
func (*NomsRangeReader) GetSchema ¶
func (nrr *NomsRangeReader) GetSchema() schema.Schema
GetSchema gets the schema of the rows being read.
func (*NomsRangeReader) ReadRow ¶
ReadRow reads a row from a table. If there is a bad row the returned error will be non nil, and calling IsBadRow(err) will be return true. This is a potentially non-fatal error and callers can decide if they want to continue on a bad row, or fail.
func (*NomsRangeReader) VerifySchema ¶
func (nrr *NomsRangeReader) VerifySchema(outSch schema.Schema) (bool, error)
VerifySchema checks that the incoming schema matches the schema from the existing table
type ReadRange ¶
type ReadRange struct { // Start is a Dolt map key which is the starting point (or ending point if Reverse is true) Start types.Tuple // Inclusive says whether the Start key should be included in the range. Inclusive bool // Reverse says if the range should be read in reverse (from high to low) instead of the default (low to high) Reverse bool // Check is a callb made as the reader reads through values to check that the next value being read is in the range. Check InRangeCheck }
ReadRange represents a range of values to be read
func NewRangeEndingAt ¶
func NewRangeEndingAt(key types.Tuple, inRangeCheck InRangeCheck) *ReadRange
NewRangeEndingAt creates a range with a starting key which will be iterated in reverse
func NewRangeEndingBefore ¶
func NewRangeEndingBefore(key types.Tuple, inRangeCheck InRangeCheck) *ReadRange
NewRangeEndingBefore creates a range starting before the provided key iterating in reverse
func NewRangeStartingAfter ¶
func NewRangeStartingAfter(key types.Tuple, inRangeCheck InRangeCheck) *ReadRange
NewRangeStartingAfter creates a range starting after the provided key
func NewRangeStartingAt ¶
func NewRangeStartingAt(key types.Tuple, inRangeCheck InRangeCheck) *ReadRange
NewRangeStartingAt creates a range with a starting key
type SliceOfKeysIterator ¶
type SliceOfKeysIterator struct {
// contains filtered or unexported fields
}
SliceOfKeysIterator is a KeyIterator implementation backed by a slice of keys which are iterated in order
type StatsCB ¶
type StatsCB func(stats types.AppliedEditStats)