Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToString(b []byte) string
- func DecodeBinlogEvent(e *raftpb.Entry) *storagepb.BinlogEvent
- func DirExist(dir string) bool
- func EncodeBinlogEvent(e *storagepb.BinlogEvent) ([]byte, error)
- func ExistLog(dirpath string) bool
- func GetIndexName(segmentName string) string
- func GetIndexPath(logPath string) string
- func IsBinlogEvent(e *raftpb.Entry) bool
- func IsDirWriteable(dir string) error
- func MustMarshal(m Marshaler) []byte
- func MustUnmarshal(um Unmarshaler, data []byte)
- func NewUniformSample(reservoirSize int) metrics.Sample
- func ReadDir(dirname string) ([]os.FileInfo, error)
- func StringToBytes(s string) []byte
- type Broadcast
- type Marshaler
- type Resp
- type UniformSample
- func (s *UniformSample) Clear()
- func (s *UniformSample) Count() int64
- func (s *UniformSample) Max() int64
- func (s *UniformSample) Mean() float64
- func (s *UniformSample) Min() int64
- func (s *UniformSample) Percentile(p float64) float64
- func (s *UniformSample) Percentiles(ps []float64) []float64
- func (s *UniformSample) Size() int
- func (s *UniformSample) Snapshot() metrics.Sample
- func (s *UniformSample) StdDev() float64
- func (s *UniformSample) Sum() int64
- func (s *UniformSample) Update(v int64)
- func (s *UniformSample) Values() []int64
- func (s *UniformSample) Variance() float64
- type Unmarshaler
Constants ¶
const ( // PrivateFileMode grants owner to read/write a file. PrivateFileMode = 0600 // PrivateDirMode grants owner to make/remove files inside the directory. PrivateDirMode = 0700 )
const ( //MySQLBinlogEventType is mysql binlog event flag MySQLBinlogEventType byte = iota + 1 //NodeAttributesType for update the node admin url NodeAttributesType //SyncerArgsType is syncer start args flag SyncerArgsType //MasterInfoType is master info flag MasterInfoType //MasterGtidPurgedType is master gtid_purged flag MasterGtidPurgedType )
Variables ¶
var ( //LogSuffix is the log file name suffix LogSuffix = ".log" //IndexSuffix is the index file name suffix IndexSuffix = ".index" )
Functions ¶
func DecodeBinlogEvent ¶
func DecodeBinlogEvent(e *raftpb.Entry) *storagepb.BinlogEvent
DecodeBinlogEvent decode raft entry to binlog event
func EncodeBinlogEvent ¶
func EncodeBinlogEvent(e *storagepb.BinlogEvent) ([]byte, error)
EncodeBinlogEvent encode binlog event to data
func GetIndexName ¶
GetIndexName get the index file name by segment name
func GetIndexPath ¶
GetIndexPath get index path by log path
func IsBinlogEvent ¶
IsBinlogEvent check the raft entry is binlog event
func MustUnmarshal ¶
func MustUnmarshal(um Unmarshaler, data []byte)
MustUnmarshal execute occur error will panic
func NewUniformSample ¶
func NewUniformSample(reservoirSize int) metrics.Sample
NewUniformSample constructs a new uniform sample with the given reservoir size.
Types ¶
type Broadcast ¶
type Broadcast struct {
// contains filtered or unexported fields
}
Broadcast allows to send a signal to all listeners
type Resp ¶
type Resp struct { Message string `json:"message"` Data interface{} `json:"data,omitempty"` }
Resp is the response return to client
func SendRequest ¶
SendRequest send PUT request to leader
type UniformSample ¶
type UniformSample struct {
// contains filtered or unexported fields
}
UniformSample is a metric sample
func (*UniformSample) Count ¶
func (s *UniformSample) Count() int64
Count returns the number of samples recorded, which may exceed the reservoir size.
func (*UniformSample) Max ¶
func (s *UniformSample) Max() int64
Max returns the maximum value in the sample, which may not be the maximum value ever to be part of the sample.
func (*UniformSample) Mean ¶
func (s *UniformSample) Mean() float64
Mean returns the mean of the values in the sample.
func (*UniformSample) Min ¶
func (s *UniformSample) Min() int64
Min returns the minimum value in the sample, which may not be the minimum value ever to be part of the sample.
func (*UniformSample) Percentile ¶
func (s *UniformSample) Percentile(p float64) float64
Percentile returns an arbitrary percentile of values in the sample.
func (*UniformSample) Percentiles ¶
func (s *UniformSample) Percentiles(ps []float64) []float64
Percentiles returns a slice of arbitrary percentiles of values in the sample.
func (*UniformSample) Size ¶
func (s *UniformSample) Size() int
Size returns the size of the sample, which is at most the reservoir size.
func (*UniformSample) Snapshot ¶
func (s *UniformSample) Snapshot() metrics.Sample
Snapshot returns a read-only copy of the sample.
func (*UniformSample) StdDev ¶
func (s *UniformSample) StdDev() float64
StdDev returns the standard deviation of the values in the sample.
func (*UniformSample) Sum ¶
func (s *UniformSample) Sum() int64
Sum returns the sum of the values in the sample.
func (*UniformSample) Values ¶
func (s *UniformSample) Values() []int64
Values returns a copy of the values in the sample.
func (*UniformSample) Variance ¶
func (s *UniformSample) Variance() float64
Variance returns the variance of the values in the sample.
type Unmarshaler ¶
Unmarshaler implements byte to struct