Documentation
¶
Index ¶
- func Compress(raw []byte, ctyp CompressType) []byte
- func Decompress(src []byte, dst []byte, ctyp CompressType) error
- func NewImmutableIndex() *immutableIndex
- func NewMutableIndex(keyT types.Type) *mutableIndex
- func TranslateError(err error) error
- type BFReader
- type BFWriter
- type CompressType
- type DeletesMap
- func (m *DeletesMap) GetMaxTS() uint64
- func (m *DeletesMap) HasDeleteFrom(key any, fromTs uint64) (existed bool)
- func (m *DeletesMap) IsKeyDeleted(key any, ts uint64) (deleted bool, existed bool)
- func (m *DeletesMap) LogDeletedKey(key any, row uint32, ts uint64) (err error)
- func (m *DeletesMap) RemoveOne(key any, row uint32)
- func (m *DeletesMap) RemoveTs(ts uint64)
- func (m *DeletesMap) RowCount(key any) int
- func (m *DeletesMap) Size() int
- type Index
- type IndexMeta
- func (meta *IndexMeta) Marshal() ([]byte, error)
- func (meta *IndexMeta) SetCompressType(typ CompressType)
- func (meta *IndexMeta) SetIndexType(typ IndexType)
- func (meta *IndexMeta) SetIndexedColumn(colIdx uint16)
- func (meta *IndexMeta) SetInternalIndex(idx uint16)
- func (meta *IndexMeta) SetSize(raw, exact uint32)
- func (meta *IndexMeta) Unmarshal(buf []byte) error
- type IndexType
- type IndicesMeta
- type ZMReader
- type ZMWriter
- func (writer *ZMWriter) AddValues(values containers.Vector) (err error)
- func (writer *ZMWriter) Finalize() (*IndexMeta, error)
- func (writer *ZMWriter) Init(file common.IRWFile, cType CompressType, colIdx uint16, internalIdx uint16) error
- func (writer *ZMWriter) SetMinMax(min, max any, typ types.Type) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
func Compress(raw []byte, ctyp CompressType) []byte
func Decompress ¶
func Decompress(src []byte, dst []byte, ctyp CompressType) error
func NewImmutableIndex ¶
func NewImmutableIndex() *immutableIndex
func NewMutableIndex ¶
func TranslateError ¶
Types ¶
type BFReader ¶
type BFReader struct {
// contains filtered or unexported fields
}
func NewBFReader ¶
func (*BFReader) MayContainsAnyKeys ¶
type BFWriter ¶
type BFWriter struct {
// contains filtered or unexported fields
}
func NewBFWriter ¶
func NewBFWriter() *BFWriter
type DeletesMap ¶
type DeletesMap struct {
// contains filtered or unexported fields
}
func NewDeletesMap ¶
func NewDeletesMap(typ types.Type) *DeletesMap
func (*DeletesMap) GetMaxTS ¶
func (m *DeletesMap) GetMaxTS() uint64
func (*DeletesMap) HasDeleteFrom ¶
func (m *DeletesMap) HasDeleteFrom(key any, fromTs uint64) (existed bool)
func (*DeletesMap) IsKeyDeleted ¶
func (m *DeletesMap) IsKeyDeleted(key any, ts uint64) (deleted bool, existed bool)
func (*DeletesMap) LogDeletedKey ¶
func (m *DeletesMap) LogDeletedKey(key any, row uint32, ts uint64) (err error)
func (*DeletesMap) RemoveOne ¶ added in v0.5.1
func (m *DeletesMap) RemoveOne(key any, row uint32)
func (*DeletesMap) RemoveTs ¶ added in v0.5.1
func (m *DeletesMap) RemoveTs(ts uint64)
func (*DeletesMap) RowCount ¶
func (m *DeletesMap) RowCount(key any) int
func (*DeletesMap) Size ¶
func (m *DeletesMap) Size() int
type Index ¶
type Index interface {
io.Closer
Destroy() error
// Dedup returns wether the specified key is existed
// If key is existed, return ErrDuplicate
// If any other unknown error happens, return error
// If key is not found, return nil
Dedup(key any) error
BatchDedup(keys containers.Vector, rowmask *roaring.Bitmap) (keyselects *roaring.Bitmap, err error)
// BatchUpsert batch insert the specific keys
// If any deduplication, it will fetch the old value first, fill the active map with new value, insert the old value into delete map
// If any other unknown error hanppens, return error
BatchUpsert(keysCtx *index.KeysCtx, offset int, ts uint64) (*index.BatchResp, error)
// Delete delete the specific key
// If the specified key not found in active map, return ErrNotFound
// If any other error happens, return error
// Delete the specific key from active map and then insert it into delete map
Delete(key any, ts uint64) error
GetActiveRow(key any) (row uint32, err error)
// Check deletes map for specified key @ts
// If deleted is true, the specified key was deleted @ts
// If existed is false, the specified key was not found in deletes map
IsKeyDeleted(key any, ts uint64) (deleted bool, existed bool)
HasDeleteFrom(key any, fromTs uint64) bool
GetMaxDeleteTS() uint64
String() string
ReadFrom(data.Block) error
WriteTo(data.Block) error
}
type IndexMeta ¶
type IndexMeta struct {
IdxType IndexType
CompType CompressType
ColIdx uint16
InternalIdx uint16
Size uint32
RawSize uint32
}
func NewEmptyIndexMeta ¶
func NewEmptyIndexMeta() *IndexMeta
func (*IndexMeta) SetCompressType ¶
func (meta *IndexMeta) SetCompressType(typ CompressType)
func (*IndexMeta) SetIndexType ¶
func (*IndexMeta) SetIndexedColumn ¶
func (*IndexMeta) SetInternalIndex ¶
type IndicesMeta ¶
type IndicesMeta struct {
Metas []IndexMeta
}
func NewEmptyIndicesMeta ¶
func NewEmptyIndicesMeta() *IndicesMeta
func (*IndicesMeta) AddIndex ¶
func (metas *IndicesMeta) AddIndex(meta IndexMeta)
func (*IndicesMeta) Marshal ¶
func (metas *IndicesMeta) Marshal() ([]byte, error)
func (*IndicesMeta) Unmarshal ¶
func (metas *IndicesMeta) Unmarshal(buf []byte) error
type ZMReader ¶
type ZMReader struct {
// contains filtered or unexported fields
}
func NewZMReader ¶
func (*ZMReader) ContainsAny ¶
Click to show internal directories.
Click to hide internal directories.