objectio

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Copyright 2021 Matrix Origin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	IOET_Empty   = 0
	IOET_ObjMeta = 1
	IOET_ColData = 2
	IOET_BF      = 3
	IOET_ZM      = 4
)
View Source
const (
	ExtentOff   = ObjectNameLen
	ExtentLen   = ExtentSize
	RowsOff     = ExtentOff + ExtentLen
	RowsLen     = 4
	BlockIDOff  = RowsOff + RowsLen
	BlockIDLen  = 2
	LocationLen = BlockIDOff + BlockIDLen
)
View Source
const (
	FileNumOff         = SegmentIdSize
	FileNumLen         = 2
	NameStringOff      = FileNumOff + FileNumLen
	NameStringLen      = 42 //uuid[36]+_[1]+filename[5]
	ObjectNameLen      = NameStringOff + NameStringLen
	ObjectNameShortLen = NameStringOff
)
View Source
const (
	SEQNUM_UPPER    = math.MaxUint16 - 5 // reserved 5 column for special committs、committs etc.
	SEQNUM_ROWID    = math.MaxUint16
	SEQNUM_ABORT    = math.MaxUint16 - 1
	SEQNUM_COMMITTS = math.MaxUint16 - 2
)
View Source
const (
	IOET_ObjectMeta_V1  = 1
	IOET_ColumnData_V1  = 1
	IOET_BloomFilter_V1 = 1
	IOET_ZoneMap_V1     = 1

	IOET_ObjectMeta_CurrVer  = IOET_ObjectMeta_V1
	IOET_ColumnData_CurrVer  = IOET_ColumnData_V1
	IOET_BloomFilter_CurrVer = IOET_BloomFilter_V1
	IOET_ZoneMap_CurrVer     = IOET_ZoneMap_V1
)
View Source
const (
	WriterNormal = iota
	WriterCheckpoint
	WriterQueryResult
	WriterGC
	WriterETL
)
View Source
const (
	ExtentSize = extentOriginOff + extentOriginLen
)
View Source
const FSName = "local"
View Source
const FooterSize = 64
View Source
const HeaderSize = 64
View Source
const IOEntryHeaderSize = 4
View Source
const Magic = 0xFFFFFFFF
View Source
const (
	SegmentIdSize = types.UuidSize
)
View Source
const Version = 1
View Source
const ZoneMapSize = index.ZMSize

Variables

View Source
var (
	BuildObjectMeta        = buildObjectMetaV1
	NewObjectWriterSpecial = newObjectWriterSpecialV1
	NewObjectWriter        = newObjectWriterV1
	NewObjectReaderWithStr = newObjectReaderWithStrV1
	NewObjectReader        = newObjectReaderV1
)
View Source
var BuildZM = index.BuildZM
View Source
var EmptyZm = [64]byte{}
View Source
var NameCheckPoint [NameStringOff]byte
View Source
var NameDiskCleaner [NameStringOff]byte
View Source
var NameNormal [NameStringOff]byte
View Source
var NameQueryResult [NameStringOff]byte
View Source
var NewZM = index.NewZM
View Source
var (
	RowidType types.Type
)

Functions

func BuildMetaData added in v0.8.0

func BuildMetaData(blkCount, colCount uint16) objectMetaV1

test used

func ConstructRowidColumn added in v0.8.0

func ConstructRowidColumn(
	id *Blockid, start, length uint32, mp *mpool.MPool,
) (vec *vector.Vector, err error)

func ConstructRowidColumnTo added in v0.8.0

func ConstructRowidColumnTo(
	vec *vector.Vector,
	id *Blockid, start, length uint32, mp *mpool.MPool,
) (err error)

func ConstructRowidColumnToWithSels added in v0.8.0

func ConstructRowidColumnToWithSels(
	vec *vector.Vector,
	id *Blockid,
	sels []int32,
	mp *mpool.MPool,
) (err error)

func Decode added in v0.8.0

