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
- Variables
- func BuildMetaData(blkCount, colCount uint16) objectDataMetaV1
- func ConstructRowidColumn(id *Blockid, start, length uint32, mp *mpool.MPool) (vec *vector.Vector, err error)
- func ConstructRowidColumnTo(vec *vector.Vector, id *Blockid, start, length uint32, mp *mpool.MPool) (err error)
- func ConstructRowidColumnToWithSels(vec *vector.Vector, id *Blockid, sels []int32, mp *mpool.MPool) (err error)
- func ConvertToCkpIdx(dataType uint16) uint16
- func Decode(buf []byte) (any, error)
- func DecodeColumnDataV1(buf []byte) (ioe any, err error)
- func DecodeObjectMetaV1(buf []byte) (ioe any, err error)
- func DecodeObjectMetaV2(buf []byte) (ioe any, err error)
- func DecodeObjectMetaV3(buf []byte) (ioe any, err error)
- func EncodeColumnDataV1(ioe any) (buf []byte, err error)
- func EncodeIOEntryHeader(h *IOEntryHeader) []byte
- func ExportCacheStats() string
- func GetIOEntryCodec(h IOEntryHeader) (codec ioEntryCodec)
- func HackRowidToU64(id Rowid) uint64
- func InitMetaCache(size int64)
- func IsBlockInObject(blkID *types.Blockid, objID *ObjectName) bool
- func IsEmptyBlkid(id *Blockid) bool
- func IsEmptySegid(id *Segmentid) bool
- func IsSameObjectLocVsMeta(location Location, meta ObjectDataMeta) bool
- func IsSameObjectLocVsShort(location Location, short *ObjectNameShort) bool
- func NewRowid(blkid *Blockid, offset uint32) *types.Rowid
- func ReadAllBlocksWithMeta(ctx context.Context, meta *ObjectDataMeta, name string, cols []uint16, ...) (ioVec *fileservice.IOVector, err error)
- func ReadBytes(r io.Reader) (buf []byte, n int64, err error)
- func ReadExtent(ctx context.Context, name string, extent *Extent, policy fileservice.Policy, ...) (v []byte, err error)
- func ReadMultiBlocksWithMeta(ctx context.Context, name string, meta ObjectMeta, ...) (ioVec *fileservice.IOVector, err error)
- func ReadOneBlock(ctx context.Context, meta *ObjectDataMeta, name string, blk uint16, ...) (ioVec *fileservice.IOVector, err error)
- func ReadOneBlockWithMeta(ctx context.Context, meta *ObjectDataMeta, name string, blk uint16, ...) (ioVec *fileservice.IOVector, err error)
- func ReadString(r io.Reader) (str string, n int64, err error)
- func RegisterIOEnrtyCodec(h IOEntryHeader, encFn IOEncodeFunc, decFn IODecodeFunc)
- func TmpNewFileservice(ctx context.Context, dir string) fileservice.FileService
- func WriteBytes(b []byte, w io.Writer) (n int64, err error)
- func WriteString(str string, w io.Writer) (n int64, err error)
- type BlockHeader
- func (bh BlockHeader) BFExtent() Extent
- func (bh BlockHeader) BlockID() *Blockid
- func (bh BlockHeader) ColumnCount() uint16
- func (bh BlockHeader) IsEmpty() bool
- func (bh BlockHeader) MaxSeqnum() uint16
- func (bh BlockHeader) MetaColumnCount() uint16
- func (bh BlockHeader) MetaLocation() Extent
- func (bh BlockHeader) Rows() uint32
- func (bh BlockHeader) Sequence() uint16
- func (bh BlockHeader) SetBFExtent(location Extent)
- func (bh BlockHeader) SetBlockID(id *Blockid)
- func (bh BlockHeader) SetColumnCount(count uint16)
- func (bh BlockHeader) SetMaxSeqnum(seqnum uint16)
- func (bh BlockHeader) SetMetaColumnCount(count uint16)
- func (bh BlockHeader) SetMetaLocation(location Extent)
- func (bh BlockHeader) SetRows(rows uint32)
- func (bh BlockHeader) SetSequence(seq uint16)
- func (bh BlockHeader) SetStartID(id uint16)
- func (bh BlockHeader) SetTableID(id uint64)
- func (bh BlockHeader) SetZoneMapArea(location Extent)
- func (bh BlockHeader) ShortName() *ObjectNameShort
- func (bh BlockHeader) StartID() uint16
- func (bh BlockHeader) TableID() uint64
- func (bh BlockHeader) ZoneMapArea() Extent
- type BlockIndex
- type BlockObject
- func (bm BlockObject) AddColumnMeta(idx uint16, col ColumnMeta)
- func (bm BlockObject) BlockHeader() BlockHeader
- func (bm BlockObject) ColumnMeta(seqnum uint16) ColumnMeta
- func (bm BlockObject) GetBlockID(name ObjectName) *Blockid
- func (bm BlockObject) GetColumnCount() uint16
- func (bm BlockObject) GetExtent() Extent
- func (bm BlockObject) GetID() uint16
- func (bm BlockObject) GetMaxSeqnum() uint16
- func (bm BlockObject) GetMeta() BlockObject
- func (bm BlockObject) GetMetaColumnCount() uint16
- func (bm BlockObject) GetRows() uint32
- func (bm BlockObject) IsEmpty() bool
- func (bm BlockObject) MustGetColumn(seqnum uint16) ColumnMeta
- func (bm BlockObject) SetBlockMetaHeader(header BlockHeader)
- func (bm BlockObject) ToColumnZoneMaps(seqnums []uint16) []ZoneMap
- type BlockReadStats
- type Blockid
- type BloomFilter
- type CacheConfig
- type CacheConstructor
- type CacheConstructorFactory
- type ColumnMeta
- func (cm ColumnMeta) Checksum() uint32
- func (cm ColumnMeta) DataType() uint8
- func (cm ColumnMeta) Idx() uint16
- func (cm ColumnMeta) IsEmpty() bool
- func (cm ColumnMeta) Location() Extent
- func (cm ColumnMeta) Ndv() uint32
- func (cm ColumnMeta) NullCnt() uint32
- func (cm ColumnMeta) SetNdv(cnt uint32)
- func (cm ColumnMeta) SetNullCnt(cnt uint32)
- func (cm ColumnMeta) SetZoneMap(zm ZoneMap)
- func (cm ColumnMeta) ZoneMap() ZoneMap
- type ColumnMetaFetcher
- type CreateBlockOpt
- type CreateSegOpt
- type DataMetaType
- type Extent
- func (ex Extent) Alg() uint8
- func (ex Extent) End() uint32
- func (ex Extent) Length() uint32
- func (ex Extent) Offset() uint32
- func (ex Extent) OriginSize() uint32
- func (ex Extent) SetAlg(alg uint8)
- func (ex Extent) SetLength(length uint32)
- func (ex Extent) SetOffset(offset uint32)
- func (ex Extent) SetOriginSize(originSize uint32)
- func (ex Extent) String() string
- type Footer
- type Header
- type IODecodeFunc
- type IOEncodeFunc
- type IOEntry
- type IOEntryHeader
- type Location
- type Object
- type ObjectBuffer
- type ObjectDataMeta
- type ObjectFS
- type ObjectMeta
- func FastLoadObjectMeta(ctx context.Context, location *Location, prefetch bool, ...) (ObjectMeta, error)
- func LoadObjectMetaByExtent(ctx context.Context, name *ObjectName, extent *Extent, prefetch bool, ...) (meta ObjectMeta, err error)
- func ReadObjectMeta(ctx context.Context, name string, extent *Extent, policy fileservice.Policy, ...) (meta ObjectMeta, err error)
- type ObjectName
- type ObjectNameShort
- type ObjectReader
- type ObjectWriter
- type ReadBlockOptions
- type Reader
- type ReaderOptionFunc
- type ReaderOptions
- type Rowid
- type Segmentid
- type Seqnums
- type StaticFilter
- type Stats
- func (s *Stats) ExportBlockSelectivity() (whit, wtotal int64)
- func (s *Stats) ExportColumnSelctivity() (hit, total int64)
- func (s *Stats) ExportReadDel() (total, read, bisect time.Duration, cnt int64)
- func (s *Stats) ExportReadFilterSelectivity() (whit, wtotal int64, hit, total int64)
- func (s *Stats) ExportString() string
- func (s *Stats) RecordBlockSelectivity(hit, total int)
- func (s *Stats) RecordColumnSelectivity(hit, total int)
- func (s *Stats) RecordReadDel(total, read, bisect time.Duration)
- func (s *Stats) RecordReadFilterSelectivity(hit, total int)
- type SubMetaIndex
- type WriteOptions
- type WriteType
- type Writer
- type WriterType
- type ZoneMap
- type ZoneMapArea
Constants ¶
const ( IOET_Empty = 0 IOET_ObjMeta = 1 IOET_ColData = 2 IOET_BF = 3 IOET_ZM = 4 )
const ( ExtentOff = ObjectNameLen ExtentLen = ExtentSize RowsOff = ExtentOff + ExtentLen RowsLen = 4 BlockIDOff = RowsOff + RowsLen BlockIDLen = 2 LocationLen = BlockIDOff + BlockIDLen )
const ( FileNumOff = SegmentIdSize FileNumLen = 2 NameStringOff = FileNumOff + FileNumLen NameStringLen = 42 //uuid[36]+_[1]+filename[5] ObjectNameLen = NameStringOff + NameStringLen ObjectNameShortLen = NameStringOff )
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 )
const ( IOET_ObjectMeta_V1 = 1 IOET_ObjectMeta_V2 = 2 IOET_ObjectMeta_V3 = 3 IOET_ColumnData_V1 = 1 IOET_BloomFilter_V1 = 1 IOET_BloomFilter_V2 = 2 IOET_ZoneMap_V1 = 1 IOET_ObjectMeta_CurrVer = IOET_ObjectMeta_V3 IOET_ColumnData_CurrVer = IOET_ColumnData_V1 IOET_BloomFilter_CurrVer = IOET_BloomFilter_V2 IOET_ZoneMap_CurrVer = IOET_ZoneMap_V1 )
const ( WriterNormal = iota WriterCheckpoint WriterQueryResult WriterGC WriterETL )
const (
ExtentSize = extentOriginOff + extentOriginLen
)
const FSName = "local"
const HeaderSize = 64
const IOEntryHeaderSize = 4
const Magic = 0xFFFFFFFF
const (
SegmentIdSize = types.UuidSize
)
const (
StartIDLen = 2
)
const Version = 1
const ZoneMapSize = index.ZMSize
Variables ¶
var ( BuildObjectMeta = buildObjectDataMetaV1 NewObjectWriterSpecial = newObjectWriterSpecialV1 NewObjectWriter = newObjectWriterV1 NewObjectReaderWithStr = newObjectReaderWithStrV1 NewObjectReader = newObjectReaderV1 )
var BlkReadStats = newBlockReadStats()
var BuildZM = index.BuildZM
var EmptyZm = [64]byte{}
var NameCheckPoint [NameStringOff]byte
var NameDiskCleaner [NameStringOff]byte
var NameETL [NameStringOff]byte
var NameNormal [NameStringOff]byte
var NameQueryResult [NameStringOff]byte
var NewZM = index.NewZM
var (
RowidType types.Type
)
Functions ¶
func BuildMetaData ¶ added in v0.8.0
func BuildMetaData(blkCount, colCount uint16) objectDataMetaV1
test used
func ConstructRowidColumn ¶ added in v0.8.0
func ConstructRowidColumnTo ¶ added in v0.8.0
func ConstructRowidColumnToWithSels ¶ added in v0.8.0
func ConvertToCkpIdx ¶ added in v1.0.0
func DecodeColumnDataV1 ¶ added in v0.8.0
func DecodeObjectMetaV1 ¶ added in v1.0.0
func DecodeObjectMetaV2 ¶ added in v1.0.0
func DecodeObjectMetaV3 ¶ added in v1.0.0
func EncodeColumnDataV1 ¶ added in v0.8.0
func EncodeIOEntryHeader ¶ added in v0.8.0
func EncodeIOEntryHeader(h *IOEntryHeader) []byte
func ExportCacheStats ¶ added in v1.0.0
func ExportCacheStats() string
func GetIOEntryCodec ¶ added in v0.8.0
func GetIOEntryCodec(h IOEntryHeader) (codec ioEntryCodec)
func HackRowidToU64 ¶ added in v1.0.0
used only in some special cases
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 IsEmptySegid ¶ added in v0.8.0
func IsSameObjectLocVsMeta ¶ added in v0.8.0
func IsSameObjectLocVsMeta(location Location, meta ObjectDataMeta) bool
func IsSameObjectLocVsShort ¶ added in v0.8.0
func IsSameObjectLocVsShort(location Location, short *ObjectNameShort) bool
func ReadAllBlocksWithMeta ¶ added in v0.8.0
func ReadAllBlocksWithMeta( ctx context.Context, meta *ObjectDataMeta, name string, cols []uint16, policy fileservice.Policy, m *mpool.MPool, fs fileservice.FileService, factory CacheConstructorFactory, ) (ioVec *fileservice.IOVector, err error)
func ReadExtent ¶ added in v0.8.0
func ReadExtent( ctx context.Context, name string, extent *Extent, policy fileservice.Policy, 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, fs fileservice.FileService, factory CacheConstructorFactory, ) (ioVec *fileservice.IOVector, err error)
func ReadOneBlock ¶ added in v0.8.0
func ReadOneBlock( ctx context.Context, meta *ObjectDataMeta, 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 *ObjectDataMeta, name string, blk uint16, seqnums []uint16, typs []types.Type, m *mpool.MPool, fs fileservice.FileService, factory CacheConstructorFactory, policies ...fileservice.Policy, ) (ioVec *fileservice.IOVector, 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
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) SetStartID ¶ added in v1.0.0
func (bh BlockHeader) SetStartID(id 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) StartID ¶ added in v1.0.0
func (bh BlockHeader) StartID() uint16
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) GetBlockID ¶ added in v1.0.0
func (bm BlockObject) GetBlockID(name ObjectName) *Blockid
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 BlockReadStats ¶ added in v1.0.0
type BlockReadStats struct { // using this we can collect the number of blks have read and hit among them BlkCacheHitStats hitStats // using this we can collect the number of entries have read and hit among them EntryCacheHitStats hitStats // using this we can collect the number of blks each reader will read BlksByReaderStats hitStats CounterSet *perfcounter.CounterSet }
BlockReadStats collect blk read related cache statistics, include mem and disk
type Blockid ¶ added in v0.8.0
func BuildObjectBlockid ¶ added in v0.8.0
func BuildObjectBlockid(name ObjectName, sequence uint16) *Blockid
func NewBlockid ¶ added in v0.8.0
func Str2Blockid ¶ added in v0.8.0
type BloomFilter ¶
type BloomFilter []byte
func LoadBFWithMeta ¶ added in v1.0.0
func LoadBFWithMeta( ctx context.Context, meta ObjectDataMeta, location Location, fs fileservice.FileService, ) (BloomFilter, error)
func ReadBloomFilter ¶ added in v0.8.0
func ReadBloomFilter( ctx context.Context, name string, extent *Extent, policy fileservice.Policy, 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 CacheConstructor ¶ added in v0.8.0
type CacheConstructor = func(r io.Reader, buf []byte, allocator fileservice.CacheDataAllocator) (fileservice.CacheData, 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
func (*CreateSegOpt) WithId ¶ added in v0.8.0
func (o *CreateSegOpt) WithId(id *types.Uuid) *CreateSegOpt
type DataMetaType ¶ added in v1.0.0
type DataMetaType uint16
const ( SchemaData DataMetaType = 0 SchemaTombstone DataMetaType = 1 CkpMetaStart DataMetaType = 2 // CkpMetaEnd = CkpMetaStart + `MaxIDX` CkpMetaEnd DataMetaType = 26 + 2 )
func ConvertToSchemaType ¶ added in v1.0.0
func ConvertToSchemaType(ckpIdx uint16) DataMetaType
type Extent ¶
type Extent []byte
Alg | Offset | Length | OriginSize ----|--------|--------|------------ 1 | 4 | 4 | 4 Alg: Specifies the compression algorithm Offset: The offset of the compressed data in the file Length: The length of the compressed data OriginSize: The length of the original data
func (Extent) OriginSize ¶
func (Extent) SetOriginSize ¶ added in v0.8.0
type Header ¶
type Header []byte
func BuildHeader ¶ added in v0.8.0
func BuildHeader() Header
func (Header) SchemaVersion ¶ added in v0.8.0
func (Header) SetSchemaVersion ¶ added in v0.8.0
type IODecodeFunc ¶ added in v0.8.0
type IOEncodeFunc ¶ added in v0.8.0
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) Name ¶ added in v0.8.0
func (l Location) Name() ObjectName
func (Location) ShortName ¶ added in v0.8.0
func (l Location) ShortName() *ObjectNameShort
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func NewObject ¶
func NewObject(name string, fs fileservice.FileService) *Object
func (*Object) GetFs ¶ added in v1.0.0
func (o *Object) GetFs() fileservice.FileService
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 ObjectDataMeta ¶ added in v1.0.0
type ObjectDataMeta = objectDataMetaV1
type ObjectFS ¶
type ObjectFS struct { Service fileservice.FileService Dir string }
func NewObjectFS ¶
func NewObjectFS(service fileservice.FileService, dir string) *ObjectFS
type ObjectMeta ¶ added in v0.8.0
type ObjectMeta interface { MustGetMeta(metaType DataMetaType) ObjectDataMeta HeaderLength() uint32 DataMetaCount() uint16 TombstoneMetaCount() uint16 DataMeta() (ObjectDataMeta, bool) MustDataMeta() ObjectDataMeta TombstoneMeta() (ObjectDataMeta, bool) MustTombstoneMeta() ObjectDataMeta SetDataMetaCount(count uint16) SetDataMetaOffset(offset uint32) SetTombstoneMetaCount(count uint16) SetTombstoneMetaOffset(offset uint32) SubMeta(pos uint16) (ObjectDataMeta, bool) SubMetaCount() uint16 SubMetaIndex() SubMetaIndex SubMetaTypes() []uint16 }
func FastLoadObjectMeta ¶ added in v0.8.0
func FastLoadObjectMeta( ctx context.Context, location *Location, prefetch bool, fs fileservice.FileService, ) (ObjectMeta, error)
func LoadObjectMetaByExtent ¶ added in v0.8.0
func LoadObjectMetaByExtent( ctx context.Context, name *ObjectName, extent *Extent, prefetch bool, policy fileservice.Policy, fs fileservice.FileService, ) (meta ObjectMeta, err error)
func ReadObjectMeta ¶ added in v0.8.0
func ReadObjectMeta( ctx context.Context, name string, extent *Extent, policy fileservice.Policy, 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 ShortName ¶ added in v1.0.0
func ShortName(b *Blockid) *ObjectNameShort
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 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) (ObjectDataMeta, error) // ReadAllMeta is read the meta of all blocks in an object ReadAllMeta(ctx context.Context, m *mpool.MPool) (ObjectDataMeta, error) GetObject() *Object }
Reader is to read data from fileservice
type ReaderOptionFunc ¶ added in v0.8.0
type ReaderOptionFunc func(opt *ReaderOptions)
func WithDataCachePolicyOption ¶ added in v1.0.0
func WithDataCachePolicyOption(noLRUCache fileservice.Policy) ReaderOptionFunc
func WithMetaCachePolicyOption ¶ added in v1.0.0
func WithMetaCachePolicyOption(noLRUCache fileservice.Policy) ReaderOptionFunc
type ReaderOptions ¶ added in v0.8.0
type ReaderOptions struct {
// contains filtered or unexported fields
}
type Rowid ¶ added in v0.8.0
func HackBlockid2Rowid ¶ added in v1.0.0
used only in some special cases
func HackBytes2Rowid ¶ added in v1.0.0
used only in some special cases
func HackSegid2Rowid ¶ added in v1.0.0
used only in some special cases
func HackU64ToRowid ¶ added in v1.0.0
used only in some special cases
type Segmentid ¶ added in v0.8.0
func NewSegmentid ¶ added in v0.8.0
func NewSegmentid() *Segmentid
func ToSegmentId ¶ added in v0.8.0
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 (*Seqnums) InitWithColCnt ¶ added in v0.8.0
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 (*Stats) ExportBlockSelectivity ¶ added in v0.8.0
func (*Stats) ExportColumnSelctivity ¶ added in v0.8.0
func (*Stats) ExportReadDel ¶ added in v1.0.0
func (*Stats) ExportReadFilterSelectivity ¶ added in v0.8.0
func (*Stats) ExportString ¶ added in v0.8.0
func (*Stats) RecordBlockSelectivity ¶ added in v0.8.0
func (*Stats) RecordColumnSelectivity ¶ added in v0.8.0
func (*Stats) RecordReadDel ¶ added in v1.0.0
func (*Stats) RecordReadFilterSelectivity ¶ added in v0.8.0
type SubMetaIndex ¶ added in v1.0.0
type SubMetaIndex []byte
func BuildSubMetaIndex ¶ added in v1.0.0
func BuildSubMetaIndex(count uint16) SubMetaIndex
func (SubMetaIndex) Length ¶ added in v1.0.0
func (oh SubMetaIndex) Length() uint32
func (SubMetaIndex) SetSchemaMeta ¶ added in v1.0.0
func (oh SubMetaIndex) SetSchemaMeta(pos uint16, st uint16, count uint16, offset uint32)
func (SubMetaIndex) SetSubMetaCount ¶ added in v1.0.0
func (oh SubMetaIndex) SetSubMetaCount(cnt uint16)
func (SubMetaIndex) SubMetaCount ¶ added in v1.0.0
func (oh SubMetaIndex) SubMetaCount() uint16
type WriteOptions ¶ added in v0.7.0
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 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