package rowcache

import "github.com/vertica/vertica-sql-go/rowcache"

Index

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

Source Files

file.go memory.go

Version
v1.2.1
Published
Dec 10, 2021
Platform
windows/amd64
Imports
6 packages
Last checked
3 hours ago

Tools for package owners.