func Decode(buf []byte) (any, error)

func DecodeColumnDataV1 added in v0.8.0

func DecodeColumnDataV1(buf []byte) (ioe any, err error)

func EncodeColumnDataV1 added in v0.8.0

func EncodeColumnDataV1(ioe any) (buf []byte, err error)

func EncodeIOEntryHeader added in v0.8.0

func EncodeIOEntryHeader(h *IOEntryHeader) []byte

func GetIOEntryCodec added in v0.8.0

func GetIOEntryCodec(h IOEntryHeader) (codec ioEntryCodec)

func InitMetaCache added in v0.8.0

func InitMetaCache(size int64)

func IsBlockInObject added in v0.8.0

func IsBlockInObject(blkID *types.Blockid, objID *ObjectName) bool

func IsEmptyBlkid added in v0.8.0

func IsEmptyBlkid(id *Blockid) bool

func IsEmptySegid added in v0.8.0

func IsEmptySegid(id *Segmentid) bool

func IsSameObjectLocVsMeta added in v0.8.0

func IsSameObjectLocVsMeta(location Location, meta ObjectMeta) bool

func IsSameObjectLocVsShort added in v0.8.0

func IsSameObjectLocVsShort(location Location, short *ObjectNameShort) bool

func NewRowid added in v0.8.0

func NewRowid(blkid *Blockid, offset uint32) *types.Rowid

func ReadAllBlocksWithMeta added in v0.8.0

func ReadAllBlocksWithMeta(
	ctx context.Context,
	meta *ObjectMeta,
	name string,
	cols []uint16,
	noLRUCache bool,
	m *mpool.MPool,
	fs fileservice.FileService,
	factory CacheConstructorFactory,
) (ioVec *fileservice.IOVector, err error)

func ReadBytes added in v0.8.0

func ReadBytes(r io.Reader) (buf []byte, n int64, err error)

func ReadExtent added in v0.8.0

func ReadExtent(
	ctx context.Context,
	name string,
	extent *Extent,
	noLRUCache bool,
	fs fileservice.FileService,
	factory CacheConstructorFactory,
) (v []byte, err error)

func ReadMultiBlocksWithMeta added in v0.8.0

func ReadMultiBlocksWithMeta(
	ctx context.Context,
	name string,
	meta *ObjectMeta,
	options map[uint16]*ReadBlockOptions,
	noLRUCache bool,
	m *mpool.MPool,
	fs fileservice.FileService,
	factory CacheConstructorFactory,
) (ioVec *fileservice.IOVector, err error)

func ReadOneBlock added in v0.8.0

func ReadOneBlock(
	ctx context.Context,
	meta *ObjectMeta,
	name string,
	blk uint16,
	seqnums []uint16,
	typs []types.Type,
	m *mpool.MPool,
	fs fileservice.FileService,
) (ioVec *fileservice.IOVector, err error)

func ReadOneBlockWithMeta added in v0.8.0

func ReadOneBlockWithMeta(
	ctx context.Context,
	meta *ObjectMeta,
	name string,
	blk uint16,
	seqnums []uint16,
	typs []types.Type,
	m *mpool.MPool,
	fs fileservice.FileService,
	factory CacheConstructorFactory,
) (ioVec *fileservice.IOVector, err error)

func ReadString added in v0.8.0

func ReadString(r io.Reader) (str string, n int64, err error)

func RegisterIOEnrtyCodec added in v0.8.0

func RegisterIOEnrtyCodec(h IOEntryHeader, encFn IOEncodeFunc, decFn IODecodeFunc)

func TmpNewFileservice

func TmpNewFileservice(ctx context.Context, dir string) fileservice.FileService

func WriteBytes added in v0.8.0

func WriteBytes(b []byte, w io.Writer) (n int64, err error)

func WriteString added in v0.8.0

func WriteString(str string, w io.Writer) (n int64, err error)

Types

type BlockHeader

