Documentation
¶
Overview ¶
Package binlog package
Index ¶
- type BinLogger
- type MemBinlog
- func (l *MemBinlog) CheckFileExist(fiIndex *storePb.StoreInfo) (bool, error)
- func (l *MemBinlog) Close() error
- func (l *MemBinlog) DropOpenedFileCache(_ string) bool
- func (l *MemBinlog) LastIndex() (uint64, error)
- func (l *MemBinlog) ReadFileSection(fiIndex *storePb.StoreInfo, _ time.Duration) ([]byte, error)
- func (l *MemBinlog) ReadLastSegSection(index uint64, _ bool) ([]byte, string, uint64, uint64, error)
- func (l *MemBinlog) TruncateFront(index uint64) error
- func (l *MemBinlog) Write(index uint64, data []byte) (fileName string, offset, blkLen uint64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinLogger ¶
type BinLogger interface {
// TruncateFront add next time
// @Description:
// @param index
// @return error
TruncateFront(index uint64) error
// ReadLastSegSection add next time
// @Description:
// @param index
// @return data
// @return fileName
// @return offset
// @return blkLen
// @return err
ReadLastSegSection(index uint64, forceFetch bool) (data []byte, fileName string, offset, blkLen uint64, err error)
// LastIndex add next time
// @Description:
// @return index
// @return err
LastIndex() (index uint64, err error)
// Write add next time
// @Description:
// @param index
// @param data
// @return fileName
// @return offset
// @return blkLen
// @return err
Write(index uint64, data []byte) (fileName string, offset, blkLen uint64, err error)
// ReadFileSection read data, according to file index
// @Description:
// @param fiIndex
// @param timeOut
// @return []byte
// @return error
ReadFileSection(fiIndex *storePb.StoreInfo, timeOut time.Duration) ([]byte, error)
// DropOpenedFileCache drop opened file handle cache
// @Description:
// @param path
// @return bool
DropOpenedFileCache(path string) bool
// CheckFileExist check file exist
// @Description:
// @param fiIndex
// @return bool
// @return error
CheckFileExist(fiIndex *storePb.StoreInfo) (bool, error)
// Close add next time
// @Description:
// @return error
Close() error
}
BinLogger add next time @Description:
type MemBinlog ¶
type MemBinlog struct {
// contains filtered or unexported fields
}
MemBinlog add next time
@Description:
func (*MemBinlog) CheckFileExist ¶ added in v2.3.4
CheckFileExist check file exist
@receiver l
@Description: @param fiIndex @return bool @return error
func (*MemBinlog) DropOpenedFileCache ¶ added in v2.3.4
DropOpenedFileCache drop opened file handle cache @Description: @receiver l @param _ @return bool
func (*MemBinlog) LastIndex ¶
LastIndex 返回最后写入的索引
@Description: @receiver l @return uint64 @return error
func (*MemBinlog) ReadFileSection ¶ added in v2.2.0
ReadFileSection 根据索引,读取对应数据
@Description: @receiver l @param fiIndex @return []byte @return error
func (*MemBinlog) ReadLastSegSection ¶ added in v2.2.0
func (l *MemBinlog) ReadLastSegSection(index uint64, _ bool) ([]byte, string, uint64, uint64, error)
ReadLastSegSection 读取最后的segment
@Description: @receiver l @param index @return []byte @return string @return uint64 @return uint64 @return error
func (*MemBinlog) TruncateFront ¶
TruncateFront 指定index 清空
@Description: @receiver l @param index @return error
Source Files
¶
- binloger.go
- memBinlog.go
Click to show internal directories.
Click to hide internal directories.