Documentation ¶
Index ¶
- type BinLogger
- type MemBinlog
- func (l *MemBinlog) Close() error
- func (l *MemBinlog) LastIndex() (uint64, error)
- func (l *MemBinlog) ReadFileSection(fiIndex *storePb.StoreInfo) ([]byte, error)
- func (l *MemBinlog) ReadLastSegSection(index uint64) ([]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 { // Close add next time // @Description: // @return error Close() error // 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) (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 // @return []byte // @return error ReadFileSection(fiIndex *storePb.StoreInfo) ([]byte, error) }
BinLogger add next time @Description:
type MemBinlog ¶
type MemBinlog struct {
// contains filtered or unexported fields
}
MemBinlog add next time
@Description:
func NewMemBinlog ¶
func NewMemBinlog(log protocol.Logger) *MemBinlog
NewMemBinlog 创建一个内存binlog
@Description: @param log @return *MemBinlog
func (*MemBinlog) LastIndex ¶
LastIndex 返回最后写入的索引
@Description: @receiver l @return uint64 @return error
func (*MemBinlog) ReadFileSection ¶
ReadFileSection 根据索引,读取对应数据
@Description: @receiver l @param fiIndex @return []byte @return error
func (*MemBinlog) ReadLastSegSection ¶
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
Click to show internal directories.
Click to hide internal directories.