type BlockHeader []byte

func BuildBlockHeader added in v0.8.0

func BuildBlockHeader() BlockHeader

func (BlockHeader) BFExtent added in v0.8.0

func (bh BlockHeader) BFExtent() Extent

func (BlockHeader) BlockID added in v0.8.0

func (bh BlockHeader) BlockID() *Blockid

func (BlockHeader) ColumnCount added in v0.8.0

func (bh BlockHeader) ColumnCount() uint16

func (BlockHeader) IsEmpty added in v0.8.0

func (bh BlockHeader) IsEmpty() bool

func (BlockHeader) MaxSeqnum added in v0.8.0

func (bh BlockHeader) MaxSeqnum() uint16

func (BlockHeader) MetaColumnCount added in v0.8.0

func (bh BlockHeader) MetaColumnCount() uint16

func (BlockHeader) MetaLocation added in v0.8.0

func (bh BlockHeader) MetaLocation() Extent

func (BlockHeader) Rows added in v0.8.0

func (bh BlockHeader) Rows() uint32

func (BlockHeader) Sequence added in v0.8.0

func (bh BlockHeader) Sequence() uint16

func (BlockHeader) SetBFExtent added in v0.8.0

func (bh BlockHeader) SetBFExtent(location Extent)

func (BlockHeader) SetBlockID added in v0.8.0

func (bh BlockHeader) SetBlockID(id *Blockid)

func (BlockHeader) SetColumnCount added in v0.8.0

func (bh BlockHeader) SetColumnCount(count uint16)

func (BlockHeader) SetMaxSeqnum added in v0.8.0

func (bh BlockHeader) SetMaxSeqnum(seqnum uint16)

func (BlockHeader) SetMetaColumnCount added in v0.8.0

func (bh BlockHeader) SetMetaColumnCount(count uint16)

func (BlockHeader) SetMetaLocation added in v0.8.0

func (bh BlockHeader) SetMetaLocation(location Extent)

func (BlockHeader) SetRows added in v0.8.0

func (bh BlockHeader) SetRows(rows uint32)

func (BlockHeader) SetSequence added in v0.8.0

func (bh BlockHeader) SetSequence(seq uint16)

func (BlockHeader) SetTableID added in v0.8.0

func (bh BlockHeader) SetTableID(id uint64)

func (BlockHeader) SetZoneMapArea added in v0.8.0

func (bh BlockHeader) SetZoneMapArea(location Extent)

func (BlockHeader) ShortName added in v0.8.0

func (bh BlockHeader) ShortName() *ObjectNameShort

func (BlockHeader) TableID added in v0.8.0

func (bh BlockHeader) TableID() uint64

func (BlockHeader) ZoneMapArea added in v0.8.0

func (bh BlockHeader) ZoneMapArea() Extent

type BlockIndex added in v0.8.0

type BlockIndex []byte

func BuildBlockIndex added in v0.8.0

func BuildBlockIndex(count uint32) BlockIndex

func (BlockIndex) BlockCount added in v0.8.0

func (oh BlockIndex) BlockCount() uint32

func (BlockIndex) BlockMetaPos added in v0.8.0

func (oh BlockIndex) BlockMetaPos(BlockID uint32) (uint32, uint32)

func (BlockIndex) Length added in v0.8.0

func (oh BlockIndex) Length() uint32

func (BlockIndex) SetBlockCount added in v0.8.0

func (oh BlockIndex) SetBlockCount(cnt uint32)

func (BlockIndex) SetBlockMetaPos added in v0.8.0

func (oh BlockIndex) SetBlockMetaPos(BlockID uint32, offset, length uint32)

type BlockObject

type BlockObject []byte

func BuildBlockMeta added in v0.8.0

func BuildBlockMeta(count uint16) BlockObject

func NewBlock

func NewBlock(seqnums *Seqnums) BlockObject

func (BlockObject) AddColumnMeta added in v0.8.0

