blockio

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckpointExt = "ckp"
)

Variables

This section is empty.

Functions

func BlockRead

func BlockRead(
	ctx context.Context,
	info *pkgcatalog.BlockInfo,
	columns []string,
	colIdxs []uint16,
	colTypes []types.Type,
	colNulls []bool,
	tableDef *plan.TableDef,
	ts timestamp.Timestamp,
	fs fileservice.FileService,
	pool *mpool.MPool) (*batch.Batch, error)

BlockRead read block data from storage and apply deletes according given timestamp. Caller make sure metaloc is not empty

func BlockReadInner

func BlockReadInner(
	ctx context.Context,
	info *pkgcatalog.BlockInfo,
	schemaColCnt int,
	colNames []string,
	colIdxs []uint16,
	colTyps []types.Type,
	colNulls []bool,
	ts types.TS,
	fs fileservice.FileService,
	pool *mpool.MPool) (*containers.Batch, error)

func DecodeCheckpointMetadataFileName

func DecodeCheckpointMetadataFileName(name string) (start, end types.TS)

func DecodeMetaLoc

func DecodeMetaLoc(metaLoc string) (string, objectio.Extent, uint32)

func DecodeMetaLocToMetas

func DecodeMetaLocToMetas(metaLoc string) (string, []objectio.Extent, error)

func EncodeCheckpointMetadataFileName

func EncodeCheckpointMetadataFileName(dir, prefix string, start, end types.TS) string

func EncodeMetaLocWithObject

func EncodeMetaLocWithObject(
	extent objectio.Extent,
	rows uint32,
	blocks []objectio.BlockObject) (string, error)

EncodeMetaLocWithObject Generate a metaloc from an object file

func EncodeMetalocFromMetas

func EncodeMetalocFromMetas(name string, blks []objectio.BlockObject) string

func EncodeObjectName

func EncodeObjectName() (name string)

EncodeObjectName Generate uuid as the file name of the block&segment

func GetObjectSizeWithBlocks

func GetObjectSizeWithBlocks(blocks []objectio.BlockObject) (uint32, error)

Types

type Delta

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

func DecodeDeltaLocToDelta

func DecodeDeltaLocToDelta(metaLoc string) (*Delta, error)

func (*Delta) GetKey

func (d *Delta) GetKey() string

func (*Delta) GetLoc

func (d *Delta) GetLoc() objectio.Extent

func (*Delta) GetObjectSize

func (d *Delta) GetObjectSize() uint32

type Meta

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

func DecodeMetaLocToMeta

func DecodeMetaLocToMeta(metaLoc string) (*Meta, error)

func (*Meta) GetKey

func (m *Meta) GetKey() string

func (*Meta) GetLoc

func (m *Meta) GetLoc() objectio.Extent

func (*Meta) GetObjectSize

func (m *Meta) GetObjectSize() uint32

func (*Meta) GetRows

func (m *Meta) GetRows() uint32

type Reader

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

func NewCheckpointReader

func NewCheckpointReader(fs fileservice.FileService, key string) (*Reader, error)

func NewReader

func NewReader(cxt context.Context, fs *objectio.ObjectFS, key string) (*Reader, error)

func (*Reader) GetDataObject

func (r *Reader) GetDataObject(idx uint16, m *mpool.MPool) objectio.ColumnObject

func (*Reader) LoadBlkColumnsByMeta

func (r *Reader) LoadBlkColumnsByMeta(
	colTypes []types.Type,
	colNames []string,
	nullables []bool,
	block objectio.BlockObject) (*containers.Batch, error)

func (*Reader) LoadBlkColumnsByMetaAndIdx

func (r *Reader) LoadBlkColumnsByMetaAndIdx(
	colTypes []types.Type,
	colNames []string,
	nullables []bool,
	block objectio.BlockObject,
	idx int) (*containers.Batch, error)

func (*Reader) ReadMeta

func (r *Reader) ReadMeta(m *mpool.MPool) (objectio.BlockObject, error)

func (*Reader) ReadMetas

func (r *Reader) ReadMetas(m *mpool.MPool) ([]objectio.BlockObject, error)

type Writer

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

func NewWriter

func NewWriter(ctx context.Context, fs *objectio.ObjectFS, name string) *Writer

func (*Writer) GetWriter

func (w *Writer) GetWriter() objectio.Writer

func (*Writer) Sync

func (w *Writer) Sync() ([]objectio.BlockObject, error)

func (*Writer) WriteBlock

func (w *Writer) WriteBlock(columns *containers.Batch) (block objectio.BlockObject, err error)

func (*Writer) WriteIndex

func (w *Writer) WriteIndex(
	block objectio.BlockObject,
	index objectio.IndexData) (err error)

Jump to

Keyboard shortcuts

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