tableutil

package
v0.58.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBuffer

func FromBuffer(cr flux.ColReader) flux.Table

FromBuffer constructs a flux.Table from a single flux.ColReader.

func Stream

func Stream(key flux.GroupKey, cols []flux.ColMeta, f func(ctx context.Context, w *StreamWriter) error) (flux.Table, error)

Stream will call StreamWithContext with a background context.

func StreamWithContext

func StreamWithContext(ctx context.Context, key flux.GroupKey, cols []flux.ColMeta, f func(ctx context.Context, w *StreamWriter) error) (flux.Table, error)

StreamWithContext will create a table that streams column readers through the flux.Table. This method will return only after the function buffers the first column reader. This first column reader is used to identify the group key and columns for the entire table stream.

Implementors using this *must* return at least one table. If the function returns without returning at least one table, then an error will be returned. If the first table that is returned is empty, then this will return an empty table and further buffers will not be used.

func Values added in v0.56.0

func Values(cr flux.ColReader, j int) array.Interface

Values returns the array from the column reader as an array.Interface.

Types

type BufferedTable

type BufferedTable struct {
	GroupKey flux.GroupKey
	Columns  []flux.ColMeta
	Buffers  []flux.ColReader
	// contains filtered or unexported fields
}

BufferedTable represents a table of buffered column readers.

func (*BufferedTable) Cols

func (b *BufferedTable) Cols() []flux.ColMeta

func (*BufferedTable) Do

func (b *BufferedTable) Do(f func(flux.ColReader) error) error

func (*BufferedTable) Done

func (b *BufferedTable) Done()

func (*BufferedTable) Empty

func (b *BufferedTable) Empty() bool

func (*BufferedTable) Key

func (b *BufferedTable) Key() flux.GroupKey

type SendFunc

type SendFunc func(flux.ColReader)

SendFunc is used to send a flux.ColReader to a table stream so it can be read by the table consumer.

type StreamWriter added in v0.56.0

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

StreamWriter is the input end of a stream.

func (*StreamWriter) Cols added in v0.56.0

func (s *StreamWriter) Cols() []flux.ColMeta

func (*StreamWriter) Key added in v0.56.0

func (s *StreamWriter) Key() flux.GroupKey

func (*StreamWriter) UnsafeWrite added in v0.56.0

func (s *StreamWriter) UnsafeWrite(vs []array.Interface) error

UnsafeWrite will write the new buffer to the stream without validating that the resulting table is valid. This can be used to avoid the small performance hit that comes from validating the resulting table.

func (*StreamWriter) UnsafeWriteBuffer added in v0.56.0

func (s *StreamWriter) UnsafeWriteBuffer(cr flux.ColReader) error

UnsafeWriteBuffer will emit the given column reader to the stream. This does not validate that the column reader matches with the stream schema.

func (*StreamWriter) Write added in v0.56.0

func (s *StreamWriter) Write(vs []array.Interface) error

Write will write a new buffer to the stream using the given values. The group key and columns will be used for the emitted column reader.

Jump to

Keyboard shortcuts

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