func (bm BlockObject) AddColumnMeta(idx uint16, col ColumnMeta)

func (BlockObject) BlockHeader added in v0.8.0

func (bm BlockObject) BlockHeader() BlockHeader

func (BlockObject) ColumnMeta added in v0.8.0

func (bm BlockObject) ColumnMeta(seqnum uint16) ColumnMeta

ColumnMeta is for internal use only, it didn't consider the block does not contain the seqnum

func (BlockObject) GetColumnCount added in v0.8.0

func (bm BlockObject) GetColumnCount() uint16

func (BlockObject) GetExtent

func (bm BlockObject) GetExtent() Extent

func (BlockObject) GetID

func (bm BlockObject) GetID() uint16

func (BlockObject) GetMaxSeqnum added in v0.8.0

func (bm BlockObject) GetMaxSeqnum() uint16

func (BlockObject) GetMeta

func (bm BlockObject) GetMeta() BlockObject

func (BlockObject) GetMetaColumnCount added in v0.8.0

func (bm BlockObject) GetMetaColumnCount() uint16

func (BlockObject) GetRows

func (bm BlockObject) GetRows() uint32

func (BlockObject) IsEmpty added in v0.8.0

func (bm BlockObject) IsEmpty() bool

func (BlockObject) MustGetColumn added in v0.8.0

func (bm BlockObject) MustGetColumn(seqnum uint16) ColumnMeta

MustGetColumn is for general use. it return a empty ColumnMeta if the block does not contain the seqnum

func (BlockObject) SetBlockMetaHeader added in v0.8.0

func (bm BlockObject) SetBlockMetaHeader(header BlockHeader)

func (BlockObject) ToColumnZoneMaps added in v0.8.0

func (bm BlockObject) ToColumnZoneMaps(seqnums []uint16) []ZoneMap

type Blockid added in v0.8.0

type Blockid = types.Blockid

func BuildObjectBlockid added in v0.8.0

func BuildObjectBlockid(name ObjectName, sequence uint16) *Blockid

func NewBlockid added in v0.8.0

func NewBlockid(segid *Segmentid, fnum, blknum uint16) *Blockid

func Str2Blockid added in v0.8.0

func Str2Blockid(id string) *Blockid

type BloomFilter

type BloomFilter []byte

func ReadBloomFilter added in v0.8.0

func ReadBloomFilter(
	ctx context.Context,
	name string,
	extent *Extent,
	noLRUCache bool,
	fs fileservice.FileService,
) (filters BloomFilter, err error)

func (BloomFilter) BlockCount added in v0.8.0

func (bf BloomFilter) BlockCount() uint32

func (BloomFilter) GetBloomFilter added in v0.8.0

func (bf BloomFilter) GetBloomFilter(BlockID uint32) []byte

func (BloomFilter) GetObjectBloomFilter added in v0.8.0

func (bf BloomFilter) GetObjectBloomFilter() []byte

func (BloomFilter) Size added in v0.8.0

func (bf BloomFilter) Size() int

type CacheConfig added in v0.8.0

type CacheConfig struct {
	MemoryCapacity toml.ByteSize `toml:"memory-capacity"`
}

type CacheConstructor added in v0.8.0

type CacheConstructor = func(r io.Reader, buf []byte) ([]byte, int64, error)

type CacheConstructorFactory added in v0.8.0

type CacheConstructorFactory = func(size int64, algo uint8) CacheConstructor

type ColumnMeta

type ColumnMeta []byte

func BuildColumnMeta added in v0.8.0

func BuildColumnMeta() ColumnMeta

func BuildObjectColumnMeta added in v0.8.0

func BuildObjectColumnMeta() ColumnMeta

func GetColumnMeta added in v0.8.0

func GetColumnMeta(idx uint16, data []byte) ColumnMeta

func GetObjectColumnMeta added in v0.8.0

func GetObjectColumnMeta(seqnum uint16, data []byte) ColumnMeta

