Documentation
¶
Index ¶
- Constants
- Variables
- func CopyFile(src, dest string) (int64, error)
- func CopyFromReader(r io.Reader, dest string) (int64, error)
- func MakeTblockFileName(dir, tag string, count uint64, id common.ID, tmp bool) string
- func NewMockSegmentFile(dirname string, ft FileType, id common.ID) base.ISegmentFile
- func NewSortedSegmentFile(dirname string, id common.ID) base.ISegmentFile
- func NewUnsortedSegmentFile(dirname string, id common.ID) base.ISegmentFile
- func ParseLogIndex(str string) (index *metadata.LogIndex)
- func ParseTBlockfileName(name string) (count uint64, tag string, id common.ID, err error)
- type BlockFile
- func (bf *BlockFile) CopyTo(dir string) error
- func (bf *BlockFile) DataCompressAlgo(id common.ID) int
- func (bf *BlockFile) Destroy()
- func (bf *BlockFile) GetDir() string
- func (bf *BlockFile) GetFileType() common.FileType
- func (bf *BlockFile) GetIndicesMeta() *base.IndicesMeta
- func (bf *BlockFile) LinkTo(dir string) error
- func (bf *BlockFile) MakeVirtualIndexFile(meta *base.IndexMeta) common.IVFile
- func (bf *BlockFile) PartSize(colIdx uint64, id common.ID, isOrigin bool) int64
- func (bf *BlockFile) PrefetchPart(colIdx uint64, id common.ID) error
- func (bf *BlockFile) ReadPart(colIdx uint64, id common.ID, buf []byte)
- func (bf *BlockFile) ReadPoint(ptr *base.Pointer, buf []byte)
- func (bf *BlockFile) Stat() common.FileInfo
- type BlockWriter
- func (bw *BlockWriter) Execute() error
- func (bw *BlockWriter) GetFileName() string
- func (bw *BlockWriter) GetSize() int64
- func (bw *BlockWriter) SetDataFlusher(f vecsSerializer)
- func (bw *BlockWriter) SetFileGetter(f func(string, *metadata.Block) (*os.File, error))
- func (bw *BlockWriter) SetIndexFlusher(f vecsIndexSerializer)
- func (bw *BlockWriter) SetPostExecutor(f func())
- func (bw *BlockWriter) SetPreExecutor(f func())
- type ColPartFile
- func (cpf *ColPartFile) GetFileType() common.FileType
- func (cpf *ColPartFile) Name() string
- func (cpf *ColPartFile) Read(buf []byte) (n int, err error)
- func (cpf *ColPartFile) Ref()
- func (cpf *ColPartFile) RefCount() int64
- func (cpf *ColPartFile) Stat() common.FileInfo
- func (cpf *ColPartFile) Unref()
- type EmbedBlockIndexFile
- type EmbedIndexFile
- type FileDestoryer
- type FileMeta
- type FileNameFactory
- type FileType
- type IndexFile
- type Manager
- func (mgr *Manager) Close() error
- func (mgr *Manager) GetSortedFile(id common.ID) base.ISegmentFile
- func (mgr *Manager) GetUnsortedFile(id common.ID) base.ISegmentFile
- func (mgr *Manager) RegisterSortedFiles(id common.ID) (base.ISegmentFile, error)
- func (mgr *Manager) RegisterUnsortedFiles(id common.ID) (base.ISegmentFile, error)
- func (mgr *Manager) String() string
- func (mgr *Manager) UnregisterSortedFile(id common.ID)
- func (mgr *Manager) UnregisterUnsortedFile(id common.ID)
- func (mgr *Manager) UpgradeFile(id common.ID) base.ISegmentFile
- type MockColPartFile
- type MockSegmentFile
- func (msf *MockSegmentFile) Close() error
- func (msf *MockSegmentFile) CopyTo(dir string) error
- func (msf *MockSegmentFile) DataCompressAlgo(id common.ID) int
- func (msf *MockSegmentFile) Destroy()
- func (msf *MockSegmentFile) GetBlockIndicesMeta(id common.ID) *base.IndicesMeta
- func (msf *MockSegmentFile) GetBlockSize(_ common.ID) int64
- func (msf *MockSegmentFile) GetDir() string
- func (msf *MockSegmentFile) GetFileType() common.FileType
- func (msf *MockSegmentFile) GetIndicesMeta() *base.IndicesMeta
- func (msf *MockSegmentFile) LinkTo(dir string) error
- func (msf *MockSegmentFile) MakeVirtualBlkIndexFile(id common.ID, meta *base.IndexMeta) common.IVFile
- func (msf *MockSegmentFile) MakeVirtualIndexFile(meta *base.IndexMeta) common.IVFile
- func (msf *MockSegmentFile) MakeVirtualPartFile(id *common.ID) common.IVFile
- func (msf *MockSegmentFile) MakeVirtualSeparateIndexFile(file *os.File, id *common.ID, meta *base.IndexMeta) common.IVFile
- func (msf *MockSegmentFile) PartSize(colIdx uint64, id common.ID, _ bool) int64
- func (msf *MockSegmentFile) PrefetchPart(colIdx uint64, id common.ID) error
- func (msf *MockSegmentFile) ReadBlockPoint(id common.ID, ptr *base.Pointer, buf []byte)
- func (msf *MockSegmentFile) ReadPart(colIdx uint64, id common.ID, buf []byte)
- func (msf *MockSegmentFile) ReadPoint(ptr *base.Pointer, buf []byte)
- func (msf *MockSegmentFile) Ref()
- func (msf *MockSegmentFile) RefBlock(id common.ID)
- func (msf *MockSegmentFile) RefTBlock(id common.ID) base.IBlockFile
- func (msf *MockSegmentFile) RegisterTBlock(id common.ID) (base.IBlockFile, error)
- func (msf *MockSegmentFile) Stat() common.FileInfo
- func (msf *MockSegmentFile) Unref()
- func (msf *MockSegmentFile) UnrefBlock(id common.ID)
- type SegmentWriter
- func (sw *SegmentWriter) Execute() error
- func (sw *SegmentWriter) GetDestoryer() FileDestoryer
- func (sw *SegmentWriter) GetSize() int64
- func (sw *SegmentWriter) SetFileGetter(f func(string, *metadata.Segment) (*os.File, error))
- func (sw *SegmentWriter) SetFlusher(f func(*os.File, iface.BlockIterator, *metadata.Segment) error)
- func (sw *SegmentWriter) SetPostExecutor(f func())
- func (sw *SegmentWriter) SetPreExecutor(f func())
- type SortedSegmentFile
- func (sf *SortedSegmentFile) CopyTo(dir string) error
- func (sf *SortedSegmentFile) DataCompressAlgo(id common.ID) int
- func (sf *SortedSegmentFile) Destroy()
- func (sf *SortedSegmentFile) GetBlockIndicesMeta(id common.ID) *base.IndicesMeta
- func (sf *SortedSegmentFile) GetBlockSize(_ common.ID) int64
- func (sf *SortedSegmentFile) GetDir() string
- func (sf *SortedSegmentFile) GetFileType() common.FileType
- func (sf *SortedSegmentFile) GetIndicesMeta() *base.IndicesMeta
- func (sf *SortedSegmentFile) LinkTo(dir string) error
- func (sf *SortedSegmentFile) MakeVirtualBlkIndexFile(id common.ID, meta *base.IndexMeta) common.IVFile
- func (sf *SortedSegmentFile) MakeVirtualIndexFile(meta *base.IndexMeta) common.IVFile
- func (sf *SortedSegmentFile) MakeVirtualPartFile(id *common.ID) common.IVFile
- func (sf *SortedSegmentFile) MakeVirtualSeparateIndexFile(file *os.File, id *common.ID, meta *base.IndexMeta) common.IVFile
- func (sf *SortedSegmentFile) PartSize(colIdx uint64, id common.ID, isOrigin bool) int64
- func (sf *SortedSegmentFile) PrefetchPart(colIdx uint64, id common.ID) error
- func (sf *SortedSegmentFile) ReadBlockPoint(id common.ID, ptr *base.Pointer, buf []byte)
- func (sf *SortedSegmentFile) ReadPart(colIdx uint64, id common.ID, buf []byte)
- func (sf *SortedSegmentFile) ReadPoint(ptr *base.Pointer, buf []byte)
- func (sf *SortedSegmentFile) RefBlock(id common.ID)
- func (sf *SortedSegmentFile) RefTBlock(id common.ID) base.IBlockFile
- func (sf *SortedSegmentFile) RegisterTBlock(id common.ID) (base.IBlockFile, error)
- func (sf *SortedSegmentFile) Stat() common.FileInfo
- func (sf *SortedSegmentFile) UnrefBlock(id common.ID)
- type TransientBlockFile
- func (f *TransientBlockFile) Close() error
- func (f *TransientBlockFile) CopyTo(path string) (err error)
- func (f *TransientBlockFile) DataCompressAlgo(common.ID) int
- func (f *TransientBlockFile) Destroy()
- func (f *TransientBlockFile) GetDir() string
- func (f *TransientBlockFile) GetIndicesMeta() *base.IndicesMeta
- func (f *TransientBlockFile) InitMeta(meta *metadata.Block)
- func (f *TransientBlockFile) LinkTo(path string) (err error)
- func (f *TransientBlockFile) LoadBatch(meta *metadata.Block) batch.IBatch
- func (f *TransientBlockFile) MakeVirtualIndexFile(*base.IndexMeta) common.IVFile
- func (f *TransientBlockFile) PartSize(colIdx uint64, id common.ID, isOrigin bool) int64
- func (f *TransientBlockFile) PreSync(pos uint32) bool
- func (f *TransientBlockFile) PrefetchPart(colIdx uint64, id common.ID) error
- func (f *TransientBlockFile) ReadPart(colIdx uint64, id common.ID, buf []byte)
- func (f *TransientBlockFile) ReadPoint(ptr *base.Pointer, buf []byte)
- func (f *TransientBlockFile) Stat() common.FileInfo
- func (f *TransientBlockFile) Sync(data batch.IBatch, meta *metadata.Block) error
- type UnsortedSegmentFile
- func (sf *UnsortedSegmentFile) AddBlock(id common.ID, bf base.IBlockFile)
- func (sf *UnsortedSegmentFile) Close() error
- func (sf *UnsortedSegmentFile) CopyTo(dir string) error
- func (sf *UnsortedSegmentFile) DataCompressAlgo(id common.ID) int
- func (sf *UnsortedSegmentFile) Destroy()
- func (sf *UnsortedSegmentFile) GetBlock(id common.ID) base.IBlockFile
- func (sf *UnsortedSegmentFile) GetBlockIndicesMeta(id common.ID) *base.IndicesMeta
- func (sf *UnsortedSegmentFile) GetBlockSize(id common.ID) int64
- func (sf *UnsortedSegmentFile) GetDir() string
- func (sf *UnsortedSegmentFile) GetFileType() common.FileType
- func (sf *UnsortedSegmentFile) GetIndicesMeta() *base.IndicesMeta
- func (sf *UnsortedSegmentFile) LinkTo(dir string) error
- func (sf *UnsortedSegmentFile) MakeVirtualBlkIndexFile(id common.ID, meta *base.IndexMeta) common.IVFile
- func (sf *UnsortedSegmentFile) MakeVirtualIndexFile(meta *base.IndexMeta) common.IVFile
- func (sf *UnsortedSegmentFile) MakeVirtualPartFile(id *common.ID) common.IVFile
- func (sf *UnsortedSegmentFile) MakeVirtualSeparateIndexFile(file *os.File, id *common.ID, meta *base.IndexMeta) common.IVFile
- func (sf *UnsortedSegmentFile) PartSize(colIdx uint64, id common.ID, isOrigin bool) int64
- func (sf *UnsortedSegmentFile) PrefetchPart(colIdx uint64, id common.ID) error
- func (sf *UnsortedSegmentFile) ReadBlockPoint(id common.ID, ptr *base.Pointer, buf []byte)
- func (sf *UnsortedSegmentFile) ReadPart(colIdx uint64, id common.ID, buf []byte)
- func (sf *UnsortedSegmentFile) ReadPoint(ptr *base.Pointer, buf []byte)
- func (sf *UnsortedSegmentFile) RefBlock(id common.ID)
- func (sf *UnsortedSegmentFile) RefTBlock(id common.ID) base.IBlockFile
- func (sf *UnsortedSegmentFile) RegisterTBlock(id common.ID) (base.IBlockFile, error)
- func (sf *UnsortedSegmentFile) Stat() common.FileInfo
- func (sf *UnsortedSegmentFile) UnrefBlock(id common.ID)
Constants ¶
const Version uint64 = 1
Variables ¶
var ( ErrDupBlk = errors.New("duplicate blk") ErrDupSeg = errors.New("duplicate seg") )
var (
ErrFileNotExist = errors.New("file not exist")
)
Functions ¶
func MakeTblockFileName ¶
func NewMockSegmentFile ¶
func NewSortedSegmentFile ¶
func NewSortedSegmentFile(dirname string, id common.ID) base.ISegmentFile
func NewUnsortedSegmentFile ¶
func NewUnsortedSegmentFile(dirname string, id common.ID) base.ISegmentFile
func ParseLogIndex ¶
func ParseLogIndex(str string) (index *metadata.LogIndex)
Types ¶
type BlockFile ¶
type BlockFile struct {
common.RefHelper
os.File
ID common.ID
Parts map[base.Key]*base.Pointer
Meta *FileMeta
SegmentFile base.ISegmentFile
Info common.FileInfo
DataAlgo int
Idx *metadata.LogIndex
PrevIdx *metadata.LogIndex
Range *metadata.LogRange
Count uint64
}
BlockFile file structure: algo | colCntlen | metaCnt | preIdxLen | preIdx | IdxLen | Idx col01 : coldata len | coldata originlen | col02 : coldata len | coldata originlen | ... col01 data | col02 data | ...
func NewBlockFile ¶
func NewBlockFile(segFile base.ISegmentFile, id common.ID, nameFactory FileNameFactory) *BlockFile
func (*BlockFile) GetFileType ¶
func (*BlockFile) GetIndicesMeta ¶
func (bf *BlockFile) GetIndicesMeta() *base.IndicesMeta
func (*BlockFile) MakeVirtualIndexFile ¶
func (*BlockFile) PrefetchPart ¶
type BlockWriter ¶
type BlockWriter struct {
// contains filtered or unexported fields
}
BlockWriter writes memTable data into the created block file when memTable flush()
func NewBlockWriter ¶
func NewBlockWriter(data []*gvector.Vector, meta *metadata.Block, dir string) *BlockWriter
NewBlockWriter make a BlockWriter, which will be used when the memtable is full.
func NewIBatchWriter ¶
func NewIBatchWriter(bat batch.IBatch, meta *metadata.Block, dir string) *BlockWriter
NewIBatchWriter make a BlockWriter, which will be used when the memtable is not full but needs to be flush()
func (*BlockWriter) Execute ¶
func (bw *BlockWriter) Execute() error
func (*BlockWriter) GetFileName ¶
func (bw *BlockWriter) GetFileName() string
func (*BlockWriter) GetSize ¶
func (bw *BlockWriter) GetSize() int64
func (*BlockWriter) SetDataFlusher ¶
func (bw *BlockWriter) SetDataFlusher(f vecsSerializer)
func (*BlockWriter) SetFileGetter ¶
func (bw *BlockWriter) SetFileGetter(f func(string, *metadata.Block) (*os.File, error))
func (*BlockWriter) SetIndexFlusher ¶
func (bw *BlockWriter) SetIndexFlusher(f vecsIndexSerializer)
func (*BlockWriter) SetPostExecutor ¶
func (bw *BlockWriter) SetPostExecutor(f func())
func (*BlockWriter) SetPreExecutor ¶
func (bw *BlockWriter) SetPreExecutor(f func())
type ColPartFile ¶
type ColPartFile struct {
// SegmentFile is UnsortedSegmentFile or SortedSegmentFile
SegmentFile base.ISegmentFile
// ID is block id
ID *common.ID
// Info is block fileinfo
Info common.FileInfo
}
ColPartFile is a Reader instance of columnData in block, which provides external read services
func (*ColPartFile) GetFileType ¶
func (cpf *ColPartFile) GetFileType() common.FileType
func (*ColPartFile) Name ¶
func (cpf *ColPartFile) Name() string
func (*ColPartFile) Ref ¶
func (cpf *ColPartFile) Ref()
func (*ColPartFile) RefCount ¶
func (cpf *ColPartFile) RefCount() int64
func (*ColPartFile) Stat ¶
func (cpf *ColPartFile) Stat() common.FileInfo
func (*ColPartFile) Unref ¶
func (cpf *ColPartFile) Unref()
type EmbedBlockIndexFile ¶
type EmbedBlockIndexFile struct {
EmbedIndexFile
ID common.ID
}
func (*EmbedBlockIndexFile) Read ¶
func (bf *EmbedBlockIndexFile) Read(buf []byte) (n int, err error)
func (*EmbedBlockIndexFile) Ref ¶
func (bf *EmbedBlockIndexFile) Ref()
func (*EmbedBlockIndexFile) RefCount ¶
func (bf *EmbedBlockIndexFile) RefCount() int64
func (*EmbedBlockIndexFile) Stat ¶
func (bf *EmbedBlockIndexFile) Stat() common.FileInfo
func (*EmbedBlockIndexFile) Unref ¶
func (bf *EmbedBlockIndexFile) Unref()
type EmbedIndexFile ¶
type EmbedIndexFile struct {
SegmentFile base.ISegmentFile
Meta *base.IndexMeta
Info *fileStat
}
func (*EmbedIndexFile) GetFileType ¶
func (f *EmbedIndexFile) GetFileType() common.FileType
func (*EmbedIndexFile) Ref ¶
func (f *EmbedIndexFile) Ref()
func (*EmbedIndexFile) RefCount ¶
func (f *EmbedIndexFile) RefCount() int64
func (*EmbedIndexFile) Stat ¶
func (f *EmbedIndexFile) Stat() common.FileInfo
func (*EmbedIndexFile) Unref ¶
func (f *EmbedIndexFile) Unref()
type FileDestoryer ¶
type FileMeta ¶
type FileMeta struct {
Indices *base.IndicesMeta
}
func NewFileMeta ¶
func NewFileMeta() *FileMeta
type IndexFile ¶
func (*IndexFile) GetFileType ¶
type Manager ¶
type Manager struct {
sync.RWMutex
UnsortedFiles map[common.ID]base.ISegmentFile
SortedFiles map[common.ID]base.ISegmentFile
Dir string
Mock bool
}
func NewManager ¶
func (*Manager) GetSortedFile ¶
func (mgr *Manager) GetSortedFile(id common.ID) base.ISegmentFile
func (*Manager) GetUnsortedFile ¶
func (mgr *Manager) GetUnsortedFile(id common.ID) base.ISegmentFile
func (*Manager) RegisterSortedFiles ¶
func (*Manager) RegisterUnsortedFiles ¶
func (*Manager) UnregisterSortedFile ¶
func (*Manager) UnregisterUnsortedFile ¶
func (*Manager) UpgradeFile ¶
func (mgr *Manager) UpgradeFile(id common.ID) base.ISegmentFile
type MockColPartFile ¶
type MockColPartFile struct {
}
type MockSegmentFile ¶
type MockSegmentFile struct {
common.RefHelper
FileName string
FileType FileType
TypeName string
Refs int32
ID common.ID
Info *fileStat
}
func (*MockSegmentFile) Close ¶
func (msf *MockSegmentFile) Close() error
func (*MockSegmentFile) CopyTo ¶
func (msf *MockSegmentFile) CopyTo(dir string) error
func (*MockSegmentFile) DataCompressAlgo ¶
func (msf *MockSegmentFile) DataCompressAlgo(id common.ID) int
func (*MockSegmentFile) Destroy ¶
func (msf *MockSegmentFile) Destroy()
func (*MockSegmentFile) GetBlockIndicesMeta ¶
func (msf *MockSegmentFile) GetBlockIndicesMeta(id common.ID) *base.IndicesMeta
func (*MockSegmentFile) GetBlockSize ¶
func (msf *MockSegmentFile) GetBlockSize(_ common.ID) int64
func (*MockSegmentFile) GetDir ¶
func (msf *MockSegmentFile) GetDir() string
func (*MockSegmentFile) GetFileType ¶
func (msf *MockSegmentFile) GetFileType() common.FileType
func (*MockSegmentFile) GetIndicesMeta ¶
func (msf *MockSegmentFile) GetIndicesMeta() *base.IndicesMeta
func (*MockSegmentFile) LinkTo ¶
func (msf *MockSegmentFile) LinkTo(dir string) error
func (*MockSegmentFile) MakeVirtualBlkIndexFile ¶
func (*MockSegmentFile) MakeVirtualIndexFile ¶
func (msf *MockSegmentFile) MakeVirtualIndexFile(meta *base.IndexMeta) common.IVFile
func (*MockSegmentFile) MakeVirtualPartFile ¶
func (msf *MockSegmentFile) MakeVirtualPartFile(id *common.ID) common.IVFile
func (*MockSegmentFile) MakeVirtualSeparateIndexFile ¶
func (*MockSegmentFile) PrefetchPart ¶
func (msf *MockSegmentFile) PrefetchPart(colIdx uint64, id common.ID) error
func (*MockSegmentFile) ReadBlockPoint ¶
func (*MockSegmentFile) ReadPart ¶
func (msf *MockSegmentFile) ReadPart(colIdx uint64, id common.ID, buf []byte)
func (*MockSegmentFile) ReadPoint ¶
func (msf *MockSegmentFile) ReadPoint(ptr *base.Pointer, buf []byte)
func (*MockSegmentFile) Ref ¶
func (msf *MockSegmentFile) Ref()
func (*MockSegmentFile) RefBlock ¶
func (msf *MockSegmentFile) RefBlock(id common.ID)
func (*MockSegmentFile) RefTBlock ¶
func (msf *MockSegmentFile) RefTBlock(id common.ID) base.IBlockFile
func (*MockSegmentFile) RegisterTBlock ¶
func (msf *MockSegmentFile) RegisterTBlock(id common.ID) (base.IBlockFile, error)
func (*MockSegmentFile) Stat ¶
func (msf *MockSegmentFile) Stat() common.FileInfo
func (*MockSegmentFile) Unref ¶
func (msf *MockSegmentFile) Unref()
func (*MockSegmentFile) UnrefBlock ¶
func (msf *MockSegmentFile) UnrefBlock(id common.ID)
type SegmentWriter ¶
type SegmentWriter struct {
// contains filtered or unexported fields
}
BlkCnt | Blk0 Pos | Blk1 Pos | ... | BlkEndPos | Blk0 Data | ...
SegmentWriter writes block data into the created segment file when flushSegEvent(.blk count == SegmentMaxBlocks) is triggered.
func NewSegmentWriter ¶
func NewSegmentWriter(data iface.BlockIterator, meta *metadata.Segment, dir string, post func()) *SegmentWriter
NewSegmentWriter make a SegmentWriter, which is used when (block file count) == SegmentMaxBlocks
func (*SegmentWriter) Execute ¶
func (sw *SegmentWriter) Execute() error
Execute steps as follows: 1. Create a temp segment file. 3. Flush indices. 4. Compress column data and flush them. 5. Rename .tmp file to .seg file.
func (*SegmentWriter) GetDestoryer ¶
func (sw *SegmentWriter) GetDestoryer() FileDestoryer
func (*SegmentWriter) GetSize ¶
func (sw *SegmentWriter) GetSize() int64
func (*SegmentWriter) SetFileGetter ¶
func (sw *SegmentWriter) SetFileGetter(f func(string, *metadata.Segment) (*os.File, error))
func (*SegmentWriter) SetFlusher ¶
func (sw *SegmentWriter) SetFlusher(f func(*os.File, iface.BlockIterator, *metadata.Segment) error)
func (*SegmentWriter) SetPostExecutor ¶
func (sw *SegmentWriter) SetPostExecutor(f func())
func (*SegmentWriter) SetPreExecutor ¶
func (sw *SegmentWriter) SetPreExecutor(f func())
type SortedSegmentFile ¶
type SortedSegmentFile struct {
common.RefHelper
ID common.ID
os.File
Refs int32
Parts map[base.Key]*base.Pointer
Meta *FileMeta
BlocksMeta map[common.ID]*FileMeta
Info *fileStat
DataAlgo int
}
SortedSegmentFile file structure: header | reserved | algo | datalen | colCntlen | blkId 01 | blkCount 01| blkPreIdx 01| blkIdx 01| blkId 02 | blkCount 02... col01 : blkdatalen 01 | blkdata originlen 01| blkdatalen 02 | blkdata originlen 02... col02 : blkdatalen 01 | blkdata originlen 01| blkdatalen 02 | blkdata originlen 02... ... startPos | endPos | col01Pos | col02Pos ... col01 : blkdata01 | blkdata02 | blkdata03 ... col02 : blkdata01 | blkdata02 | blkdata03 ... ...
func (*SortedSegmentFile) CopyTo ¶
func (sf *SortedSegmentFile) CopyTo(dir string) error
func (*SortedSegmentFile) DataCompressAlgo ¶
func (sf *SortedSegmentFile) DataCompressAlgo(id common.ID) int
func (*SortedSegmentFile) Destroy ¶
func (sf *SortedSegmentFile) Destroy()
func (*SortedSegmentFile) GetBlockIndicesMeta ¶
func (sf *SortedSegmentFile) GetBlockIndicesMeta(id common.ID) *base.IndicesMeta
func (*SortedSegmentFile) GetBlockSize ¶
func (sf *SortedSegmentFile) GetBlockSize(_ common.ID) int64
func (*SortedSegmentFile) GetDir ¶
func (sf *SortedSegmentFile) GetDir() string
func (*SortedSegmentFile) GetFileType ¶
func (sf *SortedSegmentFile) GetFileType() common.FileType
func (*SortedSegmentFile) GetIndicesMeta ¶
func (sf *SortedSegmentFile) GetIndicesMeta() *base.IndicesMeta
func (*SortedSegmentFile) LinkTo ¶
func (sf *SortedSegmentFile) LinkTo(dir string) error
func (*SortedSegmentFile) MakeVirtualBlkIndexFile ¶
func (*SortedSegmentFile) MakeVirtualIndexFile ¶
func (sf *SortedSegmentFile) MakeVirtualIndexFile(meta *base.IndexMeta) common.IVFile
func (*SortedSegmentFile) MakeVirtualPartFile ¶
func (sf *SortedSegmentFile) MakeVirtualPartFile(id *common.ID) common.IVFile
func (*SortedSegmentFile) MakeVirtualSeparateIndexFile ¶
func (*SortedSegmentFile) PrefetchPart ¶
func (sf *SortedSegmentFile) PrefetchPart(colIdx uint64, id common.ID) error
func (*SortedSegmentFile) ReadBlockPoint ¶
func (*SortedSegmentFile) ReadPart ¶
func (sf *SortedSegmentFile) ReadPart(colIdx uint64, id common.ID, buf []byte)
func (*SortedSegmentFile) ReadPoint ¶
func (sf *SortedSegmentFile) ReadPoint(ptr *base.Pointer, buf []byte)
func (*SortedSegmentFile) RefBlock ¶
func (sf *SortedSegmentFile) RefBlock(id common.ID)
func (*SortedSegmentFile) RefTBlock ¶
func (sf *SortedSegmentFile) RefTBlock(id common.ID) base.IBlockFile
func (*SortedSegmentFile) RegisterTBlock ¶
func (sf *SortedSegmentFile) RegisterTBlock(id common.ID) (base.IBlockFile, error)
func (*SortedSegmentFile) Stat ¶
func (sf *SortedSegmentFile) Stat() common.FileInfo
func (*SortedSegmentFile) UnrefBlock ¶
func (sf *SortedSegmentFile) UnrefBlock(id common.ID)
type TransientBlockFile ¶
TransientBlockFile file structure: algo | colCntlen | metaCnt | preIdxLen | preIdx | IdxLen | Idx col01 : coldata len | coldata originlen | col02 : coldata len | coldata originlen | ... col01 data | col02 data | ...
func NewTBlockFile ¶
func NewTBlockFile(host base.ISegmentFile, id common.ID) *TransientBlockFile
func (*TransientBlockFile) Close ¶
func (f *TransientBlockFile) Close() error
func (*TransientBlockFile) CopyTo ¶
func (f *TransientBlockFile) CopyTo(path string) (err error)
func (*TransientBlockFile) DataCompressAlgo ¶
func (f *TransientBlockFile) DataCompressAlgo(common.ID) int
func (*TransientBlockFile) Destroy ¶
func (f *TransientBlockFile) Destroy()
func (*TransientBlockFile) GetDir ¶
func (f *TransientBlockFile) GetDir() string
func (*TransientBlockFile) GetIndicesMeta ¶
func (f *TransientBlockFile) GetIndicesMeta() *base.IndicesMeta
func (*TransientBlockFile) InitMeta ¶
func (f *TransientBlockFile) InitMeta(meta *metadata.Block)
func (*TransientBlockFile) LinkTo ¶
func (f *TransientBlockFile) LinkTo(path string) (err error)
func (*TransientBlockFile) LoadBatch ¶
func (f *TransientBlockFile) LoadBatch(meta *metadata.Block) batch.IBatch
func (*TransientBlockFile) MakeVirtualIndexFile ¶
func (f *TransientBlockFile) MakeVirtualIndexFile(*base.IndexMeta) common.IVFile
func (*TransientBlockFile) PreSync ¶
func (f *TransientBlockFile) PreSync(pos uint32) bool
func (*TransientBlockFile) PrefetchPart ¶
func (f *TransientBlockFile) PrefetchPart(colIdx uint64, id common.ID) error
func (*TransientBlockFile) ReadPart ¶
func (f *TransientBlockFile) ReadPart(colIdx uint64, id common.ID, buf []byte)
func (*TransientBlockFile) ReadPoint ¶
func (f *TransientBlockFile) ReadPoint(ptr *base.Pointer, buf []byte)
func (*TransientBlockFile) Stat ¶
func (f *TransientBlockFile) Stat() common.FileInfo
type UnsortedSegmentFile ¶
type UnsortedSegmentFile struct {
sync.RWMutex
common.RefHelper
ID common.ID
Blocks map[common.ID]base.IBlockFile
TBlocks map[common.ID]base.IBaseFile
Dir string
Info *fileStat
}
UnsortedSegmentFile is a logical file containing some block(.blk) files
func (*UnsortedSegmentFile) AddBlock ¶
func (sf *UnsortedSegmentFile) AddBlock(id common.ID, bf base.IBlockFile)
func (*UnsortedSegmentFile) Close ¶
func (sf *UnsortedSegmentFile) Close() error
func (*UnsortedSegmentFile) CopyTo ¶
func (sf *UnsortedSegmentFile) CopyTo(dir string) error
func (*UnsortedSegmentFile) DataCompressAlgo ¶
func (sf *UnsortedSegmentFile) DataCompressAlgo(id common.ID) int
func (*UnsortedSegmentFile) Destroy ¶
func (sf *UnsortedSegmentFile) Destroy()
func (*UnsortedSegmentFile) GetBlock ¶
func (sf *UnsortedSegmentFile) GetBlock(id common.ID) base.IBlockFile
func (*UnsortedSegmentFile) GetBlockIndicesMeta ¶
func (sf *UnsortedSegmentFile) GetBlockIndicesMeta(id common.ID) *base.IndicesMeta
func (*UnsortedSegmentFile) GetBlockSize ¶
func (sf *UnsortedSegmentFile) GetBlockSize(id common.ID) int64
func (*UnsortedSegmentFile) GetDir ¶
func (sf *UnsortedSegmentFile) GetDir() string
func (*UnsortedSegmentFile) GetFileType ¶
func (sf *UnsortedSegmentFile) GetFileType() common.FileType
func (*UnsortedSegmentFile) GetIndicesMeta ¶
func (sf *UnsortedSegmentFile) GetIndicesMeta() *base.IndicesMeta
func (*UnsortedSegmentFile) LinkTo ¶
func (sf *UnsortedSegmentFile) LinkTo(dir string) error
func (*UnsortedSegmentFile) MakeVirtualBlkIndexFile ¶
func (*UnsortedSegmentFile) MakeVirtualIndexFile ¶
func (sf *UnsortedSegmentFile) MakeVirtualIndexFile(meta *base.IndexMeta) common.IVFile
func (*UnsortedSegmentFile) MakeVirtualPartFile ¶
func (sf *UnsortedSegmentFile) MakeVirtualPartFile(id *common.ID) common.IVFile
func (*UnsortedSegmentFile) MakeVirtualSeparateIndexFile ¶
func (*UnsortedSegmentFile) PrefetchPart ¶
func (sf *UnsortedSegmentFile) PrefetchPart(colIdx uint64, id common.ID) error
func (*UnsortedSegmentFile) ReadBlockPoint ¶
func (*UnsortedSegmentFile) ReadPart ¶
func (sf *UnsortedSegmentFile) ReadPart(colIdx uint64, id common.ID, buf []byte)
func (*UnsortedSegmentFile) ReadPoint ¶
func (sf *UnsortedSegmentFile) ReadPoint(ptr *base.Pointer, buf []byte)
func (*UnsortedSegmentFile) RefBlock ¶
func (sf *UnsortedSegmentFile) RefBlock(id common.ID)
func (*UnsortedSegmentFile) RefTBlock ¶
func (sf *UnsortedSegmentFile) RefTBlock(id common.ID) base.IBlockFile
func (*UnsortedSegmentFile) RegisterTBlock ¶
func (sf *UnsortedSegmentFile) RegisterTBlock(id common.ID) (base.IBlockFile, error)
func (*UnsortedSegmentFile) Stat ¶
func (sf *UnsortedSegmentFile) Stat() common.FileInfo
func (*UnsortedSegmentFile) UnrefBlock ¶
func (sf *UnsortedSegmentFile) UnrefBlock(id common.ID)