Documentation ¶
Index ¶
- Variables
- func Archive(archive string, raws []string) error
- func Unarchive(archive string) (string, error)
- type OpLogger
- func (ol *OpLogger) BatchWriteOpLogs(ops []*pb.OpLogEntry)
- func (ol *OpLogger) CompactWALFile()
- func (ol *OpLogger) DumpOpLogs(shutdown chan struct{})
- func (ol *OpLogger) ReplayOpLogs()
- func (ol *OpLogger) RotateWALFile()
- func (ol *OpLogger) SyncOpLogs()
- func (ol *OpLogger) WriteOpLog(op *pb.OpLogEntry)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RPCAddOpTimeout = 60 * time.Second RotateSize = 67108864 // 64M ExpiredDays = 168.0 // 7 days CompactTogether = 3 )
Functions ¶
Types ¶
type OpLogger ¶
type OpLogger struct { OplogCh chan *pb.OpLogEntry RecordedCh chan struct{} // contains filtered or unexported fields }
OpLogger implements Write-Ahead logging
func NewOpLogger ¶
func (*OpLogger) BatchWriteOpLogs ¶
func (ol *OpLogger) BatchWriteOpLogs(ops []*pb.OpLogEntry)
BatchWriteOpLogs xxx
func (*OpLogger) CompactWALFile ¶
func (ol *OpLogger) CompactWALFile()
CompactWALFile compacts wal files those last modified time is one week ago.
func (*OpLogger) DumpOpLogs ¶
func (ol *OpLogger) DumpOpLogs(shutdown chan struct{})
DumpOpLogs dumps operation logs for fault-tolerence.
func (*OpLogger) ReplayOpLogs ¶
func (ol *OpLogger) ReplayOpLogs()
ReplayOpLogs replays all stored operation logs from failure recover.
func (*OpLogger) RotateWALFile ¶
func (ol *OpLogger) RotateWALFile()
RotateWALFile rotates wal file when it grows to 64M.
func (*OpLogger) SyncOpLogs ¶
func (ol *OpLogger) SyncOpLogs()
SyncOpLogs syncs operation logs to backup servers for fault-tolerence.
Click to show internal directories.
Click to hide internal directories.