caller makes sure the data has column meta fot the given seqnum

func (ColumnMeta) Checksum added in v0.8.0

func (cm ColumnMeta) Checksum() uint32

func (ColumnMeta) DataType added in v0.8.0

func (cm ColumnMeta) DataType() uint8

func (ColumnMeta) Idx added in v0.8.0

func (cm ColumnMeta) Idx() uint16

func (ColumnMeta) IsEmpty added in v0.8.0

func (cm ColumnMeta) IsEmpty() bool

func (ColumnMeta) Location added in v0.8.0

func (cm ColumnMeta) Location() Extent

func (ColumnMeta) Ndv added in v0.8.0

func (cm ColumnMeta) Ndv() uint32

func (ColumnMeta) NullCnt added in v0.8.0

func (cm ColumnMeta) NullCnt() uint32

func (ColumnMeta) SetNdv added in v0.8.0

func (cm ColumnMeta) SetNdv(cnt uint32)

func (ColumnMeta) SetNullCnt added in v0.8.0

func (cm ColumnMeta) SetNullCnt(cnt uint32)

func (ColumnMeta) SetZoneMap added in v0.8.0

func (cm ColumnMeta) SetZoneMap(zm ZoneMap)

func (ColumnMeta) ZoneMap added in v0.8.0

func (cm ColumnMeta) ZoneMap() ZoneMap

type ColumnMetaFetcher added in v0.8.0

type ColumnMetaFetcher interface {
	MustGetColumn(seqnum uint16) ColumnMeta
}

type CreateBlockOpt added in v0.8.0

type CreateBlockOpt struct {
	Loc *struct {
		Metaloc  Location
		Deltaloc Location
	}

	Id *struct {
		Filen uint16
		Blkn  uint16
	}
}

func (*CreateBlockOpt) WithBlkIdx added in v0.8.0

func (o *CreateBlockOpt) WithBlkIdx(s uint16) *CreateBlockOpt

func (*CreateBlockOpt) WithDetaloc added in v0.8.0

func (o *CreateBlockOpt) WithDetaloc(s Location) *CreateBlockOpt

func (*CreateBlockOpt) WithFileIdx added in v0.8.0

func (o *CreateBlockOpt) WithFileIdx(s uint16) *CreateBlockOpt

func (*CreateBlockOpt) WithMetaloc added in v0.8.0

func (o *CreateBlockOpt) WithMetaloc(s Location) *CreateBlockOpt

type CreateSegOpt added in v0.8.0

type CreateSegOpt struct {
	Id *types.Uuid
}

func (*CreateSegOpt) WithId added in v0.8.0

func (o *CreateSegOpt) WithId(id *types.Uuid) *CreateSegOpt

type Extent

type Extent []byte

func NewExtent

func NewExtent(alg uint8, offset, length, originSize uint32) Extent

func (Extent) Alg added in v0.8.0

func (ex Extent) Alg() uint8

func (Extent) End

func (ex Extent) End() uint32

func (Extent) Length

func (ex Extent) Length() uint32

func (Extent) Offset

func (ex Extent) Offset() uint32

func (Extent) OriginSize

func (ex Extent) OriginSize() uint32

func (Extent) SetAlg added in v0.8.0

func (ex Extent) SetAlg(alg uint8)

func (Extent) SetLength added in v0.8.0

func (ex Extent) SetLength(length uint32)

func (Extent) SetOffset added in v0.8.0

func (ex Extent) SetOffset(offset uint32)

func (Extent) SetOriginSize added in v0.8.0

func (ex Extent) SetOriginSize(originSize uint32)

func (Extent) String added in v0.8.0

func (ex Extent) String() string
type Footer struct {
	// contains filtered or unexported fields
}

func (Footer) Marshal added in v0.8.0

func (f Footer) Marshal() []byte
type Header []byte

func BuildHeader added in v0.8.0

