Documentation ¶
Index ¶
Constants ¶
View Source
const ( LOCAL_BINLOG_MANAGER XBinlogManagerType = 1 SYNC_BINLOG_MANAGER XBinlogManagerType = 2 TRACKER_BINLOG_MANAGER XBinlogManagerType = 3 MAX_BINLOG_SIZE int = 2 << 20 // 200w binlog records LOCAL_BINLOG_SIZE = 102 // single binlog size. )
Variables ¶
This section is empty.
Functions ¶
func CreateLocalBinlog ¶
CreateLocalBinlog builds an Binlog.
func TryFixBinlogFile ¶
func TryFixBinlogFile() error
TryFixBinlogFile tries to fix binlog file by appending '\n' to current binlog file in every boot.
Types ¶
type XBinlogManager ¶
type XBinlogManager interface { // GetType returns this manager type. // // manager type could be one of: // `LOCAL_BINLOG_MANAGER`, // `SYNC_BINLOG_MANAGER`, // `TRACKER_BINLOG_MANAGER` GetType() XBinlogManagerType // GetCurrentIndex gets current binlog file index. GetCurrentIndex() int // Write writes a binlog to file. Write(bin ...*common.BingLog) error // Read reads binlog from file. // // fileIndex: the binlog file index, -1 means reads from latest binlog file. // offset: read offset in bytes, must be integer multiple of the binlog. Read(fileIndex int, offset int64, fetchLine int) ([]common.BingLogDTO, int64, error) }
XBinlogManager is an interface for binlog manager.
func NewXBinlogManager ¶
func NewXBinlogManager(managerType XBinlogManagerType) XBinlogManager
NewXBinlogManager creates a new binlog manager.
type XBinlogManagerType ¶
type XBinlogManagerType byte
type XBinlogMapManager ¶
type XBinlogMapManager struct {
// contains filtered or unexported fields
}
func (*XBinlogMapManager) GetRecords ¶
func (m *XBinlogMapManager) GetRecords(fileIndex int) (size int, err error)
GetRecords get binlog record size by binlog file index.
func (*XBinlogMapManager) SetRecords ¶
func (m *XBinlogMapManager) SetRecords(fileIndex int, value int) (err error)
Click to show internal directories.
Click to hide internal directories.