rowcache

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileCache

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

FileCache stores rows from the wire and puts excess into a temporary file

func NewFileCache

func NewFileCache(rowLimit int) (*FileCache, error)

NewFileCache returns a file cache with a set row limit

func (*FileCache) AddRow

func (f *FileCache) AddRow(msg *msgs.BEDataRowMsg)

AddRow adds a row to the cache

func (*FileCache) Close

func (f *FileCache) Close() error

Close clears resources associated with the cache, deleting the temp file

func (*FileCache) Finalize

func (f *FileCache) Finalize() error

Finalize signals the end of rows from the wire and readies the cache for reading

func (*FileCache) GetRow

func (f *FileCache) GetRow() *msgs.BEDataRowMsg

GetRow pulls a row message out of the cache, returning nil of none remain

func (*FileCache) Peek

func (f *FileCache) Peek() *msgs.BEDataRowMsg

Peek returns the next row without changing the state

type MemoryCache

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

MemoryCache is a simple in memory row store

func NewMemoryCache

func NewMemoryCache(size int) *MemoryCache

NewMemoryCache initializes the memory store with a given size, but it can continue to grow

func (*MemoryCache) AddRow

func (m *MemoryCache) AddRow(msg *msgs.BEDataRowMsg)

AddRow adds a row to the store

func (*MemoryCache) Close

func (m *MemoryCache) Close() error

Close provides an opportunity to free resources, a noop for the memory cache

func (*MemoryCache) Finalize

func (m *MemoryCache) Finalize() error

Finalize signals the end of new rows, a noop for the memory cache

func (*MemoryCache) GetRow

func (m *MemoryCache) GetRow() *msgs.BEDataRowMsg

GetRow pulls a row from the cache, returning nil if none remain

func (*MemoryCache) Peek

func (m *MemoryCache) Peek() *msgs.BEDataRowMsg

Peek returns the next row without changing the state

Jump to

Keyboard shortcuts

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