func BuildHeader() Header

func (Header) Extent added in v0.8.0

func (h Header) Extent() Extent

func (Header) SchemaVersion added in v0.8.0

func (h Header) SchemaVersion(ver uint32)

func (Header) SetExtent added in v0.8.0

func (h Header) SetExtent(location Extent)

func (Header) SetSchemaVersion added in v0.8.0

func (h Header) SetSchemaVersion(ver uint32)

type IODecodeFunc added in v0.8.0

type IODecodeFunc = func([]byte) (any, error)

type IOEncodeFunc added in v0.8.0

type IOEncodeFunc = func(any) ([]byte, error)

type IOEntry added in v0.8.0

type IOEntry interface {
	MarshalBinary() ([]byte, error)
	UnmarshalBinary([]byte) error
}

type IOEntryHeader added in v0.8.0

type IOEntryHeader struct {
	Type, Version uint16
}

func DecodeIOEntryHeader added in v0.8.0

func DecodeIOEntryHeader(buf []byte) *IOEntryHeader

func (IOEntryHeader) String added in v0.8.0

func (h IOEntryHeader) String() string

type Location added in v0.8.0

type Location []byte

Location is a fixed-length unmodifiable byte array. Layout: ObjectName | Extent | Rows(uint32) | ID(uint16)

func BuildLocation added in v0.8.0

func BuildLocation(name ObjectName, extent Extent, rows uint32, id uint16) Location

func MockLocation added in v0.8.0

func MockLocation(name ObjectName) Location

func (Location) Extent added in v0.8.0

func (l Location) Extent() Extent

func (Location) ID added in v0.8.0

func (l Location) ID() uint16

func (Location) IsEmpty added in v0.8.0

func (l Location) IsEmpty() bool

func (Location) Name added in v0.8.0

func (l Location) Name() ObjectName

func (Location) Rows added in v0.8.0

func (l Location) Rows() uint32

func (Location) ShortName added in v0.8.0

func (l Location) ShortName() *ObjectNameShort

func (Location) String added in v0.8.0

func (l Location) String() string

type Object

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

func NewObject

func NewObject(name string, fs fileservice.FileService) *Object

type ObjectBuffer

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

ObjectBuffer is the buffer prepared before writing to the object file, all data written to the object needs to be filled in it, and then written to the object file at one time

func NewObjectBuffer

func NewObjectBuffer(name string) *ObjectBuffer

func (*ObjectBuffer) GetData

func (b *ObjectBuffer) GetData() fileservice.IOVector

func (*ObjectBuffer) Length

func (b *ObjectBuffer) Length() int

func (*ObjectBuffer) SetDataOptions added in v0.7.0

func (b *ObjectBuffer) SetDataOptions(items ...WriteOptions)

func (*ObjectBuffer) Write

func (b *ObjectBuffer) Write(buf []byte, items ...WriteOptions) (int, int)

type ObjectFS

type ObjectFS struct {
	Service fileservice.FileService
	Dir     string
}

func NewObjectFS

func NewObjectFS(service fileservice.FileService, dir string) *ObjectFS

func (*ObjectFS) DelFiles added in v0.7.0

func (o *ObjectFS) DelFiles(ctx context.Context, name []string) error

func (*ObjectFS) Delete added in v0.7.0

func (o *ObjectFS) Delete(fileName string) error

func (*ObjectFS) ListDir

func (o *ObjectFS) ListDir(dir string) ([]fileservice.DirEntry, error)

type ObjectMeta added in v0.8.0

type ObjectMeta = objectMetaV1

func FastLoadObjectMeta added in v0.8.0

func FastLoadObjectMeta(ctx context.Context, location *Location, fs fileservice.FileService) (ObjectMeta, error)

func LoadObjectMetaByExtent added in v0.8.0

func LoadObjectMetaByExtent(
	ctx context.Context,
	name *ObjectName,
	extent *Extent,
	noLRUCache bool,
	fs fileservice.FileService) (meta ObjectMeta, err error)

func ReadObjectMeta added in v0.8.0

func ReadObjectMeta(
	ctx context.Context,
	name string,
	extent *Extent,
	noLRUCache bool,
	fs fileservice.FileService,
) (meta ObjectMeta, err error)

func ReadObjectMetaWithLocation added in v0.8.0

func ReadObjectMetaWithLocation(
	ctx context.Context,
	location *Location,
	noLRUCache bool,
	fs fileservice.FileService,
) (meta ObjectMeta, err error)

type ObjectName added in v0.8.0

type ObjectName []byte
 ObjectName is a fixed-length unmodifiable byte array.
 Layout: SegmentId     |   Num    |  NameStr
	     (types.Uuid)    (uint16)   (string)
 Size:	   16B         +   2B     +  42B

func BuildCheckpointName added in v0.8.0

func BuildCheckpointName() ObjectName

func BuildDiskCleanerName added in v0.8.0

func BuildDiskCleanerName() ObjectName

func BuildETLName added in v0.8.0

func BuildETLName() ObjectName

func BuildNormalName added in v0.8.0

func BuildNormalName() ObjectName

func BuildObjectName added in v0.8.0

func BuildObjectName(segid *Segmentid, num uint16) ObjectName

func BuildQueryResultName added in v0.8.0

func BuildQueryResultName() ObjectName

func MockObjectName added in v0.8.0

func MockObjectName() ObjectName

func (ObjectName) Equal added in v0.8.0

func (o ObjectName) Equal(a ObjectName) bool

func (ObjectName) Num added in v0.8.0

func (o ObjectName) Num() uint16

func (ObjectName) SegmentId added in v0.8.0

func (o ObjectName) SegmentId() Segmentid

func (ObjectName) Short added in v0.8.0

func (o ObjectName) Short() *ObjectNameShort

func (ObjectName) String added in v0.8.0

func (o ObjectName) String() string

type ObjectNameShort added in v0.8.0

type ObjectNameShort [ObjectNameShortLen]byte

func ToObjectNameShort added in v0.8.0

func ToObjectNameShort(blkID *Blockid) *ObjectNameShort

func (*ObjectNameShort) Equal added in v0.8.0

func (s *ObjectNameShort) Equal(o []byte) bool

func (*ObjectNameShort) Num added in v0.8.0

func (s *ObjectNameShort) Num() uint16

func (*ObjectNameShort) Segmentid added in v0.8.0

func (s *ObjectNameShort) Segmentid() *Segmentid

type ObjectReader

type ObjectReader = objectReaderV1

type ObjectWriter

type ObjectWriter = objectWriterV1

type ReadBlockOptions added in v0.8.0

type ReadBlockOptions struct {
	Id    uint16
	Idxes map[uint16]bool
}

type Reader

type Reader interface {
	// Read is to read columns data of a block from fileservice at one time
	// extent is location of the block meta
	// idxs is the column serial number of the data to be read
	Read(ctx context.Context,
		extent *Extent, idxs []uint16,
		id uint32,
		m *mpool.MPool,
		readFunc CacheConstructorFactory) (*fileservice.IOVector, error)

	ReadAll(
		ctx context.Context,
		extent *Extent,
		idxs []uint16,
		m *mpool.MPool,
		readFunc CacheConstructorFactory,
	) (*fileservice.IOVector, error)

	ReadBlocks(ctx context.Context,
		extent *Extent,
		ids map[uint32]*ReadBlockOptions,
		m *mpool.MPool,
		readFunc CacheConstructorFactory) (*fileservice.IOVector, error)

	// ReadMeta is the meta that reads a block
	// extent is location of the block meta
	ReadMeta(ctx context.Context, extent *Extent, m *mpool.MPool) (ObjectMeta, error)

	// ReadAllMeta is read the meta of all blocks in an object
	ReadAllMeta(ctx context.Context, m *mpool.MPool) (ObjectMeta, error)

	GetObject() *Object
}

Reader is to read data from fileservice

type ReaderOptionFunc added in v0.8.0

type ReaderOptionFunc func(opt *ReaderOptions)

func WithLocalMetaCacheOption added in v0.8.0

func WithLocalMetaCacheOption(withMetaCache bool) ReaderOptionFunc

func WithNoLRUCacheOption added in v0.8.0

func WithNoLRUCacheOption(noLRUCache bool) ReaderOptionFunc

type ReaderOptions added in v0.8.0

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

type Rowid added in v0.8.0

type Rowid = types.Rowid

type Segmentid added in v0.8.0

type Segmentid = types.Segmentid

func NewSegmentid added in v0.8.0

func NewSegmentid() *Segmentid

func ToSegmentId added in v0.8.0

func ToSegmentId(blkID *Blockid) *Segmentid

type Seqnums added in v0.8.0

type Seqnums struct {
	Seqs       []uint16
	MaxSeq     uint16 // do not consider special column like rowid and committs
	MetaColCnt uint16 // include special columns
}

func NewSeqnums added in v0.8.0

func NewSeqnums(seqs []uint16) *Seqnums

func (*Seqnums) InitWithColCnt added in v0.8.0

func (s *Seqnums) InitWithColCnt(colcnt int)

type StaticFilter added in v0.8.0

type StaticFilter = index.StaticFilter

type Stats added in v0.8.0

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

func NewStats added in v0.8.0

func NewStats() *Stats

func (*Stats) ExportBlockSelectivity added in v0.8.0

func (s *Stats) ExportBlockSelectivity() (
	whit, wtotal int64,
)

func (*Stats) ExportColumnSelctivity added in v0.8.0

func (s *Stats) ExportColumnSelctivity() (
	hit, total int64,
)

func (*Stats) ExportReadFilterSelectivity added in v0.8.0

func (s *Stats) ExportReadFilterSelectivity() (
	whit, wtotal int64, hit, total int64,
)

func (*Stats) ExportString added in v0.8.0

func (s *Stats) ExportString() string

func (*Stats) RecordBlockSelectivity added in v0.8.0

func (s *Stats) RecordBlockSelectivity(hit, total int)

func (*Stats) RecordColumnSelectivity added in v0.8.0

func (s *Stats) RecordColumnSelectivity(hit, total int)

func (*Stats) RecordReadFilterSelectivity added in v0.8.0

func (s *Stats) RecordReadFilterSelectivity(hit, total int)

type WriteOptions added in v0.7.0

type WriteOptions struct {
	Type WriteType
	Val  any
}

type WriteType added in v0.7.0

type WriteType int8
const (
	WriteTS WriteType = iota
)

type Writer

type Writer interface {
	// Write writes one batch to the Buffer at a time,
	// one batch corresponds to a virtual block,
	// and returns the handle of the block.
	Write(batch *batch.Batch) (BlockObject, error)

	// Write metadata for every column of all blocks
	WriteObjectMeta(ctx context.Context, totalRow uint32, metas []ColumnMeta)

	// WriteEnd is to write multiple batches written to
	// the buffer to the fileservice at one time
	WriteEnd(ctx context.Context, items ...WriteOptions) ([]BlockObject, error)
}

Writer is to virtualize batches into multiple blocks and write them into filefservice at one time

type WriterType added in v0.8.0

type WriterType int8

type ZoneMap

type ZoneMap = index.ZM

type ZoneMapArea added in v0.8.0

type ZoneMapArea []byte

func (ZoneMapArea) BlockCount added in v0.8.0

func (zma ZoneMapArea) BlockCount() uint32

func (ZoneMapArea) GetZoneMap added in v0.8.0

func (zma ZoneMapArea) GetZoneMap(idx uint16, BlockID uint32) ZoneMap

Jump to

Keyboard shortcuts

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