id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
135,100
vitessio/vitess
go/vt/topo/helpers/compare.go
CompareRoutingRules
func CompareRoutingRules(ctx context.Context, fromTS, toTS *topo.Server) error { rrFrom, err := fromTS.GetRoutingRules(ctx) if err != nil { return vterrors.Wrapf(err, "GetKeyspace(from)") } rrTo, err := toTS.GetRoutingRules(ctx) if err != nil { return vterrors.Wrapf(err, "GetKeyspace(to)") } if !proto.Equal(...
go
func CompareRoutingRules(ctx context.Context, fromTS, toTS *topo.Server) error { rrFrom, err := fromTS.GetRoutingRules(ctx) if err != nil { return vterrors.Wrapf(err, "GetKeyspace(from)") } rrTo, err := toTS.GetRoutingRules(ctx) if err != nil { return vterrors.Wrapf(err, "GetKeyspace(to)") } if !proto.Equal(...
[ "func", "CompareRoutingRules", "(", "ctx", "context", ".", "Context", ",", "fromTS", ",", "toTS", "*", "topo", ".", "Server", ")", "error", "{", "rrFrom", ",", "err", ":=", "fromTS", ".", "GetRoutingRules", "(", "ctx", ")", "\n", "if", "err", "!=", "ni...
// CompareRoutingRules will compare the routing rules in the destination topo.
[ "CompareRoutingRules", "will", "compare", "the", "routing", "rules", "in", "the", "destination", "topo", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/helpers/compare.go#L185-L198
135,101
vitessio/vitess
go/vt/vtctl/grpcvtctlserver/server.go
ExecuteVtctlCommand
func (s *VtctlServer) ExecuteVtctlCommand(args *vtctldatapb.ExecuteVtctlCommandRequest, stream vtctlservicepb.Vtctl_ExecuteVtctlCommandServer) (err error) { defer servenv.HandlePanic("vtctl", &err) // Create a logger, send the result back to the caller. // We may execute this in parallel (inside multiple go routine...
go
func (s *VtctlServer) ExecuteVtctlCommand(args *vtctldatapb.ExecuteVtctlCommandRequest, stream vtctlservicepb.Vtctl_ExecuteVtctlCommandServer) (err error) { defer servenv.HandlePanic("vtctl", &err) // Create a logger, send the result back to the caller. // We may execute this in parallel (inside multiple go routine...
[ "func", "(", "s", "*", "VtctlServer", ")", "ExecuteVtctlCommand", "(", "args", "*", "vtctldatapb", ".", "ExecuteVtctlCommandRequest", ",", "stream", "vtctlservicepb", ".", "Vtctl_ExecuteVtctlCommandServer", ")", "(", "err", "error", ")", "{", "defer", "servenv", "...
// ExecuteVtctlCommand is part of the vtctldatapb.VtctlServer interface
[ "ExecuteVtctlCommand", "is", "part", "of", "the", "vtctldatapb", ".", "VtctlServer", "interface" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtctl/grpcvtctlserver/server.go#L51-L78
135,102
vitessio/vitess
go/vt/vtctl/grpcvtctlserver/server.go
StartServer
func StartServer(s *grpc.Server, ts *topo.Server) { vtctlservicepb.RegisterVtctlServer(s, NewVtctlServer(ts)) }
go
func StartServer(s *grpc.Server, ts *topo.Server) { vtctlservicepb.RegisterVtctlServer(s, NewVtctlServer(ts)) }
[ "func", "StartServer", "(", "s", "*", "grpc", ".", "Server", ",", "ts", "*", "topo", ".", "Server", ")", "{", "vtctlservicepb", ".", "RegisterVtctlServer", "(", "s", ",", "NewVtctlServer", "(", "ts", ")", ")", "\n", "}" ]
// StartServer registers the VtctlServer for RPCs
[ "StartServer", "registers", "the", "VtctlServer", "for", "RPCs" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtctl/grpcvtctlserver/server.go#L81-L83
135,103
vitessio/vitess
go/vt/vttablet/tabletserver/querylogz.go
querylogzHandler
func querylogzHandler(ch chan interface{}, w http.ResponseWriter, r *http.Request) { if err := acl.CheckAccessHTTP(r, acl.DEBUGGING); err != nil { acl.SendError(w, err) return } timeout, limit := parseTimeoutLimitParams(r) logz.StartHTMLTable(w) defer logz.EndHTMLTable(w) w.Write(querylogzHeader) tmr := tim...
go
func querylogzHandler(ch chan interface{}, w http.ResponseWriter, r *http.Request) { if err := acl.CheckAccessHTTP(r, acl.DEBUGGING); err != nil { acl.SendError(w, err) return } timeout, limit := parseTimeoutLimitParams(r) logz.StartHTMLTable(w) defer logz.EndHTMLTable(w) w.Write(querylogzHeader) tmr := tim...
[ "func", "querylogzHandler", "(", "ch", "chan", "interface", "{", "}", ",", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "if", "err", ":=", "acl", ".", "CheckAccessHTTP", "(", "r", ",", "acl", ".", "DEBUGGING", ...
// querylogzHandler serves a human readable snapshot of the // current query log.
[ "querylogzHandler", "serves", "a", "human", "readable", "snapshot", "of", "the", "current", "query", "log", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/querylogz.go#L98-L146
135,104
vitessio/vitess
go/vt/mysqlctl/backupengine.go
GetBackupEngine
func GetBackupEngine() (BackupEngine, error) { be, ok := BackupEngineMap[*backupEngineImplementation] if !ok { return nil, vterrors.New(vtrpc.Code_NOT_FOUND, "no registered implementation of BackupEngine") } return be, nil }
go
func GetBackupEngine() (BackupEngine, error) { be, ok := BackupEngineMap[*backupEngineImplementation] if !ok { return nil, vterrors.New(vtrpc.Code_NOT_FOUND, "no registered implementation of BackupEngine") } return be, nil }
[ "func", "GetBackupEngine", "(", ")", "(", "BackupEngine", ",", "error", ")", "{", "be", ",", "ok", ":=", "BackupEngineMap", "[", "*", "backupEngineImplementation", "]", "\n", "if", "!", "ok", "{", "return", "nil", ",", "vterrors", ".", "New", "(", "vtrpc...
// GetBackupEngine returns the current BackupEngine implementation. // Should be called after flags have been initialized.
[ "GetBackupEngine", "returns", "the", "current", "BackupEngine", "implementation", ".", "Should", "be", "called", "after", "flags", "have", "been", "initialized", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/backupengine.go#L46-L52
135,105
vitessio/vitess
go/mysql/slave_status.go
SlaveStatusToProto
func SlaveStatusToProto(s SlaveStatus) *replicationdatapb.Status { return &replicationdatapb.Status{ Position: EncodePosition(s.Position), SlaveIoRunning: s.SlaveIORunning, SlaveSqlRunning: s.SlaveSQLRunning, SecondsBehindMaster: uint32(s.SecondsBehindMaster), MasterHost: s.Maste...
go
func SlaveStatusToProto(s SlaveStatus) *replicationdatapb.Status { return &replicationdatapb.Status{ Position: EncodePosition(s.Position), SlaveIoRunning: s.SlaveIORunning, SlaveSqlRunning: s.SlaveSQLRunning, SecondsBehindMaster: uint32(s.SecondsBehindMaster), MasterHost: s.Maste...
[ "func", "SlaveStatusToProto", "(", "s", "SlaveStatus", ")", "*", "replicationdatapb", ".", "Status", "{", "return", "&", "replicationdatapb", ".", "Status", "{", "Position", ":", "EncodePosition", "(", "s", ".", "Position", ")", ",", "SlaveIoRunning", ":", "s"...
// SlaveStatusToProto translates a Status to proto3.
[ "SlaveStatusToProto", "translates", "a", "Status", "to", "proto3", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/slave_status.go#L42-L52
135,106
vitessio/vitess
go/mysql/slave_status.go
ProtoToSlaveStatus
func ProtoToSlaveStatus(s *replicationdatapb.Status) SlaveStatus { pos, err := DecodePosition(s.Position) if err != nil { panic(vterrors.Wrapf(err, "cannot decode Position")) } return SlaveStatus{ Position: pos, SlaveIORunning: s.SlaveIoRunning, SlaveSQLRunning: s.SlaveSqlRunning, Seco...
go
func ProtoToSlaveStatus(s *replicationdatapb.Status) SlaveStatus { pos, err := DecodePosition(s.Position) if err != nil { panic(vterrors.Wrapf(err, "cannot decode Position")) } return SlaveStatus{ Position: pos, SlaveIORunning: s.SlaveIoRunning, SlaveSQLRunning: s.SlaveSqlRunning, Seco...
[ "func", "ProtoToSlaveStatus", "(", "s", "*", "replicationdatapb", ".", "Status", ")", "SlaveStatus", "{", "pos", ",", "err", ":=", "DecodePosition", "(", "s", ".", "Position", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "vterrors", ".", "Wrap...
// ProtoToSlaveStatus translates a proto Status, or panics.
[ "ProtoToSlaveStatus", "translates", "a", "proto", "Status", "or", "panics", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/slave_status.go#L55-L69
135,107
vitessio/vitess
go/vt/topotools/split.go
ContainsShard
func (os *OverlappingShards) ContainsShard(shardName string) bool { for _, l := range os.Left { if l.ShardName() == shardName { return true } } for _, r := range os.Right { if r.ShardName() == shardName { return true } } return false }
go
func (os *OverlappingShards) ContainsShard(shardName string) bool { for _, l := range os.Left { if l.ShardName() == shardName { return true } } for _, r := range os.Right { if r.ShardName() == shardName { return true } } return false }
[ "func", "(", "os", "*", "OverlappingShards", ")", "ContainsShard", "(", "shardName", "string", ")", "bool", "{", "for", "_", ",", "l", ":=", "range", "os", ".", "Left", "{", "if", "l", ".", "ShardName", "(", ")", "==", "shardName", "{", "return", "tr...
// ContainsShard returns true if either Left or Right lists contain // the provided Shard.
[ "ContainsShard", "returns", "true", "if", "either", "Left", "or", "Right", "lists", "contain", "the", "provided", "Shard", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topotools/split.go#L37-L49
135,108
vitessio/vitess
go/vt/topotools/split.go
OverlappingShardsForShard
func OverlappingShardsForShard(os []*OverlappingShards, shardName string) *OverlappingShards { for _, o := range os { if o.ContainsShard(shardName) { return o } } return nil }
go
func OverlappingShardsForShard(os []*OverlappingShards, shardName string) *OverlappingShards { for _, o := range os { if o.ContainsShard(shardName) { return o } } return nil }
[ "func", "OverlappingShardsForShard", "(", "os", "[", "]", "*", "OverlappingShards", ",", "shardName", "string", ")", "*", "OverlappingShards", "{", "for", "_", ",", "o", ":=", "range", "os", "{", "if", "o", ".", "ContainsShard", "(", "shardName", ")", "{",...
// OverlappingShardsForShard returns the OverlappingShards object // from the list that has he provided shard, or nil
[ "OverlappingShardsForShard", "returns", "the", "OverlappingShards", "object", "from", "the", "list", "that", "has", "he", "provided", "shard", "or", "nil" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topotools/split.go#L53-L60
135,109
vitessio/vitess
go/vt/topotools/split.go
findOverlappingShards
func findOverlappingShards(shardMap map[string]*topo.ShardInfo) ([]*OverlappingShards, error) { var result []*OverlappingShards for len(shardMap) > 0 { var left []*topo.ShardInfo var right []*topo.ShardInfo // get the first value from the map, seed our left array with it var name string var si *topo.Shar...
go
func findOverlappingShards(shardMap map[string]*topo.ShardInfo) ([]*OverlappingShards, error) { var result []*OverlappingShards for len(shardMap) > 0 { var left []*topo.ShardInfo var right []*topo.ShardInfo // get the first value from the map, seed our left array with it var name string var si *topo.Shar...
[ "func", "findOverlappingShards", "(", "shardMap", "map", "[", "string", "]", "*", "topo", ".", "ShardInfo", ")", "(", "[", "]", "*", "OverlappingShards", ",", "error", ")", "{", "var", "result", "[", "]", "*", "OverlappingShards", "\n\n", "for", "len", "...
// findOverlappingShards does the work for FindOverlappingShards but // can be called on test data too.
[ "findOverlappingShards", "does", "the", "work", "for", "FindOverlappingShards", "but", "can", "be", "called", "on", "test", "data", "too", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topotools/split.go#L79-L164
135,110
vitessio/vitess
go/vt/topotools/split.go
findIntersectingShard
func findIntersectingShard(shardMap map[string]*topo.ShardInfo, sourceArray []*topo.ShardInfo) *topo.ShardInfo { for name, si := range shardMap { for _, sourceShardInfo := range sourceArray { if si.KeyRange == nil || sourceShardInfo.KeyRange == nil || key.KeyRangesIntersect(si.KeyRange, sourceShardInfo.KeyRange) ...
go
func findIntersectingShard(shardMap map[string]*topo.ShardInfo, sourceArray []*topo.ShardInfo) *topo.ShardInfo { for name, si := range shardMap { for _, sourceShardInfo := range sourceArray { if si.KeyRange == nil || sourceShardInfo.KeyRange == nil || key.KeyRangesIntersect(si.KeyRange, sourceShardInfo.KeyRange) ...
[ "func", "findIntersectingShard", "(", "shardMap", "map", "[", "string", "]", "*", "topo", ".", "ShardInfo", ",", "sourceArray", "[", "]", "*", "topo", ".", "ShardInfo", ")", "*", "topo", ".", "ShardInfo", "{", "for", "name", ",", "si", ":=", "range", "...
// findIntersectingShard will go through the map and take the first // entry in there that intersect with the source array, remove it from // the map, and return it
[ "findIntersectingShard", "will", "go", "through", "the", "map", "and", "take", "the", "first", "entry", "in", "there", "that", "intersect", "with", "the", "source", "array", "remove", "it", "from", "the", "map", "and", "return", "it" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topotools/split.go#L169-L179
135,111
vitessio/vitess
go/vt/topotools/split.go
intersect
func intersect(si *topo.ShardInfo, allShards []*topo.ShardInfo) bool { for _, shard := range allShards { if key.KeyRangesIntersect(si.KeyRange, shard.KeyRange) { return true } } return false }
go
func intersect(si *topo.ShardInfo, allShards []*topo.ShardInfo) bool { for _, shard := range allShards { if key.KeyRangesIntersect(si.KeyRange, shard.KeyRange) { return true } } return false }
[ "func", "intersect", "(", "si", "*", "topo", ".", "ShardInfo", ",", "allShards", "[", "]", "*", "topo", ".", "ShardInfo", ")", "bool", "{", "for", "_", ",", "shard", ":=", "range", "allShards", "{", "if", "key", ".", "KeyRangesIntersect", "(", "si", ...
// intersect returns true if the provided shard intersect with any shard // in the destination array
[ "intersect", "returns", "true", "if", "the", "provided", "shard", "intersect", "with", "any", "shard", "in", "the", "destination", "array" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topotools/split.go#L183-L190
135,112
vitessio/vitess
go/vt/automation/scheduler.go
NewScheduler
func NewScheduler() (*Scheduler, error) { defaultClusterOperations := map[string]bool{ "HorizontalReshardingTask": true, "VerticalSplitTask": true, } s := &Scheduler{ registeredClusterOperations: defaultClusterOperations, idGenerator: IDGenerator{}, toBeScheduledClusterOperati...
go
func NewScheduler() (*Scheduler, error) { defaultClusterOperations := map[string]bool{ "HorizontalReshardingTask": true, "VerticalSplitTask": true, } s := &Scheduler{ registeredClusterOperations: defaultClusterOperations, idGenerator: IDGenerator{}, toBeScheduledClusterOperati...
[ "func", "NewScheduler", "(", ")", "(", "*", "Scheduler", ",", "error", ")", "{", "defaultClusterOperations", ":=", "map", "[", "string", "]", "bool", "{", "\"", "\"", ":", "true", ",", "\"", "\"", ":", "true", ",", "}", "\n\n", "s", ":=", "&", "Sch...
// NewScheduler creates a new instance.
[ "NewScheduler", "creates", "a", "new", "instance", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/automation/scheduler.go#L76-L94
135,113
vitessio/vitess
go/vt/automation/scheduler.go
Run
func (s *Scheduler) Run() { s.mu.Lock() s.state = stateRunning s.mu.Unlock() s.startProcessRequestsLoop() }
go
func (s *Scheduler) Run() { s.mu.Lock() s.state = stateRunning s.mu.Unlock() s.startProcessRequestsLoop() }
[ "func", "(", "s", "*", "Scheduler", ")", "Run", "(", ")", "{", "s", ".", "mu", ".", "Lock", "(", ")", "\n", "s", ".", "state", "=", "stateRunning", "\n", "s", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "s", ".", "startProcessRequestsLoop", "(", ...
// Run processes queued cluster operations.
[ "Run", "processes", "queued", "cluster", "operations", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/automation/scheduler.go#L104-L110
135,114
vitessio/vitess
go/vt/automation/scheduler.go
EnqueueClusterOperation
func (s *Scheduler) EnqueueClusterOperation(ctx context.Context, req *automationpb.EnqueueClusterOperationRequest) (*automationpb.EnqueueClusterOperationResponse, error) { s.mu.Lock() defer s.mu.Unlock() if s.state != stateRunning { return nil, fmt.Errorf("scheduler is not running. State: %v", s.state) } if !s...
go
func (s *Scheduler) EnqueueClusterOperation(ctx context.Context, req *automationpb.EnqueueClusterOperationRequest) (*automationpb.EnqueueClusterOperationResponse, error) { s.mu.Lock() defer s.mu.Unlock() if s.state != stateRunning { return nil, fmt.Errorf("scheduler is not running. State: %v", s.state) } if !s...
[ "func", "(", "s", "*", "Scheduler", ")", "EnqueueClusterOperation", "(", "ctx", "context", ".", "Context", ",", "req", "*", "automationpb", ".", "EnqueueClusterOperationRequest", ")", "(", "*", "automationpb", ".", "EnqueueClusterOperationResponse", ",", "error", ...
// EnqueueClusterOperation can be used to start a new cluster operation.
[ "EnqueueClusterOperation", "can", "be", "used", "to", "start", "a", "new", "cluster", "operation", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/automation/scheduler.go#L307-L337
135,115
vitessio/vitess
go/vt/automation/scheduler.go
findClusterOp
func (s *Scheduler) findClusterOp(id string) (ClusterOperationInstance, error) { var ok bool var clusterOp ClusterOperationInstance s.muOpList.Lock() defer s.muOpList.Unlock() clusterOp, ok = s.activeClusterOperations[id] if !ok { clusterOp, ok = s.finishedClusterOperations[id] } if !ok { return clusterOp,...
go
func (s *Scheduler) findClusterOp(id string) (ClusterOperationInstance, error) { var ok bool var clusterOp ClusterOperationInstance s.muOpList.Lock() defer s.muOpList.Unlock() clusterOp, ok = s.activeClusterOperations[id] if !ok { clusterOp, ok = s.finishedClusterOperations[id] } if !ok { return clusterOp,...
[ "func", "(", "s", "*", "Scheduler", ")", "findClusterOp", "(", "id", "string", ")", "(", "ClusterOperationInstance", ",", "error", ")", "{", "var", "ok", "bool", "\n", "var", "clusterOp", "ClusterOperationInstance", "\n\n", "s", ".", "muOpList", ".", "Lock",...
// findClusterOp checks for a given ClusterOperation ID if it's in the list of active or finished operations.
[ "findClusterOp", "checks", "for", "a", "given", "ClusterOperation", "ID", "if", "it", "s", "in", "the", "list", "of", "active", "or", "finished", "operations", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/automation/scheduler.go#L340-L354
135,116
vitessio/vitess
go/vt/automation/scheduler.go
Checkpoint
func (s *Scheduler) Checkpoint(clusterOp ClusterOperationInstance) { // TODO(mberlin): Add here support for persistent checkpoints. s.muOpList.Lock() defer s.muOpList.Unlock() s.activeClusterOperations[clusterOp.Id] = clusterOp.Clone() }
go
func (s *Scheduler) Checkpoint(clusterOp ClusterOperationInstance) { // TODO(mberlin): Add here support for persistent checkpoints. s.muOpList.Lock() defer s.muOpList.Unlock() s.activeClusterOperations[clusterOp.Id] = clusterOp.Clone() }
[ "func", "(", "s", "*", "Scheduler", ")", "Checkpoint", "(", "clusterOp", "ClusterOperationInstance", ")", "{", "// TODO(mberlin): Add here support for persistent checkpoints.", "s", ".", "muOpList", ".", "Lock", "(", ")", "\n", "defer", "s", ".", "muOpList", ".", ...
// Checkpoint should be called every time the state of the cluster op changes. // It is used to update the copy of the state in activeClusterOperations.
[ "Checkpoint", "should", "be", "called", "every", "time", "the", "state", "of", "the", "cluster", "op", "changes", ".", "It", "is", "used", "to", "update", "the", "copy", "of", "the", "state", "in", "activeClusterOperations", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/automation/scheduler.go#L358-L363
135,117
vitessio/vitess
go/vt/automation/scheduler.go
GetClusterOperationDetails
func (s *Scheduler) GetClusterOperationDetails(ctx context.Context, req *automationpb.GetClusterOperationDetailsRequest) (*automationpb.GetClusterOperationDetailsResponse, error) { clusterOp, err := s.findClusterOp(req.Id) if err != nil { return nil, err } return &automationpb.GetClusterOperationDetailsResponse{ ...
go
func (s *Scheduler) GetClusterOperationDetails(ctx context.Context, req *automationpb.GetClusterOperationDetailsRequest) (*automationpb.GetClusterOperationDetailsResponse, error) { clusterOp, err := s.findClusterOp(req.Id) if err != nil { return nil, err } return &automationpb.GetClusterOperationDetailsResponse{ ...
[ "func", "(", "s", "*", "Scheduler", ")", "GetClusterOperationDetails", "(", "ctx", "context", ".", "Context", ",", "req", "*", "automationpb", ".", "GetClusterOperationDetailsRequest", ")", "(", "*", "automationpb", ".", "GetClusterOperationDetailsResponse", ",", "e...
// GetClusterOperationDetails can be used to query the full details of active or finished operations.
[ "GetClusterOperationDetails", "can", "be", "used", "to", "query", "the", "full", "details", "of", "active", "or", "finished", "operations", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/automation/scheduler.go#L366-L374
135,118
vitessio/vitess
go/vt/automation/scheduler.go
ShutdownAndWait
func (s *Scheduler) ShutdownAndWait() { s.mu.Lock() if s.state != stateShuttingDown { s.state = stateShuttingDown close(s.toBeScheduledClusterOperations) } s.mu.Unlock() log.Infof("Scheduler was shut down. Waiting for pending ClusterOperations to finish.") s.pendingOpsWg.Wait() s.mu.Lock() s.state = state...
go
func (s *Scheduler) ShutdownAndWait() { s.mu.Lock() if s.state != stateShuttingDown { s.state = stateShuttingDown close(s.toBeScheduledClusterOperations) } s.mu.Unlock() log.Infof("Scheduler was shut down. Waiting for pending ClusterOperations to finish.") s.pendingOpsWg.Wait() s.mu.Lock() s.state = state...
[ "func", "(", "s", "*", "Scheduler", ")", "ShutdownAndWait", "(", ")", "{", "s", ".", "mu", ".", "Lock", "(", ")", "\n", "if", "s", ".", "state", "!=", "stateShuttingDown", "{", "s", ".", "state", "=", "stateShuttingDown", "\n", "close", "(", "s", "...
// ShutdownAndWait shuts down the scheduler and waits infinitely until all pending cluster operations have finished.
[ "ShutdownAndWait", "shuts", "down", "the", "scheduler", "and", "waits", "infinitely", "until", "all", "pending", "cluster", "operations", "have", "finished", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/automation/scheduler.go#L377-L392
135,119
vitessio/vitess
go/vt/topo/memorytopo/memorytopo.go
SetError
func (f *Factory) SetError(err error) { f.mu.Lock() defer f.mu.Unlock() f.err = err if err != nil { for _, node := range f.cells { node.PropagateWatchError(err) } } }
go
func (f *Factory) SetError(err error) { f.mu.Lock() defer f.mu.Unlock() f.err = err if err != nil { for _, node := range f.cells { node.PropagateWatchError(err) } } }
[ "func", "(", "f", "*", "Factory", ")", "SetError", "(", "err", "error", ")", "{", "f", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "f", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "f", ".", "err", "=", "err", "\n", "if", "err", "!=", "...
// SetError forces the given error to be returned from all calls and propagates // the error to all active watches.
[ "SetError", "forces", "the", "given", "error", "to", "be", "returned", "from", "all", "calls", "and", "propagates", "the", "error", "to", "all", "active", "watches", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/memorytopo/memorytopo.go#L89-L99
135,120
vitessio/vitess
go/vt/topo/memorytopo/memorytopo.go
PropagateWatchError
func (n *node) PropagateWatchError(err error) { for _, ch := range n.watches { ch <- &topo.WatchData{ Err: err, } } for _, c := range n.children { c.PropagateWatchError(err) } }
go
func (n *node) PropagateWatchError(err error) { for _, ch := range n.watches { ch <- &topo.WatchData{ Err: err, } } for _, c := range n.children { c.PropagateWatchError(err) } }
[ "func", "(", "n", "*", "node", ")", "PropagateWatchError", "(", "err", "error", ")", "{", "for", "_", ",", "ch", ":=", "range", "n", ".", "watches", "{", "ch", "<-", "&", "topo", ".", "WatchData", "{", "Err", ":", "err", ",", "}", "\n", "}", "\...
// PropagateWatchError propagates the given error to all watches on this node // and recursively applies to all children
[ "PropagateWatchError", "propagates", "the", "given", "error", "to", "all", "watches", "on", "this", "node", "and", "recursively", "applies", "to", "all", "children" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/memorytopo/memorytopo.go#L157-L167
135,121
vitessio/vitess
go/vt/topo/memorytopo/memorytopo.go
NewServerAndFactory
func NewServerAndFactory(cells ...string) (*topo.Server, *Factory) { f := &Factory{ cells: make(map[string]*node), generation: uint64(rand.Int63n(2 ^ 60)), } f.cells[topo.GlobalCell] = f.newDirectory(topo.GlobalCell, nil) ctx := context.Background() ts, err := topo.NewWithFactory(f, "" /*serverAddress*/,...
go
func NewServerAndFactory(cells ...string) (*topo.Server, *Factory) { f := &Factory{ cells: make(map[string]*node), generation: uint64(rand.Int63n(2 ^ 60)), } f.cells[topo.GlobalCell] = f.newDirectory(topo.GlobalCell, nil) ctx := context.Background() ts, err := topo.NewWithFactory(f, "" /*serverAddress*/,...
[ "func", "NewServerAndFactory", "(", "cells", "...", "string", ")", "(", "*", "topo", ".", "Server", ",", "*", "Factory", ")", "{", "f", ":=", "&", "Factory", "{", "cells", ":", "make", "(", "map", "[", "string", "]", "*", "node", ")", ",", "generat...
// NewServerAndFactory returns a new MemoryTopo and the backing factory for all // the cells. It will create one cell for each parameter passed in. It will log.Exit out // in case of a problem.
[ "NewServerAndFactory", "returns", "a", "new", "MemoryTopo", "and", "the", "backing", "factory", "for", "all", "the", "cells", ".", "It", "will", "create", "one", "cell", "for", "each", "parameter", "passed", "in", ".", "It", "will", "log", ".", "Exit", "ou...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/memorytopo/memorytopo.go#L172-L191
135,122
vitessio/vitess
go/vt/topo/memorytopo/memorytopo.go
NewServer
func NewServer(cells ...string) *topo.Server { server, _ := NewServerAndFactory(cells...) return server }
go
func NewServer(cells ...string) *topo.Server { server, _ := NewServerAndFactory(cells...) return server }
[ "func", "NewServer", "(", "cells", "...", "string", ")", "*", "topo", ".", "Server", "{", "server", ",", "_", ":=", "NewServerAndFactory", "(", "cells", "...", ")", "\n", "return", "server", "\n", "}" ]
// NewServer returns the new server
[ "NewServer", "returns", "the", "new", "server" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/memorytopo/memorytopo.go#L194-L197
135,123
vitessio/vitess
go/vt/topo/memorytopo/memorytopo.go
recursiveDelete
func (f *Factory) recursiveDelete(n *node) { parent := n.parent if parent == nil { return } delete(parent.children, n.name) if len(parent.children) == 0 { f.recursiveDelete(parent) } }
go
func (f *Factory) recursiveDelete(n *node) { parent := n.parent if parent == nil { return } delete(parent.children, n.name) if len(parent.children) == 0 { f.recursiveDelete(parent) } }
[ "func", "(", "f", "*", "Factory", ")", "recursiveDelete", "(", "n", "*", "node", ")", "{", "parent", ":=", "n", ".", "parent", "\n", "if", "parent", "==", "nil", "{", "return", "\n", "}", "\n", "delete", "(", "parent", ".", "children", ",", "n", ...
// recursiveDelete deletes a node and its parent directory if empty.
[ "recursiveDelete", "deletes", "a", "node", "and", "its", "parent", "directory", "if", "empty", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/memorytopo/memorytopo.go#L277-L286
135,124
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlserver/server.go
Start
func (s *server) Start(ctx context.Context, request *mysqlctlpb.StartRequest) (*mysqlctlpb.StartResponse, error) { return &mysqlctlpb.StartResponse{}, s.mysqld.Start(ctx, s.cnf, request.MysqldArgs...) }
go
func (s *server) Start(ctx context.Context, request *mysqlctlpb.StartRequest) (*mysqlctlpb.StartResponse, error) { return &mysqlctlpb.StartResponse{}, s.mysqld.Start(ctx, s.cnf, request.MysqldArgs...) }
[ "func", "(", "s", "*", "server", ")", "Start", "(", "ctx", "context", ".", "Context", ",", "request", "*", "mysqlctlpb", ".", "StartRequest", ")", "(", "*", "mysqlctlpb", ".", "StartResponse", ",", "error", ")", "{", "return", "&", "mysqlctlpb", ".", "...
// Start implements the server side of the MysqlctlClient interface.
[ "Start", "implements", "the", "server", "side", "of", "the", "MysqlctlClient", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlserver/server.go#L39-L41
135,125
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlserver/server.go
Shutdown
func (s *server) Shutdown(ctx context.Context, request *mysqlctlpb.ShutdownRequest) (*mysqlctlpb.ShutdownResponse, error) { return &mysqlctlpb.ShutdownResponse{}, s.mysqld.Shutdown(ctx, s.cnf, request.WaitForMysqld) }
go
func (s *server) Shutdown(ctx context.Context, request *mysqlctlpb.ShutdownRequest) (*mysqlctlpb.ShutdownResponse, error) { return &mysqlctlpb.ShutdownResponse{}, s.mysqld.Shutdown(ctx, s.cnf, request.WaitForMysqld) }
[ "func", "(", "s", "*", "server", ")", "Shutdown", "(", "ctx", "context", ".", "Context", ",", "request", "*", "mysqlctlpb", ".", "ShutdownRequest", ")", "(", "*", "mysqlctlpb", ".", "ShutdownResponse", ",", "error", ")", "{", "return", "&", "mysqlctlpb", ...
// Shutdown implements the server side of the MysqlctlClient interface.
[ "Shutdown", "implements", "the", "server", "side", "of", "the", "MysqlctlClient", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlserver/server.go#L44-L46
135,126
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlserver/server.go
RunMysqlUpgrade
func (s *server) RunMysqlUpgrade(ctx context.Context, request *mysqlctlpb.RunMysqlUpgradeRequest) (*mysqlctlpb.RunMysqlUpgradeResponse, error) { return &mysqlctlpb.RunMysqlUpgradeResponse{}, s.mysqld.RunMysqlUpgrade() }
go
func (s *server) RunMysqlUpgrade(ctx context.Context, request *mysqlctlpb.RunMysqlUpgradeRequest) (*mysqlctlpb.RunMysqlUpgradeResponse, error) { return &mysqlctlpb.RunMysqlUpgradeResponse{}, s.mysqld.RunMysqlUpgrade() }
[ "func", "(", "s", "*", "server", ")", "RunMysqlUpgrade", "(", "ctx", "context", ".", "Context", ",", "request", "*", "mysqlctlpb", ".", "RunMysqlUpgradeRequest", ")", "(", "*", "mysqlctlpb", ".", "RunMysqlUpgradeResponse", ",", "error", ")", "{", "return", "...
// RunMysqlUpgrade implements the server side of the MysqlctlClient interface.
[ "RunMysqlUpgrade", "implements", "the", "server", "side", "of", "the", "MysqlctlClient", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlserver/server.go#L49-L51
135,127
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlserver/server.go
ReinitConfig
func (s *server) ReinitConfig(ctx context.Context, request *mysqlctlpb.ReinitConfigRequest) (*mysqlctlpb.ReinitConfigResponse, error) { return &mysqlctlpb.ReinitConfigResponse{}, s.mysqld.ReinitConfig(ctx, s.cnf) }
go
func (s *server) ReinitConfig(ctx context.Context, request *mysqlctlpb.ReinitConfigRequest) (*mysqlctlpb.ReinitConfigResponse, error) { return &mysqlctlpb.ReinitConfigResponse{}, s.mysqld.ReinitConfig(ctx, s.cnf) }
[ "func", "(", "s", "*", "server", ")", "ReinitConfig", "(", "ctx", "context", ".", "Context", ",", "request", "*", "mysqlctlpb", ".", "ReinitConfigRequest", ")", "(", "*", "mysqlctlpb", ".", "ReinitConfigResponse", ",", "error", ")", "{", "return", "&", "my...
// ReinitConfig implements the server side of the MysqlctlClient interface.
[ "ReinitConfig", "implements", "the", "server", "side", "of", "the", "MysqlctlClient", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlserver/server.go#L54-L56
135,128
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlserver/server.go
RefreshConfig
func (s *server) RefreshConfig(ctx context.Context, request *mysqlctlpb.RefreshConfigRequest) (*mysqlctlpb.RefreshConfigResponse, error) { return &mysqlctlpb.RefreshConfigResponse{}, s.mysqld.RefreshConfig(ctx, s.cnf) }
go
func (s *server) RefreshConfig(ctx context.Context, request *mysqlctlpb.RefreshConfigRequest) (*mysqlctlpb.RefreshConfigResponse, error) { return &mysqlctlpb.RefreshConfigResponse{}, s.mysqld.RefreshConfig(ctx, s.cnf) }
[ "func", "(", "s", "*", "server", ")", "RefreshConfig", "(", "ctx", "context", ".", "Context", ",", "request", "*", "mysqlctlpb", ".", "RefreshConfigRequest", ")", "(", "*", "mysqlctlpb", ".", "RefreshConfigResponse", ",", "error", ")", "{", "return", "&", ...
// RefreshConfig implements the server side of the MysqlctlClient interface.
[ "RefreshConfig", "implements", "the", "server", "side", "of", "the", "MysqlctlClient", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlserver/server.go#L59-L61
135,129
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlserver/server.go
StartServer
func StartServer(s *grpc.Server, cnf *mysqlctl.Mycnf, mysqld *mysqlctl.Mysqld) { mysqlctlpb.RegisterMysqlCtlServer(s, &server{cnf: cnf, mysqld: mysqld}) }
go
func StartServer(s *grpc.Server, cnf *mysqlctl.Mycnf, mysqld *mysqlctl.Mysqld) { mysqlctlpb.RegisterMysqlCtlServer(s, &server{cnf: cnf, mysqld: mysqld}) }
[ "func", "StartServer", "(", "s", "*", "grpc", ".", "Server", ",", "cnf", "*", "mysqlctl", ".", "Mycnf", ",", "mysqld", "*", "mysqlctl", ".", "Mysqld", ")", "{", "mysqlctlpb", ".", "RegisterMysqlCtlServer", "(", "s", ",", "&", "server", "{", "cnf", ":",...
// StartServer registers the Server for RPCs.
[ "StartServer", "registers", "the", "Server", "for", "RPCs", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlserver/server.go#L64-L66
135,130
vitessio/vitess
go/vt/vtgate/vindexes/numeric.go
NewNumeric
func NewNumeric(name string, _ map[string]string) (Vindex, error) { return &Numeric{name: name}, nil }
go
func NewNumeric(name string, _ map[string]string) (Vindex, error) { return &Numeric{name: name}, nil }
[ "func", "NewNumeric", "(", "name", "string", ",", "_", "map", "[", "string", "]", "string", ")", "(", "Vindex", ",", "error", ")", "{", "return", "&", "Numeric", "{", "name", ":", "name", "}", ",", "nil", "\n", "}" ]
// NewNumeric creates a Numeric vindex.
[ "NewNumeric", "creates", "a", "Numeric", "vindex", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vindexes/numeric.go#L41-L43
135,131
vitessio/vitess
go/vt/throttler/max_rate_module.go
SetMaxRate
func (m *MaxRateModule) SetMaxRate(rate int64) { m.maxRate.Set(rate) m.rateUpdateChan <- struct{}{} }
go
func (m *MaxRateModule) SetMaxRate(rate int64) { m.maxRate.Set(rate) m.rateUpdateChan <- struct{}{} }
[ "func", "(", "m", "*", "MaxRateModule", ")", "SetMaxRate", "(", "rate", "int64", ")", "{", "m", ".", "maxRate", ".", "Set", "(", "rate", ")", "\n", "m", ".", "rateUpdateChan", "<-", "struct", "{", "}", "{", "}", "\n", "}" ]
// SetMaxRate sets the current max rate and notifies the throttler about the // rate update.
[ "SetMaxRate", "sets", "the", "current", "max", "rate", "and", "notifies", "the", "throttler", "about", "the", "rate", "update", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/max_rate_module.go#L53-L56
135,132
vitessio/vitess
go/vt/vtgate/vindexes/null.go
NewNull
func NewNull(name string, m map[string]string) (Vindex, error) { return &Null{name: name}, nil }
go
func NewNull(name string, m map[string]string) (Vindex, error) { return &Null{name: name}, nil }
[ "func", "NewNull", "(", "name", "string", ",", "m", "map", "[", "string", "]", "string", ")", "(", "Vindex", ",", "error", ")", "{", "return", "&", "Null", "{", "name", ":", "name", "}", ",", "nil", "\n", "}" ]
// NewNull creates a new Null.
[ "NewNull", "creates", "a", "new", "Null", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vindexes/null.go#L42-L44
135,133
vitessio/vitess
go/vt/binlog/binlogplayer/mock_dbclient.go
NewMockDBClient
func NewMockDBClient(t *testing.T) *MockDBClient { return &MockDBClient{ t: t, done: make(chan struct{}), } }
go
func NewMockDBClient(t *testing.T) *MockDBClient { return &MockDBClient{ t: t, done: make(chan struct{}), } }
[ "func", "NewMockDBClient", "(", "t", "*", "testing", ".", "T", ")", "*", "MockDBClient", "{", "return", "&", "MockDBClient", "{", "t", ":", "t", ",", "done", ":", "make", "(", "chan", "struct", "{", "}", ")", ",", "}", "\n", "}" ]
// NewMockDBClient returns a new DBClientMock.
[ "NewMockDBClient", "returns", "a", "new", "DBClientMock", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/binlog/binlogplayer/mock_dbclient.go#L44-L49
135,134
vitessio/vitess
go/vt/binlog/binlogplayer/mock_dbclient.go
ExpectRequest
func (dc *MockDBClient) ExpectRequest(query string, result *sqltypes.Result, err error) { select { case <-dc.done: dc.done = make(chan struct{}) default: } dc.expect = append(dc.expect, &mockExpect{ query: query, result: result, err: err, }) }
go
func (dc *MockDBClient) ExpectRequest(query string, result *sqltypes.Result, err error) { select { case <-dc.done: dc.done = make(chan struct{}) default: } dc.expect = append(dc.expect, &mockExpect{ query: query, result: result, err: err, }) }
[ "func", "(", "dc", "*", "MockDBClient", ")", "ExpectRequest", "(", "query", "string", ",", "result", "*", "sqltypes", ".", "Result", ",", "err", "error", ")", "{", "select", "{", "case", "<-", "dc", ".", "done", ":", "dc", ".", "done", "=", "make", ...
// ExpectRequest adds an expected result to the mock. // This function should not be called conncurrently with other commands.
[ "ExpectRequest", "adds", "an", "expected", "result", "to", "the", "mock", ".", "This", "function", "should", "not", "be", "called", "conncurrently", "with", "other", "commands", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/binlog/binlogplayer/mock_dbclient.go#L53-L64
135,135
vitessio/vitess
go/vt/binlog/binlogplayer/mock_dbclient.go
ExpectRequestRE
func (dc *MockDBClient) ExpectRequestRE(queryRE string, result *sqltypes.Result, err error) { select { case <-dc.done: dc.done = make(chan struct{}) default: } dc.expect = append(dc.expect, &mockExpect{ query: queryRE, re: regexp.MustCompile(queryRE), result: result, err: err, }) }
go
func (dc *MockDBClient) ExpectRequestRE(queryRE string, result *sqltypes.Result, err error) { select { case <-dc.done: dc.done = make(chan struct{}) default: } dc.expect = append(dc.expect, &mockExpect{ query: queryRE, re: regexp.MustCompile(queryRE), result: result, err: err, }) }
[ "func", "(", "dc", "*", "MockDBClient", ")", "ExpectRequestRE", "(", "queryRE", "string", ",", "result", "*", "sqltypes", ".", "Result", ",", "err", "error", ")", "{", "select", "{", "case", "<-", "dc", ".", "done", ":", "dc", ".", "done", "=", "make...
// ExpectRequestRE adds an expected result to the mock. // queryRE is a regular expression. // This function should not be called conncurrently with other commands.
[ "ExpectRequestRE", "adds", "an", "expected", "result", "to", "the", "mock", ".", "queryRE", "is", "a", "regular", "expression", ".", "This", "function", "should", "not", "be", "called", "conncurrently", "with", "other", "commands", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/binlog/binlogplayer/mock_dbclient.go#L69-L81
135,136
vitessio/vitess
go/vt/binlog/binlogplayer/mock_dbclient.go
Wait
func (dc *MockDBClient) Wait() { dc.t.Helper() select { case <-dc.done: return case <-time.After(5 * time.Second): dc.t.Fatalf("timeout waiting for requests, want: %v", dc.expect[dc.currentResult].query) } }
go
func (dc *MockDBClient) Wait() { dc.t.Helper() select { case <-dc.done: return case <-time.After(5 * time.Second): dc.t.Fatalf("timeout waiting for requests, want: %v", dc.expect[dc.currentResult].query) } }
[ "func", "(", "dc", "*", "MockDBClient", ")", "Wait", "(", ")", "{", "dc", ".", "t", ".", "Helper", "(", ")", "\n", "select", "{", "case", "<-", "dc", ".", "done", ":", "return", "\n", "case", "<-", "time", ".", "After", "(", "5", "*", "time", ...
// Wait waits for all expected requests to be executed. // dc.t.Fatalf is executed on 1 second timeout. Wait should // not be called concurrently with ExpectRequest.
[ "Wait", "waits", "for", "all", "expected", "requests", "to", "be", "executed", ".", "dc", ".", "t", ".", "Fatalf", "is", "executed", "on", "1", "second", "timeout", ".", "Wait", "should", "not", "be", "called", "concurrently", "with", "ExpectRequest", "." ...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/binlog/binlogplayer/mock_dbclient.go#L86-L94
135,137
vitessio/vitess
go/vt/binlog/binlogplayer/mock_dbclient.go
ExecuteFetch
func (dc *MockDBClient) ExecuteFetch(query string, maxrows int) (qr *sqltypes.Result, err error) { dc.t.Helper() dc.t.Logf("DBClient query: %v", query) if dc.currentResult >= len(dc.expect) { dc.t.Fatalf("DBClientMock: query: %s, no more requests are expected", query) } result := dc.expect[dc.currentResult] if ...
go
func (dc *MockDBClient) ExecuteFetch(query string, maxrows int) (qr *sqltypes.Result, err error) { dc.t.Helper() dc.t.Logf("DBClient query: %v", query) if dc.currentResult >= len(dc.expect) { dc.t.Fatalf("DBClientMock: query: %s, no more requests are expected", query) } result := dc.expect[dc.currentResult] if ...
[ "func", "(", "dc", "*", "MockDBClient", ")", "ExecuteFetch", "(", "query", "string", ",", "maxrows", "int", ")", "(", "qr", "*", "sqltypes", ".", "Result", ",", "err", "error", ")", "{", "dc", ".", "t", ".", "Helper", "(", ")", "\n", "dc", ".", "...
// ExecuteFetch is part of the DBClient interface
[ "ExecuteFetch", "is", "part", "of", "the", "DBClient", "interface" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/binlog/binlogplayer/mock_dbclient.go#L129-L150
135,138
vitessio/vitess
go/vt/vttablet/tabletserver/planbuilder/plan.go
PlanByName
func PlanByName(s string) (pt PlanType, ok bool) { for i, v := range planName { if v == s { return PlanType(i), true } } return NumPlans, false }
go
func PlanByName(s string) (pt PlanType, ok bool) { for i, v := range planName { if v == s { return PlanType(i), true } } return NumPlans, false }
[ "func", "PlanByName", "(", "s", "string", ")", "(", "pt", "PlanType", ",", "ok", "bool", ")", "{", "for", "i", ",", "v", ":=", "range", "planName", "{", "if", "v", "==", "s", "{", "return", "PlanType", "(", "i", ")", ",", "true", "\n", "}", "\n...
// PlanByName find a PlanType by its string name.
[ "PlanByName", "find", "a", "PlanType", "by", "its", "string", "name", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/planbuilder/plan.go#L121-L128
135,139
vitessio/vitess
go/vt/vttablet/tabletserver/planbuilder/plan.go
IsSelect
func (pt PlanType) IsSelect() bool { return pt == PlanPassSelect || pt == PlanSelectLock || pt == PlanSelectImpossible }
go
func (pt PlanType) IsSelect() bool { return pt == PlanPassSelect || pt == PlanSelectLock || pt == PlanSelectImpossible }
[ "func", "(", "pt", "PlanType", ")", "IsSelect", "(", ")", "bool", "{", "return", "pt", "==", "PlanPassSelect", "||", "pt", "==", "PlanSelectLock", "||", "pt", "==", "PlanSelectImpossible", "\n", "}" ]
// IsSelect returns true if PlanType is about a select query.
[ "IsSelect", "returns", "true", "if", "PlanType", "is", "about", "a", "select", "query", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/planbuilder/plan.go#L131-L133
135,140
vitessio/vitess
go/vt/vttablet/tabletserver/planbuilder/plan.go
MarshalJSON
func (rt ReasonType) MarshalJSON() ([]byte, error) { return ([]byte)(fmt.Sprintf("\"%s\"", rt.String())), nil }
go
func (rt ReasonType) MarshalJSON() ([]byte, error) { return ([]byte)(fmt.Sprintf("\"%s\"", rt.String())), nil }
[ "func", "(", "rt", "ReasonType", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "return", "(", "[", "]", "byte", ")", "(", "fmt", ".", "Sprintf", "(", "\"", "\\\"", "\\\"", "\"", ",", "rt", ".", "String", "(", ")",...
// MarshalJSON returns a json string for ReasonType.
[ "MarshalJSON", "returns", "a", "json", "string", "for", "ReasonType", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/planbuilder/plan.go#L178-L180
135,141
vitessio/vitess
go/vt/vttablet/tabletserver/planbuilder/plan.go
TableName
func (plan *Plan) TableName() sqlparser.TableIdent { var tableName sqlparser.TableIdent if plan.Table != nil { tableName = plan.Table.Name } return tableName }
go
func (plan *Plan) TableName() sqlparser.TableIdent { var tableName sqlparser.TableIdent if plan.Table != nil { tableName = plan.Table.Name } return tableName }
[ "func", "(", "plan", "*", "Plan", ")", "TableName", "(", ")", "sqlparser", ".", "TableIdent", "{", "var", "tableName", "sqlparser", ".", "TableIdent", "\n", "if", "plan", ".", "Table", "!=", "nil", "{", "tableName", "=", "plan", ".", "Table", ".", "Nam...
// TableName returns the table name for the plan.
[ "TableName", "returns", "the", "table", "name", "for", "the", "plan", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/planbuilder/plan.go#L230-L236
135,142
vitessio/vitess
go/vt/vttablet/tabletserver/planbuilder/plan.go
Build
func Build(statement sqlparser.Statement, tables map[string]*schema.Table) (*Plan, error) { var plan *Plan err := checkForPoolingUnsafeConstructs(statement) if err != nil { return nil, err } switch stmt := statement.(type) { case *sqlparser.Union: plan, err = &Plan{ PlanID: PlanPassSelect, FieldQu...
go
func Build(statement sqlparser.Statement, tables map[string]*schema.Table) (*Plan, error) { var plan *Plan err := checkForPoolingUnsafeConstructs(statement) if err != nil { return nil, err } switch stmt := statement.(type) { case *sqlparser.Union: plan, err = &Plan{ PlanID: PlanPassSelect, FieldQu...
[ "func", "Build", "(", "statement", "sqlparser", ".", "Statement", ",", "tables", "map", "[", "string", "]", "*", "schema", ".", "Table", ")", "(", "*", "Plan", ",", "error", ")", "{", "var", "plan", "*", "Plan", "\n\n", "err", ":=", "checkForPoolingUns...
// Build builds a plan based on the schema.
[ "Build", "builds", "a", "plan", "based", "on", "the", "schema", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/planbuilder/plan.go#L246-L287
135,143
vitessio/vitess
go/vt/vttablet/tabletserver/planbuilder/plan.go
BuildStreaming
func BuildStreaming(sql string, tables map[string]*schema.Table) (*Plan, error) { statement, err := sqlparser.Parse(sql) if err != nil { return nil, err } err = checkForPoolingUnsafeConstructs(statement) if err != nil { return nil, err } plan := &Plan{ PlanID: PlanSelectStream, FullQuery: Genera...
go
func BuildStreaming(sql string, tables map[string]*schema.Table) (*Plan, error) { statement, err := sqlparser.Parse(sql) if err != nil { return nil, err } err = checkForPoolingUnsafeConstructs(statement) if err != nil { return nil, err } plan := &Plan{ PlanID: PlanSelectStream, FullQuery: Genera...
[ "func", "BuildStreaming", "(", "sql", "string", ",", "tables", "map", "[", "string", "]", "*", "schema", ".", "Table", ")", "(", "*", "Plan", ",", "error", ")", "{", "statement", ",", "err", ":=", "sqlparser", ".", "Parse", "(", "sql", ")", "\n", "...
// BuildStreaming builds a streaming plan based on the schema.
[ "BuildStreaming", "builds", "a", "streaming", "plan", "based", "on", "the", "schema", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/planbuilder/plan.go#L290-L322
135,144
vitessio/vitess
go/vt/vttablet/tabletserver/planbuilder/plan.go
BuildMessageStreaming
func BuildMessageStreaming(name string, tables map[string]*schema.Table) (*Plan, error) { plan := &Plan{ PlanID: PlanMessageStream, Table: tables[name], } if plan.Table == nil { return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "table %s not found in schema", name) } if plan.Table.Type != schema.Me...
go
func BuildMessageStreaming(name string, tables map[string]*schema.Table) (*Plan, error) { plan := &Plan{ PlanID: PlanMessageStream, Table: tables[name], } if plan.Table == nil { return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "table %s not found in schema", name) } if plan.Table.Type != schema.Me...
[ "func", "BuildMessageStreaming", "(", "name", "string", ",", "tables", "map", "[", "string", "]", "*", "schema", ".", "Table", ")", "(", "*", "Plan", ",", "error", ")", "{", "plan", ":=", "&", "Plan", "{", "PlanID", ":", "PlanMessageStream", ",", "Tabl...
// BuildMessageStreaming builds a plan for message streaming.
[ "BuildMessageStreaming", "builds", "a", "plan", "for", "message", "streaming", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/planbuilder/plan.go#L325-L341
135,145
vitessio/vitess
go/vt/vtqueryserver/vtqueryserver.go
Init
func Init(dbcfgs *dbconfigs.DBConfigs) error { qs, err := initProxy(dbcfgs) if err != nil { return err } servenv.OnRun(func() { qs.Register() addStatusParts(qs) }) healthCheckTimer := timer.NewTimer(*healthCheckInterval) healthCheckTimer.Start(func() { if !qs.IsServing() { _ /* stateChanged */, heal...
go
func Init(dbcfgs *dbconfigs.DBConfigs) error { qs, err := initProxy(dbcfgs) if err != nil { return err } servenv.OnRun(func() { qs.Register() addStatusParts(qs) }) healthCheckTimer := timer.NewTimer(*healthCheckInterval) healthCheckTimer.Start(func() { if !qs.IsServing() { _ /* stateChanged */, heal...
[ "func", "Init", "(", "dbcfgs", "*", "dbconfigs", ".", "DBConfigs", ")", "error", "{", "qs", ",", "err", ":=", "initProxy", "(", "dbcfgs", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "servenv", ".", "OnRun", "(", "f...
// Init initializes the proxy
[ "Init", "initializes", "the", "proxy" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtqueryserver/vtqueryserver.go#L70-L100
135,146
vitessio/vitess
go/pools/numbered.go
Unregister
func (nu *Numbered) Unregister(id int64, reason string) { success := nu.unregister(id, reason) if success { nu.recentlyUnregistered.Set( fmt.Sprintf("%v", id), &unregistered{reason: reason, timeUnregistered: time.Now()}) } }
go
func (nu *Numbered) Unregister(id int64, reason string) { success := nu.unregister(id, reason) if success { nu.recentlyUnregistered.Set( fmt.Sprintf("%v", id), &unregistered{reason: reason, timeUnregistered: time.Now()}) } }
[ "func", "(", "nu", "*", "Numbered", ")", "Unregister", "(", "id", "int64", ",", "reason", "string", ")", "{", "success", ":=", "nu", ".", "unregister", "(", "id", ",", "reason", ")", "\n", "if", "success", "{", "nu", ".", "recentlyUnregistered", ".", ...
// Unregister forgets the specified resource. If the resource is not present, it's ignored.
[ "Unregister", "forgets", "the", "specified", "resource", ".", "If", "the", "resource", "is", "not", "present", "it", "s", "ignored", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/pools/numbered.go#L88-L94
135,147
vitessio/vitess
go/pools/numbered.go
unregister
func (nu *Numbered) unregister(id int64, reason string) bool { nu.mu.Lock() defer nu.mu.Unlock() _, ok := nu.resources[id] delete(nu.resources, id) if len(nu.resources) == 0 { nu.empty.Broadcast() } return ok }
go
func (nu *Numbered) unregister(id int64, reason string) bool { nu.mu.Lock() defer nu.mu.Unlock() _, ok := nu.resources[id] delete(nu.resources, id) if len(nu.resources) == 0 { nu.empty.Broadcast() } return ok }
[ "func", "(", "nu", "*", "Numbered", ")", "unregister", "(", "id", "int64", ",", "reason", "string", ")", "bool", "{", "nu", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "nu", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "_", ",", "ok", ":=",...
// unregister forgets the resource, if it exists. Returns whether or not the resource existed at // time of Unregister.
[ "unregister", "forgets", "the", "resource", "if", "it", "exists", ".", "Returns", "whether", "or", "not", "the", "resource", "existed", "at", "time", "of", "Unregister", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/pools/numbered.go#L98-L108
135,148
vitessio/vitess
go/pools/numbered.go
Put
func (nu *Numbered) Put(id int64) { nu.mu.Lock() defer nu.mu.Unlock() if nw, ok := nu.resources[id]; ok { nw.inUse = false nw.purpose = "" nw.timeUsed = time.Now() } }
go
func (nu *Numbered) Put(id int64) { nu.mu.Lock() defer nu.mu.Unlock() if nw, ok := nu.resources[id]; ok { nw.inUse = false nw.purpose = "" nw.timeUsed = time.Now() } }
[ "func", "(", "nu", "*", "Numbered", ")", "Put", "(", "id", "int64", ")", "{", "nu", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "nu", ".", "mu", ".", "Unlock", "(", ")", "\n", "if", "nw", ",", "ok", ":=", "nu", ".", "resources", "[", "...
// Put unlocks a resource for someone else to use.
[ "Put", "unlocks", "a", "resource", "for", "someone", "else", "to", "use", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/pools/numbered.go#L133-L141
135,149
vitessio/vitess
go/pools/numbered.go
GetAll
func (nu *Numbered) GetAll() (vals []interface{}) { nu.mu.Lock() defer nu.mu.Unlock() vals = make([]interface{}, 0, len(nu.resources)) for _, nw := range nu.resources { vals = append(vals, nw.val) } return vals }
go
func (nu *Numbered) GetAll() (vals []interface{}) { nu.mu.Lock() defer nu.mu.Unlock() vals = make([]interface{}, 0, len(nu.resources)) for _, nw := range nu.resources { vals = append(vals, nw.val) } return vals }
[ "func", "(", "nu", "*", "Numbered", ")", "GetAll", "(", ")", "(", "vals", "[", "]", "interface", "{", "}", ")", "{", "nu", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "nu", ".", "mu", ".", "Unlock", "(", ")", "\n", "vals", "=", "make", ...
// GetAll returns the list of all resources in the pool.
[ "GetAll", "returns", "the", "list", "of", "all", "resources", "in", "the", "pool", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/pools/numbered.go#L144-L152
135,150
vitessio/vitess
go/pools/numbered.go
GetOutdated
func (nu *Numbered) GetOutdated(age time.Duration, purpose string) (vals []interface{}) { nu.mu.Lock() defer nu.mu.Unlock() now := time.Now() for _, nw := range nu.resources { if nw.inUse || !nw.enforceTimeout { continue } if nw.timeCreated.Add(age).Sub(now) <= 0 { nw.inUse = true nw.purpose = purpos...
go
func (nu *Numbered) GetOutdated(age time.Duration, purpose string) (vals []interface{}) { nu.mu.Lock() defer nu.mu.Unlock() now := time.Now() for _, nw := range nu.resources { if nw.inUse || !nw.enforceTimeout { continue } if nw.timeCreated.Add(age).Sub(now) <= 0 { nw.inUse = true nw.purpose = purpos...
[ "func", "(", "nu", "*", "Numbered", ")", "GetOutdated", "(", "age", "time", ".", "Duration", ",", "purpose", "string", ")", "(", "vals", "[", "]", "interface", "{", "}", ")", "{", "nu", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "nu", ".", ...
// GetOutdated returns a list of resources that are older than age, and locks them. // It does not return any resources that are already locked.
[ "GetOutdated", "returns", "a", "list", "of", "resources", "that", "are", "older", "than", "age", "and", "locks", "them", ".", "It", "does", "not", "return", "any", "resources", "that", "are", "already", "locked", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/pools/numbered.go#L156-L171
135,151
vitessio/vitess
go/pools/numbered.go
GetIdle
func (nu *Numbered) GetIdle(timeout time.Duration, purpose string) (vals []interface{}) { nu.mu.Lock() defer nu.mu.Unlock() now := time.Now() for _, nw := range nu.resources { if nw.inUse { continue } if nw.timeUsed.Add(timeout).Sub(now) <= 0 { nw.inUse = true nw.purpose = purpose vals = append(va...
go
func (nu *Numbered) GetIdle(timeout time.Duration, purpose string) (vals []interface{}) { nu.mu.Lock() defer nu.mu.Unlock() now := time.Now() for _, nw := range nu.resources { if nw.inUse { continue } if nw.timeUsed.Add(timeout).Sub(now) <= 0 { nw.inUse = true nw.purpose = purpose vals = append(va...
[ "func", "(", "nu", "*", "Numbered", ")", "GetIdle", "(", "timeout", "time", ".", "Duration", ",", "purpose", "string", ")", "(", "vals", "[", "]", "interface", "{", "}", ")", "{", "nu", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "nu", ".", ...
// GetIdle returns a list of resurces that have been idle for longer // than timeout, and locks them. It does not return any resources that // are already locked.
[ "GetIdle", "returns", "a", "list", "of", "resurces", "that", "have", "been", "idle", "for", "longer", "than", "timeout", "and", "locks", "them", ".", "It", "does", "not", "return", "any", "resources", "that", "are", "already", "locked", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/pools/numbered.go#L176-L191
135,152
vitessio/vitess
go/pools/numbered.go
WaitForEmpty
func (nu *Numbered) WaitForEmpty() { nu.mu.Lock() defer nu.mu.Unlock() for len(nu.resources) != 0 { nu.empty.Wait() } }
go
func (nu *Numbered) WaitForEmpty() { nu.mu.Lock() defer nu.mu.Unlock() for len(nu.resources) != 0 { nu.empty.Wait() } }
[ "func", "(", "nu", "*", "Numbered", ")", "WaitForEmpty", "(", ")", "{", "nu", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "nu", ".", "mu", ".", "Unlock", "(", ")", "\n", "for", "len", "(", "nu", ".", "resources", ")", "!=", "0", "{", "nu...
// WaitForEmpty returns as soon as the pool becomes empty
[ "WaitForEmpty", "returns", "as", "soon", "as", "the", "pool", "becomes", "empty" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/pools/numbered.go#L194-L200
135,153
vitessio/vitess
go/mysql/auth_server.go
RegisterAuthServerImpl
func RegisterAuthServerImpl(name string, authServer AuthServer) { if _, ok := authServers[name]; ok { log.Fatalf("AuthServer named %v already exists", name) } authServers[name] = authServer }
go
func RegisterAuthServerImpl(name string, authServer AuthServer) { if _, ok := authServers[name]; ok { log.Fatalf("AuthServer named %v already exists", name) } authServers[name] = authServer }
[ "func", "RegisterAuthServerImpl", "(", "name", "string", ",", "authServer", "AuthServer", ")", "{", "if", "_", ",", "ok", ":=", "authServers", "[", "name", "]", ";", "ok", "{", "log", ".", "Fatalf", "(", "\"", "\"", ",", "name", ")", "\n", "}", "\n",...
// RegisterAuthServerImpl registers an implementations of AuthServer.
[ "RegisterAuthServerImpl", "registers", "an", "implementations", "of", "AuthServer", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/auth_server.go#L86-L91
135,154
vitessio/vitess
go/mysql/auth_server.go
GetAuthServer
func GetAuthServer(name string) AuthServer { authServer, ok := authServers[name] if !ok { log.Exitf("no AuthServer name %v registered", name) } return authServer }
go
func GetAuthServer(name string) AuthServer { authServer, ok := authServers[name] if !ok { log.Exitf("no AuthServer name %v registered", name) } return authServer }
[ "func", "GetAuthServer", "(", "name", "string", ")", "AuthServer", "{", "authServer", ",", "ok", ":=", "authServers", "[", "name", "]", "\n", "if", "!", "ok", "{", "log", ".", "Exitf", "(", "\"", "\"", ",", "name", ")", "\n", "}", "\n", "return", "...
// GetAuthServer returns an AuthServer by name, or log.Exitf.
[ "GetAuthServer", "returns", "an", "AuthServer", "by", "name", "or", "log", ".", "Exitf", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/auth_server.go#L94-L100
135,155
vitessio/vitess
go/mysql/auth_server.go
NewSalt
func NewSalt() ([]byte, error) { salt := make([]byte, 20) if _, err := rand.Read(salt); err != nil { return nil, err } // Salt must be a legal UTF8 string. for i := 0; i < len(salt); i++ { salt[i] &= 0x7f if salt[i] == '\x00' || salt[i] == '$' { salt[i]++ } } return salt, nil }
go
func NewSalt() ([]byte, error) { salt := make([]byte, 20) if _, err := rand.Read(salt); err != nil { return nil, err } // Salt must be a legal UTF8 string. for i := 0; i < len(salt); i++ { salt[i] &= 0x7f if salt[i] == '\x00' || salt[i] == '$' { salt[i]++ } } return salt, nil }
[ "func", "NewSalt", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "salt", ":=", "make", "(", "[", "]", "byte", ",", "20", ")", "\n", "if", "_", ",", "err", ":=", "rand", ".", "Read", "(", "salt", ")", ";", "err", "!=", "nil", "{",...
// NewSalt returns a 20 character salt.
[ "NewSalt", "returns", "a", "20", "character", "salt", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/auth_server.go#L103-L118
135,156
vitessio/vitess
go/mysql/auth_server.go
ScramblePassword
func ScramblePassword(salt, password []byte) []byte { if len(password) == 0 { return nil } // stage1Hash = SHA1(password) crypt := sha1.New() crypt.Write(password) stage1 := crypt.Sum(nil) // scrambleHash = SHA1(salt + SHA1(stage1Hash)) // inner Hash crypt.Reset() crypt.Write(stage1) hash := crypt.Sum(ni...
go
func ScramblePassword(salt, password []byte) []byte { if len(password) == 0 { return nil } // stage1Hash = SHA1(password) crypt := sha1.New() crypt.Write(password) stage1 := crypt.Sum(nil) // scrambleHash = SHA1(salt + SHA1(stage1Hash)) // inner Hash crypt.Reset() crypt.Write(stage1) hash := crypt.Sum(ni...
[ "func", "ScramblePassword", "(", "salt", ",", "password", "[", "]", "byte", ")", "[", "]", "byte", "{", "if", "len", "(", "password", ")", "==", "0", "{", "return", "nil", "\n", "}", "\n\n", "// stage1Hash = SHA1(password)", "crypt", ":=", "sha1", ".", ...
// ScramblePassword computes the hash of the password using 4.1+ method.
[ "ScramblePassword", "computes", "the", "hash", "of", "the", "password", "using", "4", ".", "1", "+", "method", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/auth_server.go#L121-L147
135,157
vitessio/vitess
go/mysql/auth_server.go
authServerDialogSwitchData
func authServerDialogSwitchData() []byte { result := make([]byte, len(mysqlDialogMessage)+2) result[0] = mysqlDialogAskPassword writeNullString(result, 1, mysqlDialogMessage) return result }
go
func authServerDialogSwitchData() []byte { result := make([]byte, len(mysqlDialogMessage)+2) result[0] = mysqlDialogAskPassword writeNullString(result, 1, mysqlDialogMessage) return result }
[ "func", "authServerDialogSwitchData", "(", ")", "[", "]", "byte", "{", "result", ":=", "make", "(", "[", "]", "byte", ",", "len", "(", "mysqlDialogMessage", ")", "+", "2", ")", "\n", "result", "[", "0", "]", "=", "mysqlDialogAskPassword", "\n", "writeNul...
// authServerDialogSwitchData is a helper method to return the data // needed in the AuthSwitchRequest packet for the dialog plugin // to ask for a password.
[ "authServerDialogSwitchData", "is", "a", "helper", "method", "to", "return", "the", "data", "needed", "in", "the", "AuthSwitchRequest", "packet", "for", "the", "dialog", "plugin", "to", "ask", "for", "a", "password", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/auth_server.go#L209-L214
135,158
vitessio/vitess
go/mysql/auth_server.go
AuthServerReadPacketString
func AuthServerReadPacketString(c *Conn) (string, error) { // Read a packet, the password is the payload, as a // zero terminated string. data, err := c.ReadPacket() if err != nil { return "", err } if len(data) == 0 || data[len(data)-1] != 0 { return "", vterrors.Errorf(vtrpc.Code_INTERNAL, "received invalid...
go
func AuthServerReadPacketString(c *Conn) (string, error) { // Read a packet, the password is the payload, as a // zero terminated string. data, err := c.ReadPacket() if err != nil { return "", err } if len(data) == 0 || data[len(data)-1] != 0 { return "", vterrors.Errorf(vtrpc.Code_INTERNAL, "received invalid...
[ "func", "AuthServerReadPacketString", "(", "c", "*", "Conn", ")", "(", "string", ",", "error", ")", "{", "// Read a packet, the password is the payload, as a", "// zero terminated string.", "data", ",", "err", ":=", "c", ".", "ReadPacket", "(", ")", "\n", "if", "e...
// AuthServerReadPacketString is a helper method to read a packet // as a null terminated string. It is used by the mysql_clear_password // and dialog plugins.
[ "AuthServerReadPacketString", "is", "a", "helper", "method", "to", "read", "a", "packet", "as", "a", "null", "terminated", "string", ".", "It", "is", "used", "by", "the", "mysql_clear_password", "and", "dialog", "plugins", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/auth_server.go#L219-L230
135,159
vitessio/vitess
go/mysql/auth_server.go
AuthServerNegotiateClearOrDialog
func AuthServerNegotiateClearOrDialog(c *Conn, method string) (string, error) { switch method { case MysqlClearPassword: // The password is the next packet in plain text. return AuthServerReadPacketString(c) case MysqlDialog: return AuthServerReadPacketString(c) default: return "", vterrors.Errorf(vtrpc.C...
go
func AuthServerNegotiateClearOrDialog(c *Conn, method string) (string, error) { switch method { case MysqlClearPassword: // The password is the next packet in plain text. return AuthServerReadPacketString(c) case MysqlDialog: return AuthServerReadPacketString(c) default: return "", vterrors.Errorf(vtrpc.C...
[ "func", "AuthServerNegotiateClearOrDialog", "(", "c", "*", "Conn", ",", "method", "string", ")", "(", "string", ",", "error", ")", "{", "switch", "method", "{", "case", "MysqlClearPassword", ":", "// The password is the next packet in plain text.", "return", "AuthServ...
// AuthServerNegotiateClearOrDialog will finish a negotiation based on // the method type for the connection. Only supports // MysqlClearPassword and MysqlDialog.
[ "AuthServerNegotiateClearOrDialog", "will", "finish", "a", "negotiation", "based", "on", "the", "method", "type", "for", "the", "connection", ".", "Only", "supports", "MysqlClearPassword", "and", "MysqlDialog", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/auth_server.go#L235-L247
135,160
vitessio/vitess
go/sqlescape/ids.go
EscapeID
func EscapeID(in string) string { var buf bytes.Buffer WriteEscapeID(&buf, in) return buf.String() }
go
func EscapeID(in string) string { var buf bytes.Buffer WriteEscapeID(&buf, in) return buf.String() }
[ "func", "EscapeID", "(", "in", "string", ")", "string", "{", "var", "buf", "bytes", ".", "Buffer", "\n", "WriteEscapeID", "(", "&", "buf", ",", "in", ")", "\n", "return", "buf", ".", "String", "(", ")", "\n", "}" ]
// EscapeID returns a backticked identifier given an input string.
[ "EscapeID", "returns", "a", "backticked", "identifier", "given", "an", "input", "string", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqlescape/ids.go#L21-L25
135,161
vitessio/vitess
go/sqlescape/ids.go
WriteEscapeID
func WriteEscapeID(buf *bytes.Buffer, in string) { buf.WriteByte('`') for _, c := range in { buf.WriteRune(c) if c == '`' { buf.WriteByte('`') } } buf.WriteByte('`') }
go
func WriteEscapeID(buf *bytes.Buffer, in string) { buf.WriteByte('`') for _, c := range in { buf.WriteRune(c) if c == '`' { buf.WriteByte('`') } } buf.WriteByte('`') }
[ "func", "WriteEscapeID", "(", "buf", "*", "bytes", ".", "Buffer", ",", "in", "string", ")", "{", "buf", ".", "WriteByte", "(", "'`'", ")", "\n", "for", "_", ",", "c", ":=", "range", "in", "{", "buf", ".", "WriteRune", "(", "c", ")", "\n", "if", ...
// WriteEscapeID writes a backticked identifier from an input string into buf.
[ "WriteEscapeID", "writes", "a", "backticked", "identifier", "from", "an", "input", "string", "into", "buf", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqlescape/ids.go#L28-L37
135,162
vitessio/vitess
go/vt/vttablet/tabletmanager/healthcheck.go
Class
func (r *HealthRecord) Class() string { switch { case r.Error != nil: return "unhealthy" case r.ReplicationDelay > *degradedThreshold: return "unhappy" default: return "healthy" } }
go
func (r *HealthRecord) Class() string { switch { case r.Error != nil: return "unhealthy" case r.ReplicationDelay > *degradedThreshold: return "unhappy" default: return "healthy" } }
[ "func", "(", "r", "*", "HealthRecord", ")", "Class", "(", ")", "string", "{", "switch", "{", "case", "r", ".", "Error", "!=", "nil", ":", "return", "\"", "\"", "\n", "case", "r", ".", "ReplicationDelay", ">", "*", "degradedThreshold", ":", "return", ...
// Class returns a human-readable one word version of the health state.
[ "Class", "returns", "a", "human", "-", "readable", "one", "word", "version", "of", "the", "health", "state", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletmanager/healthcheck.go#L67-L76
135,163
vitessio/vitess
go/vt/vttablet/tabletmanager/healthcheck.go
HTML
func (r *HealthRecord) HTML() template.HTML { switch { case r.Error != nil: return template.HTML(fmt.Sprintf("unhealthy: %v", r.Error)) case r.ReplicationDelay > *degradedThreshold: return template.HTML(fmt.Sprintf("unhappy: %v behind on replication", r.ReplicationDelay)) default: html := "healthy" if r.Rep...
go
func (r *HealthRecord) HTML() template.HTML { switch { case r.Error != nil: return template.HTML(fmt.Sprintf("unhealthy: %v", r.Error)) case r.ReplicationDelay > *degradedThreshold: return template.HTML(fmt.Sprintf("unhappy: %v behind on replication", r.ReplicationDelay)) default: html := "healthy" if r.Rep...
[ "func", "(", "r", "*", "HealthRecord", ")", "HTML", "(", ")", "template", ".", "HTML", "{", "switch", "{", "case", "r", ".", "Error", "!=", "nil", ":", "return", "template", ".", "HTML", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "r", ".",...
// HTML returns an HTML version to be displayed on UIs.
[ "HTML", "returns", "an", "HTML", "version", "to", "be", "displayed", "on", "UIs", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletmanager/healthcheck.go#L79-L95
135,164
vitessio/vitess
go/vt/vttablet/tabletmanager/healthcheck.go
ErrorString
func (r *HealthRecord) ErrorString() string { if r.Error == nil { return "" } return r.Error.Error() }
go
func (r *HealthRecord) ErrorString() string { if r.Error == nil { return "" } return r.Error.Error() }
[ "func", "(", "r", "*", "HealthRecord", ")", "ErrorString", "(", ")", "string", "{", "if", "r", ".", "Error", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "r", ".", "Error", ".", "Error", "(", ")", "\n", "}" ]
// ErrorString returns Error as a string.
[ "ErrorString", "returns", "Error", "as", "a", "string", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletmanager/healthcheck.go#L103-L108
135,165
vitessio/vitess
go/vt/vttablet/tabletmanager/healthcheck.go
IgnoredErrorString
func (r *HealthRecord) IgnoredErrorString() string { if r.IgnoredError == nil { return "" } return r.IgnoredError.Error() }
go
func (r *HealthRecord) IgnoredErrorString() string { if r.IgnoredError == nil { return "" } return r.IgnoredError.Error() }
[ "func", "(", "r", "*", "HealthRecord", ")", "IgnoredErrorString", "(", ")", "string", "{", "if", "r", ".", "IgnoredError", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "r", ".", "IgnoredError", ".", "Error", "(", ")", "\n", "}" ...
// IgnoredErrorString returns IgnoredError as a string.
[ "IgnoredErrorString", "returns", "IgnoredError", "as", "a", "string", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletmanager/healthcheck.go#L111-L116
135,166
vitessio/vitess
go/vt/vttablet/tabletmanager/healthcheck.go
ConfigHTML
func ConfigHTML() template.HTML { return template.HTML(fmt.Sprintf( "healthCheckInterval: %v; degradedThreshold: %v; unhealthyThreshold: %v", healthCheckInterval, degradedThreshold, unhealthyThreshold)) }
go
func ConfigHTML() template.HTML { return template.HTML(fmt.Sprintf( "healthCheckInterval: %v; degradedThreshold: %v; unhealthyThreshold: %v", healthCheckInterval, degradedThreshold, unhealthyThreshold)) }
[ "func", "ConfigHTML", "(", ")", "template", ".", "HTML", "{", "return", "template", ".", "HTML", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "healthCheckInterval", ",", "degradedThreshold", ",", "unhealthyThreshold", ")", ")", "\n", "}" ]
// ConfigHTML returns a formatted summary of health checking config values.
[ "ConfigHTML", "returns", "a", "formatted", "summary", "of", "health", "checking", "config", "values", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletmanager/healthcheck.go#L131-L135
135,167
vitessio/vitess
go/vt/vttablet/tabletmanager/healthcheck.go
terminateHealthChecks
func (agent *ActionAgent) terminateHealthChecks() { // No need to check for error, only a canceled batchCtx would fail this. agent.lock(agent.batchCtx) defer agent.unlock() log.Info("agent.terminateHealthChecks is starting") // read the current tablet record tablet := agent.Tablet() if !topo.IsSubjectToLameduck...
go
func (agent *ActionAgent) terminateHealthChecks() { // No need to check for error, only a canceled batchCtx would fail this. agent.lock(agent.batchCtx) defer agent.unlock() log.Info("agent.terminateHealthChecks is starting") // read the current tablet record tablet := agent.Tablet() if !topo.IsSubjectToLameduck...
[ "func", "(", "agent", "*", "ActionAgent", ")", "terminateHealthChecks", "(", ")", "{", "// No need to check for error, only a canceled batchCtx would fail this.", "agent", ".", "lock", "(", "agent", ".", "batchCtx", ")", "\n", "defer", "agent", ".", "unlock", "(", "...
// terminateHealthChecks is called when we enter lame duck mode. // We will clean up our state, and set query service to lame duck mode. // We only do something if we are in a serving state, and not a master.
[ "terminateHealthChecks", "is", "called", "when", "we", "enter", "lame", "duck", "mode", ".", "We", "will", "clean", "up", "our", "state", "and", "set", "query", "service", "to", "lame", "duck", "mode", ".", "We", "only", "do", "something", "if", "we", "a...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletmanager/healthcheck.go#L324-L360
135,168
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
Session
func (conn *VTGateConn) Session(targetString string, options *querypb.ExecuteOptions) *VTGateSession { return &VTGateSession{ session: &vtgatepb.Session{ TargetString: targetString, Options: options, Autocommit: true, }, impl: conn.impl, } }
go
func (conn *VTGateConn) Session(targetString string, options *querypb.ExecuteOptions) *VTGateSession { return &VTGateSession{ session: &vtgatepb.Session{ TargetString: targetString, Options: options, Autocommit: true, }, impl: conn.impl, } }
[ "func", "(", "conn", "*", "VTGateConn", ")", "Session", "(", "targetString", "string", ",", "options", "*", "querypb", ".", "ExecuteOptions", ")", "*", "VTGateSession", "{", "return", "&", "VTGateSession", "{", "session", ":", "&", "vtgatepb", ".", "Session"...
// Session returns a VTGateSession that can be used to access V3 functions.
[ "Session", "returns", "a", "VTGateSession", "that", "can", "be", "used", "to", "access", "V3", "functions", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L47-L56
135,169
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
ExecuteShards
func (conn *VTGateConn) ExecuteShards(ctx context.Context, query string, keyspace string, shards []string, bindVars map[string]*querypb.BindVariable, tabletType topodatapb.TabletType, options *querypb.ExecuteOptions) (*sqltypes.Result, error) { _, res, err := conn.impl.ExecuteShards(ctx, query, keyspace, shards, bindV...
go
func (conn *VTGateConn) ExecuteShards(ctx context.Context, query string, keyspace string, shards []string, bindVars map[string]*querypb.BindVariable, tabletType topodatapb.TabletType, options *querypb.ExecuteOptions) (*sqltypes.Result, error) { _, res, err := conn.impl.ExecuteShards(ctx, query, keyspace, shards, bindV...
[ "func", "(", "conn", "*", "VTGateConn", ")", "ExecuteShards", "(", "ctx", "context", ".", "Context", ",", "query", "string", ",", "keyspace", "string", ",", "shards", "[", "]", "string", ",", "bindVars", "map", "[", "string", "]", "*", "querypb", ".", ...
// ExecuteShards executes a non-streaming query for multiple shards on vtgate.
[ "ExecuteShards", "executes", "a", "non", "-", "streaming", "query", "for", "multiple", "shards", "on", "vtgate", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L59-L62
135,170
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
StreamExecuteShards
func (conn *VTGateConn) StreamExecuteShards(ctx context.Context, query string, keyspace string, shards []string, bindVars map[string]*querypb.BindVariable, tabletType topodatapb.TabletType, options *querypb.ExecuteOptions) (sqltypes.ResultStream, error) { return conn.impl.StreamExecuteShards(ctx, query, keyspace, shar...
go
func (conn *VTGateConn) StreamExecuteShards(ctx context.Context, query string, keyspace string, shards []string, bindVars map[string]*querypb.BindVariable, tabletType topodatapb.TabletType, options *querypb.ExecuteOptions) (sqltypes.ResultStream, error) { return conn.impl.StreamExecuteShards(ctx, query, keyspace, shar...
[ "func", "(", "conn", "*", "VTGateConn", ")", "StreamExecuteShards", "(", "ctx", "context", ".", "Context", ",", "query", "string", ",", "keyspace", "string", ",", "shards", "[", "]", "string", ",", "bindVars", "map", "[", "string", "]", "*", "querypb", "...
// StreamExecuteShards executes a streaming query on vtgate, on a set // of shards. It returns a ResultStream and an error. First check the // error. Then you can pull values from the ResultStream until io.EOF, // or another error.
[ "StreamExecuteShards", "executes", "a", "streaming", "query", "on", "vtgate", "on", "a", "set", "of", "shards", ".", "It", "returns", "a", "ResultStream", "and", "an", "error", ".", "First", "check", "the", "error", ".", "Then", "you", "can", "pull", "valu...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L102-L104
135,171
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
ResolveTransaction
func (conn *VTGateConn) ResolveTransaction(ctx context.Context, dtid string) error { return conn.impl.ResolveTransaction(ctx, dtid) }
go
func (conn *VTGateConn) ResolveTransaction(ctx context.Context, dtid string) error { return conn.impl.ResolveTransaction(ctx, dtid) }
[ "func", "(", "conn", "*", "VTGateConn", ")", "ResolveTransaction", "(", "ctx", "context", ".", "Context", ",", "dtid", "string", ")", "error", "{", "return", "conn", ".", "impl", ".", "ResolveTransaction", "(", "ctx", ",", "dtid", ")", "\n", "}" ]
// ResolveTransaction resolves the 2pc transaction.
[ "ResolveTransaction", "resolves", "the", "2pc", "transaction", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L123-L125
135,172
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
Begin
func (conn *VTGateConn) Begin(ctx context.Context) (*VTGateTx, error) { session, err := conn.impl.Begin(ctx, false /* singledb */) if err != nil { return nil, err } return &VTGateTx{ conn: conn, session: session, }, nil }
go
func (conn *VTGateConn) Begin(ctx context.Context) (*VTGateTx, error) { session, err := conn.impl.Begin(ctx, false /* singledb */) if err != nil { return nil, err } return &VTGateTx{ conn: conn, session: session, }, nil }
[ "func", "(", "conn", "*", "VTGateConn", ")", "Begin", "(", "ctx", "context", ".", "Context", ")", "(", "*", "VTGateTx", ",", "error", ")", "{", "session", ",", "err", ":=", "conn", ".", "impl", ".", "Begin", "(", "ctx", ",", "false", "/* singledb */"...
// Begin starts a transaction and returns a VTGateTX.
[ "Begin", "starts", "a", "transaction", "and", "returns", "a", "VTGateTX", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L144-L154
135,173
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
GetSrvKeyspace
func (conn *VTGateConn) GetSrvKeyspace(ctx context.Context, keyspace string) (*topodatapb.SrvKeyspace, error) { return conn.impl.GetSrvKeyspace(ctx, keyspace) }
go
func (conn *VTGateConn) GetSrvKeyspace(ctx context.Context, keyspace string) (*topodatapb.SrvKeyspace, error) { return conn.impl.GetSrvKeyspace(ctx, keyspace) }
[ "func", "(", "conn", "*", "VTGateConn", ")", "GetSrvKeyspace", "(", "ctx", "context", ".", "Context", ",", "keyspace", "string", ")", "(", "*", "topodatapb", ".", "SrvKeyspace", ",", "error", ")", "{", "return", "conn", ".", "impl", ".", "GetSrvKeyspace", ...
// GetSrvKeyspace returns a topo.SrvKeyspace object.
[ "GetSrvKeyspace", "returns", "a", "topo", ".", "SrvKeyspace", "object", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L170-L172
135,174
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
UpdateStream
func (conn *VTGateConn) UpdateStream(ctx context.Context, keyspace, shard string, keyRange *topodatapb.KeyRange, tabletType topodatapb.TabletType, timestamp int64, event *querypb.EventToken) (UpdateStreamReader, error) { return conn.impl.UpdateStream(ctx, keyspace, shard, keyRange, tabletType, timestamp, event) }
go
func (conn *VTGateConn) UpdateStream(ctx context.Context, keyspace, shard string, keyRange *topodatapb.KeyRange, tabletType topodatapb.TabletType, timestamp int64, event *querypb.EventToken) (UpdateStreamReader, error) { return conn.impl.UpdateStream(ctx, keyspace, shard, keyRange, tabletType, timestamp, event) }
[ "func", "(", "conn", "*", "VTGateConn", ")", "UpdateStream", "(", "ctx", "context", ".", "Context", ",", "keyspace", ",", "shard", "string", ",", "keyRange", "*", "topodatapb", ".", "KeyRange", ",", "tabletType", "topodatapb", ".", "TabletType", ",", "timest...
// UpdateStream executes a streaming query on vtgate. It returns an // UpdateStreamReader and an error. First check the error. Then you // can pull values from the UpdateStreamReader until io.EOF, or // another error.
[ "UpdateStream", "executes", "a", "streaming", "query", "on", "vtgate", ".", "It", "returns", "an", "UpdateStreamReader", "and", "an", "error", ".", "First", "check", "the", "error", ".", "Then", "you", "can", "pull", "values", "from", "the", "UpdateStreamReade...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L185-L187
135,175
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
Execute
func (sn *VTGateSession) Execute(ctx context.Context, query string, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) { session, res, err := sn.impl.Execute(ctx, sn.session, query, bindVars) sn.session = session return res, err }
go
func (sn *VTGateSession) Execute(ctx context.Context, query string, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) { session, res, err := sn.impl.Execute(ctx, sn.session, query, bindVars) sn.session = session return res, err }
[ "func", "(", "sn", "*", "VTGateSession", ")", "Execute", "(", "ctx", "context", ".", "Context", ",", "query", "string", ",", "bindVars", "map", "[", "string", "]", "*", "querypb", ".", "BindVariable", ")", "(", "*", "sqltypes", ".", "Result", ",", "err...
// Execute performs a VTGate Execute.
[ "Execute", "performs", "a", "VTGate", "Execute", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L201-L205
135,176
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
ExecuteBatch
func (sn *VTGateSession) ExecuteBatch(ctx context.Context, query []string, bindVars []map[string]*querypb.BindVariable) ([]sqltypes.QueryResponse, error) { session, res, errs := sn.impl.ExecuteBatch(ctx, sn.session, query, bindVars) sn.session = session return res, errs }
go
func (sn *VTGateSession) ExecuteBatch(ctx context.Context, query []string, bindVars []map[string]*querypb.BindVariable) ([]sqltypes.QueryResponse, error) { session, res, errs := sn.impl.ExecuteBatch(ctx, sn.session, query, bindVars) sn.session = session return res, errs }
[ "func", "(", "sn", "*", "VTGateSession", ")", "ExecuteBatch", "(", "ctx", "context", ".", "Context", ",", "query", "[", "]", "string", ",", "bindVars", "[", "]", "map", "[", "string", "]", "*", "querypb", ".", "BindVariable", ")", "(", "[", "]", "sql...
// ExecuteBatch executes a list of queries on vtgate within the current transaction.
[ "ExecuteBatch", "executes", "a", "list", "of", "queries", "on", "vtgate", "within", "the", "current", "transaction", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L208-L212
135,177
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
StreamExecute
func (sn *VTGateSession) StreamExecute(ctx context.Context, query string, bindVars map[string]*querypb.BindVariable) (sqltypes.ResultStream, error) { // StreamExecute is only used for SELECT queries that don't change // the session. So, the protocol doesn't return an updated session. // This may change in the future...
go
func (sn *VTGateSession) StreamExecute(ctx context.Context, query string, bindVars map[string]*querypb.BindVariable) (sqltypes.ResultStream, error) { // StreamExecute is only used for SELECT queries that don't change // the session. So, the protocol doesn't return an updated session. // This may change in the future...
[ "func", "(", "sn", "*", "VTGateSession", ")", "StreamExecute", "(", "ctx", "context", ".", "Context", ",", "query", "string", ",", "bindVars", "map", "[", "string", "]", "*", "querypb", ".", "BindVariable", ")", "(", "sqltypes", ".", "ResultStream", ",", ...
// StreamExecute executes a streaming query on vtgate. // It returns a ResultStream and an error. First check the // error. Then you can pull values from the ResultStream until io.EOF, // or another error.
[ "StreamExecute", "executes", "a", "streaming", "query", "on", "vtgate", ".", "It", "returns", "a", "ResultStream", "and", "an", "error", ".", "First", "check", "the", "error", ".", "Then", "you", "can", "pull", "values", "from", "the", "ResultStream", "until...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L218-L223
135,178
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
ExecuteKeyspaceIds
func (tx *VTGateTx) ExecuteKeyspaceIds(ctx context.Context, query string, keyspace string, keyspaceIds [][]byte, bindVars map[string]*querypb.BindVariable, tabletType topodatapb.TabletType, options *querypb.ExecuteOptions) (*sqltypes.Result, error) { if tx.session == nil { return nil, fmt.Errorf("executeKeyspaceIds:...
go
func (tx *VTGateTx) ExecuteKeyspaceIds(ctx context.Context, query string, keyspace string, keyspaceIds [][]byte, bindVars map[string]*querypb.BindVariable, tabletType topodatapb.TabletType, options *querypb.ExecuteOptions) (*sqltypes.Result, error) { if tx.session == nil { return nil, fmt.Errorf("executeKeyspaceIds:...
[ "func", "(", "tx", "*", "VTGateTx", ")", "ExecuteKeyspaceIds", "(", "ctx", "context", ".", "Context", ",", "query", "string", ",", "keyspace", "string", ",", "keyspaceIds", "[", "]", "[", "]", "byte", ",", "bindVars", "map", "[", "string", "]", "*", "q...
// ExecuteKeyspaceIds executes a non-streaming query for multiple keyspace_ids.
[ "ExecuteKeyspaceIds", "executes", "a", "non", "-", "streaming", "query", "for", "multiple", "keyspace_ids", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L243-L250
135,179
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
ExecuteBatchShards
func (tx *VTGateTx) ExecuteBatchShards(ctx context.Context, queries []*vtgatepb.BoundShardQuery, tabletType topodatapb.TabletType, options *querypb.ExecuteOptions) ([]sqltypes.Result, error) { if tx.session == nil { return nil, fmt.Errorf("executeBatchShards: not in transaction") } session, res, err := tx.conn.imp...
go
func (tx *VTGateTx) ExecuteBatchShards(ctx context.Context, queries []*vtgatepb.BoundShardQuery, tabletType topodatapb.TabletType, options *querypb.ExecuteOptions) ([]sqltypes.Result, error) { if tx.session == nil { return nil, fmt.Errorf("executeBatchShards: not in transaction") } session, res, err := tx.conn.imp...
[ "func", "(", "tx", "*", "VTGateTx", ")", "ExecuteBatchShards", "(", "ctx", "context", ".", "Context", ",", "queries", "[", "]", "*", "vtgatepb", ".", "BoundShardQuery", ",", "tabletType", "topodatapb", ".", "TabletType", ",", "options", "*", "querypb", ".", ...
// ExecuteBatchShards executes a set of non-streaming queries for multiple shards.
[ "ExecuteBatchShards", "executes", "a", "set", "of", "non", "-", "streaming", "queries", "for", "multiple", "shards", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L273-L280
135,180
vitessio/vitess
go/vt/vtgate/vtgateconn/vtgateconn.go
RegisterDialer
func RegisterDialer(name string, dialer DialerFunc) { if _, ok := dialers[name]; ok { log.Warningf("Dialer %s already exists, overwriting it", name) } dialers[name] = dialer }
go
func RegisterDialer(name string, dialer DialerFunc) { if _, ok := dialers[name]; ok { log.Warningf("Dialer %s already exists, overwriting it", name) } dialers[name] = dialer }
[ "func", "RegisterDialer", "(", "name", "string", ",", "dialer", "DialerFunc", ")", "{", "if", "_", ",", "ok", ":=", "dialers", "[", "name", "]", ";", "ok", "{", "log", ".", "Warningf", "(", "\"", "\"", ",", "name", ")", "\n", "}", "\n", "dialers", ...
// RegisterDialer is meant to be used by Dialer implementations // to self register.
[ "RegisterDialer", "is", "meant", "to", "be", "used", "by", "Dialer", "implementations", "to", "self", "register", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgateconn/vtgateconn.go#L393-L398
135,181
vitessio/vitess
go/vt/throttler/max_replication_lag_module_config.go
NewMaxReplicationLagModuleConfig
func NewMaxReplicationLagModuleConfig(maxReplicationLag int64) MaxReplicationLagModuleConfig { config := defaultMaxReplicationLagModuleConfig config.MaxReplicationLagSec = maxReplicationLag return config }
go
func NewMaxReplicationLagModuleConfig(maxReplicationLag int64) MaxReplicationLagModuleConfig { config := defaultMaxReplicationLagModuleConfig config.MaxReplicationLagSec = maxReplicationLag return config }
[ "func", "NewMaxReplicationLagModuleConfig", "(", "maxReplicationLag", "int64", ")", "MaxReplicationLagModuleConfig", "{", "config", ":=", "defaultMaxReplicationLagModuleConfig", "\n", "config", ".", "MaxReplicationLagSec", "=", "maxReplicationLag", "\n", "return", "config", "...
// NewMaxReplicationLagModuleConfig returns a default configuration where // only "maxReplicationLag" is set.
[ "NewMaxReplicationLagModuleConfig", "returns", "a", "default", "configuration", "where", "only", "maxReplicationLag", "is", "set", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/max_replication_lag_module_config.go#L70-L74
135,182
vitessio/vitess
go/vt/throttler/max_replication_lag_module_config.go
MinDurationBetweenIncreases
func (c MaxReplicationLagModuleConfig) MinDurationBetweenIncreases() time.Duration { return time.Duration(c.MinDurationBetweenIncreasesSec) * time.Second }
go
func (c MaxReplicationLagModuleConfig) MinDurationBetweenIncreases() time.Duration { return time.Duration(c.MinDurationBetweenIncreasesSec) * time.Second }
[ "func", "(", "c", "MaxReplicationLagModuleConfig", ")", "MinDurationBetweenIncreases", "(", ")", "time", ".", "Duration", "{", "return", "time", ".", "Duration", "(", "c", ".", "MinDurationBetweenIncreasesSec", ")", "*", "time", ".", "Second", "\n", "}" ]
// MinDurationBetweenIncreases is a helper function which returns the respective // protobuf field as native Go type.
[ "MinDurationBetweenIncreases", "is", "a", "helper", "function", "which", "returns", "the", "respective", "protobuf", "field", "as", "native", "Go", "type", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/max_replication_lag_module_config.go#L132-L134
135,183
vitessio/vitess
go/vt/throttler/max_replication_lag_module_config.go
MaxDurationBetweenIncreases
func (c MaxReplicationLagModuleConfig) MaxDurationBetweenIncreases() time.Duration { return time.Duration(c.MaxDurationBetweenIncreasesSec) * time.Second }
go
func (c MaxReplicationLagModuleConfig) MaxDurationBetweenIncreases() time.Duration { return time.Duration(c.MaxDurationBetweenIncreasesSec) * time.Second }
[ "func", "(", "c", "MaxReplicationLagModuleConfig", ")", "MaxDurationBetweenIncreases", "(", ")", "time", ".", "Duration", "{", "return", "time", ".", "Duration", "(", "c", ".", "MaxDurationBetweenIncreasesSec", ")", "*", "time", ".", "Second", "\n", "}" ]
// MaxDurationBetweenIncreases is a helper function which returns the respective // protobuf field as native Go type.
[ "MaxDurationBetweenIncreases", "is", "a", "helper", "function", "which", "returns", "the", "respective", "protobuf", "field", "as", "native", "Go", "type", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/max_replication_lag_module_config.go#L138-L140
135,184
vitessio/vitess
go/vt/throttler/max_replication_lag_module_config.go
MinDurationBetweenDecreases
func (c MaxReplicationLagModuleConfig) MinDurationBetweenDecreases() time.Duration { return time.Duration(c.MinDurationBetweenDecreasesSec) * time.Second }
go
func (c MaxReplicationLagModuleConfig) MinDurationBetweenDecreases() time.Duration { return time.Duration(c.MinDurationBetweenDecreasesSec) * time.Second }
[ "func", "(", "c", "MaxReplicationLagModuleConfig", ")", "MinDurationBetweenDecreases", "(", ")", "time", ".", "Duration", "{", "return", "time", ".", "Duration", "(", "c", ".", "MinDurationBetweenDecreasesSec", ")", "*", "time", ".", "Second", "\n", "}" ]
// MinDurationBetweenDecreases is a helper function which returns the respective // protobuf field as native Go type.
[ "MinDurationBetweenDecreases", "is", "a", "helper", "function", "which", "returns", "the", "respective", "protobuf", "field", "as", "native", "Go", "type", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/max_replication_lag_module_config.go#L144-L146
135,185
vitessio/vitess
go/vt/throttler/max_replication_lag_module_config.go
SpreadBacklogAcross
func (c MaxReplicationLagModuleConfig) SpreadBacklogAcross() time.Duration { return time.Duration(c.SpreadBacklogAcrossSec) * time.Second }
go
func (c MaxReplicationLagModuleConfig) SpreadBacklogAcross() time.Duration { return time.Duration(c.SpreadBacklogAcrossSec) * time.Second }
[ "func", "(", "c", "MaxReplicationLagModuleConfig", ")", "SpreadBacklogAcross", "(", ")", "time", ".", "Duration", "{", "return", "time", ".", "Duration", "(", "c", ".", "SpreadBacklogAcrossSec", ")", "*", "time", ".", "Second", "\n", "}" ]
// SpreadBacklogAcross is a helper function which returns the respective // protobuf field as native Go type.
[ "SpreadBacklogAcross", "is", "a", "helper", "function", "which", "returns", "the", "respective", "protobuf", "field", "as", "native", "Go", "type", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/max_replication_lag_module_config.go#L150-L152
135,186
vitessio/vitess
go/vt/throttler/max_replication_lag_module_config.go
AgeBadRateAfter
func (c MaxReplicationLagModuleConfig) AgeBadRateAfter() time.Duration { return time.Duration(c.AgeBadRateAfterSec) * time.Second }
go
func (c MaxReplicationLagModuleConfig) AgeBadRateAfter() time.Duration { return time.Duration(c.AgeBadRateAfterSec) * time.Second }
[ "func", "(", "c", "MaxReplicationLagModuleConfig", ")", "AgeBadRateAfter", "(", ")", "time", ".", "Duration", "{", "return", "time", ".", "Duration", "(", "c", ".", "AgeBadRateAfterSec", ")", "*", "time", ".", "Second", "\n", "}" ]
// AgeBadRateAfter is a helper function which returns the respective // protobuf field as native Go type.
[ "AgeBadRateAfter", "is", "a", "helper", "function", "which", "returns", "the", "respective", "protobuf", "field", "as", "native", "Go", "type", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/max_replication_lag_module_config.go#L156-L158
135,187
vitessio/vitess
go/vt/worker/multi_split_diff.go
NewMultiSplitDiffWorker
func NewMultiSplitDiffWorker(wr *wrangler.Wrangler, cell, keyspace, shard string, excludeTables []string, minHealthyTablets, parallelDiffsCount int, waitForFixedTimeRatherThanGtidSet bool, useConsistentSnapshot bool, tabletType topodatapb.TabletType) Worker { return &MultiSplitDiffWorker{ StatusWorker: ...
go
func NewMultiSplitDiffWorker(wr *wrangler.Wrangler, cell, keyspace, shard string, excludeTables []string, minHealthyTablets, parallelDiffsCount int, waitForFixedTimeRatherThanGtidSet bool, useConsistentSnapshot bool, tabletType topodatapb.TabletType) Worker { return &MultiSplitDiffWorker{ StatusWorker: ...
[ "func", "NewMultiSplitDiffWorker", "(", "wr", "*", "wrangler", ".", "Wrangler", ",", "cell", ",", "keyspace", ",", "shard", "string", ",", "excludeTables", "[", "]", "string", ",", "minHealthyTablets", ",", "parallelDiffsCount", "int", ",", "waitForFixedTimeRather...
// NewMultiSplitDiffWorker returns a new MultiSplitDiffWorker object.
[ "NewMultiSplitDiffWorker", "returns", "a", "new", "MultiSplitDiffWorker", "object", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/worker/multi_split_diff.go#L83-L98
135,188
vitessio/vitess
go/vt/worker/multi_split_diff.go
findDestinationShards
func (msdw *MultiSplitDiffWorker) findDestinationShards(ctx context.Context) ([]*topo.ShardInfo, error) { shortCtx, cancel := context.WithTimeout(ctx, *remoteActionsTimeout) keyspaces, err := msdw.wr.TopoServer().GetKeyspaces(shortCtx) cancel() if err != nil { return nil, vterrors.Wrap(err, "failed to get list of...
go
func (msdw *MultiSplitDiffWorker) findDestinationShards(ctx context.Context) ([]*topo.ShardInfo, error) { shortCtx, cancel := context.WithTimeout(ctx, *remoteActionsTimeout) keyspaces, err := msdw.wr.TopoServer().GetKeyspaces(shortCtx) cancel() if err != nil { return nil, vterrors.Wrap(err, "failed to get list of...
[ "func", "(", "msdw", "*", "MultiSplitDiffWorker", ")", "findDestinationShards", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "*", "topo", ".", "ShardInfo", ",", "error", ")", "{", "shortCtx", ",", "cancel", ":=", "context", ".", "WithTimeout"...
// findDestinationShards finds all the shards that have filtered replication from the source shard
[ "findDestinationShards", "finds", "all", "the", "shards", "that", "have", "filtered", "replication", "from", "the", "source", "shard" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/worker/multi_split_diff.go#L230-L252
135,189
vitessio/vitess
go/vt/worker/multi_split_diff.go
stopVreplicationAt
func (msdw *MultiSplitDiffWorker) stopVreplicationAt(ctx context.Context, shardInfo *topo.ShardInfo, sourcePosition string, masterInfo *topo.TabletInfo) (string, error) { msdw.wr.Logger().Infof("Restarting master %v until it catches up to %v", shardInfo.MasterAlias, sourcePosition) shortCtx, cancel := context.WithTim...
go
func (msdw *MultiSplitDiffWorker) stopVreplicationAt(ctx context.Context, shardInfo *topo.ShardInfo, sourcePosition string, masterInfo *topo.TabletInfo) (string, error) { msdw.wr.Logger().Infof("Restarting master %v until it catches up to %v", shardInfo.MasterAlias, sourcePosition) shortCtx, cancel := context.WithTim...
[ "func", "(", "msdw", "*", "MultiSplitDiffWorker", ")", "stopVreplicationAt", "(", "ctx", "context", ".", "Context", ",", "shardInfo", "*", "topo", ".", "ShardInfo", ",", "sourcePosition", "string", ",", "masterInfo", "*", "topo", ".", "TabletInfo", ")", "(", ...
// ask the master of the destination shard to resume filtered replication // up to the specified source position, and return the destination position.
[ "ask", "the", "master", "of", "the", "destination", "shard", "to", "resume", "filtered", "replication", "up", "to", "the", "specified", "source", "position", "and", "return", "the", "destination", "position", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/worker/multi_split_diff.go#L432-L455
135,190
vitessio/vitess
go/vt/vttablet/tabletserver/vstreamer/engine.go
InitDBConfig
func (vse *Engine) InitDBConfig(dbcfgs *dbconfigs.DBConfigs) { vse.cp = dbcfgs.DbaWithDB() }
go
func (vse *Engine) InitDBConfig(dbcfgs *dbconfigs.DBConfigs) { vse.cp = dbcfgs.DbaWithDB() }
[ "func", "(", "vse", "*", "Engine", ")", "InitDBConfig", "(", "dbcfgs", "*", "dbconfigs", ".", "DBConfigs", ")", "{", "vse", ".", "cp", "=", "dbcfgs", ".", "DbaWithDB", "(", ")", "\n", "}" ]
// InitDBConfig performs saves the required info from dbconfigs for future use.
[ "InitDBConfig", "performs", "saves", "the", "required", "info", "from", "dbconfigs", "for", "future", "use", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/vstreamer/engine.go#L98-L100
135,191
vitessio/vitess
go/vt/vttablet/tabletserver/vstreamer/engine.go
Stream
func (vse *Engine) Stream(ctx context.Context, startPos string, filter *binlogdatapb.Filter, send func([]*binlogdatapb.VEvent) error) error { // Ensure kschema is initialized and the watcher is started. // Starting of the watcher has to be delayed till the first call to Stream // because this overhead should be incu...
go
func (vse *Engine) Stream(ctx context.Context, startPos string, filter *binlogdatapb.Filter, send func([]*binlogdatapb.VEvent) error) error { // Ensure kschema is initialized and the watcher is started. // Starting of the watcher has to be delayed till the first call to Stream // because this overhead should be incu...
[ "func", "(", "vse", "*", "Engine", ")", "Stream", "(", "ctx", "context", ".", "Context", ",", "startPos", "string", ",", "filter", "*", "binlogdatapb", ".", "Filter", ",", "send", "func", "(", "[", "]", "*", "binlogdatapb", ".", "VEvent", ")", "error",...
// Stream starts a new stream.
[ "Stream", "starts", "a", "new", "stream", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/vstreamer/engine.go#L146-L182
135,192
vitessio/vitess
go/vt/vttablet/tabletserver/vstreamer/engine.go
StreamRows
func (vse *Engine) StreamRows(ctx context.Context, query string, lastpk []sqltypes.Value, send func(*binlogdatapb.VStreamRowsResponse) error) error { // Ensure kschema is initialized and the watcher is started. // Starting of the watcher has to be delayed till the first call to Stream // because this overhead should...
go
func (vse *Engine) StreamRows(ctx context.Context, query string, lastpk []sqltypes.Value, send func(*binlogdatapb.VStreamRowsResponse) error) error { // Ensure kschema is initialized and the watcher is started. // Starting of the watcher has to be delayed till the first call to Stream // because this overhead should...
[ "func", "(", "vse", "*", "Engine", ")", "StreamRows", "(", "ctx", "context", ".", "Context", ",", "query", "string", ",", "lastpk", "[", "]", "sqltypes", ".", "Value", ",", "send", "func", "(", "*", "binlogdatapb", ".", "VStreamRowsResponse", ")", "error...
// StreamRows streams rows.
[ "StreamRows", "streams", "rows", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/vstreamer/engine.go#L185-L222
135,193
vitessio/vitess
go/vt/vttablet/tabletserver/vstreamer/engine.go
ServeHTTP
func (vse *Engine) ServeHTTP(response http.ResponseWriter, request *http.Request) { if err := acl.CheckAccessHTTP(request, acl.DEBUGGING); err != nil { acl.SendError(response, err) return } response.Header().Set("Content-Type", "application/json; charset=utf-8") vs := vse.vschema() if vs == nil || vs.Keyspace ...
go
func (vse *Engine) ServeHTTP(response http.ResponseWriter, request *http.Request) { if err := acl.CheckAccessHTTP(request, acl.DEBUGGING); err != nil { acl.SendError(response, err) return } response.Header().Set("Content-Type", "application/json; charset=utf-8") vs := vse.vschema() if vs == nil || vs.Keyspace ...
[ "func", "(", "vse", "*", "Engine", ")", "ServeHTTP", "(", "response", "http", ".", "ResponseWriter", ",", "request", "*", "http", ".", "Request", ")", "{", "if", "err", ":=", "acl", ".", "CheckAccessHTTP", "(", "request", ",", "acl", ".", "DEBUGGING", ...
// ServeHTTP shows the current VSchema.
[ "ServeHTTP", "shows", "the", "current", "VSchema", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/vstreamer/engine.go#L225-L243
135,194
vitessio/vitess
go/acl/acl.go
RegisterPolicy
func RegisterPolicy(name string, policy Policy) { if _, ok := policies[name]; ok { log.Fatalf("policy %s is already registered", name) } policies[name] = policy }
go
func RegisterPolicy(name string, policy Policy) { if _, ok := policies[name]; ok { log.Fatalf("policy %s is already registered", name) } policies[name] = policy }
[ "func", "RegisterPolicy", "(", "name", "string", ",", "policy", "Policy", ")", "{", "if", "_", ",", "ok", ":=", "policies", "[", "name", "]", ";", "ok", "{", "log", ".", "Fatalf", "(", "\"", "\"", ",", "name", ")", "\n", "}", "\n", "policies", "[...
// RegisterPolicy registers a security policy. This function must be called // before the first call to CheckAccess happens, preferably through an init. // This will ensure that the requested policy can be found by other acl // functions when needed.
[ "RegisterPolicy", "registers", "a", "security", "policy", ".", "This", "function", "must", "be", "called", "before", "the", "first", "call", "to", "CheckAccess", "happens", "preferably", "through", "an", "init", ".", "This", "will", "ensure", "that", "the", "r...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/acl/acl.go#L63-L68
135,195
vitessio/vitess
go/acl/acl.go
CheckAccessActor
func CheckAccessActor(actor, role string) error { once.Do(savePolicy) if currentPolicy != nil { return currentPolicy.CheckAccessActor(actor, role) } return nil }
go
func CheckAccessActor(actor, role string) error { once.Do(savePolicy) if currentPolicy != nil { return currentPolicy.CheckAccessActor(actor, role) } return nil }
[ "func", "CheckAccessActor", "(", "actor", ",", "role", "string", ")", "error", "{", "once", ".", "Do", "(", "savePolicy", ")", "\n", "if", "currentPolicy", "!=", "nil", "{", "return", "currentPolicy", ".", "CheckAccessActor", "(", "actor", ",", "role", ")"...
// CheckAccessActor uses the current security policy to // verify if an actor has access to the role.
[ "CheckAccessActor", "uses", "the", "current", "security", "policy", "to", "verify", "if", "an", "actor", "has", "access", "to", "the", "role", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/acl/acl.go#L83-L89
135,196
vitessio/vitess
go/acl/acl.go
CheckAccessHTTP
func CheckAccessHTTP(req *http.Request, role string) error { once.Do(savePolicy) if currentPolicy != nil { return currentPolicy.CheckAccessHTTP(req, role) } return nil }
go
func CheckAccessHTTP(req *http.Request, role string) error { once.Do(savePolicy) if currentPolicy != nil { return currentPolicy.CheckAccessHTTP(req, role) } return nil }
[ "func", "CheckAccessHTTP", "(", "req", "*", "http", ".", "Request", ",", "role", "string", ")", "error", "{", "once", ".", "Do", "(", "savePolicy", ")", "\n", "if", "currentPolicy", "!=", "nil", "{", "return", "currentPolicy", ".", "CheckAccessHTTP", "(", ...
// CheckAccessHTTP uses the current security policy to // verify if an actor in an http request has access to // the role.
[ "CheckAccessHTTP", "uses", "the", "current", "security", "policy", "to", "verify", "if", "an", "actor", "in", "an", "http", "request", "has", "access", "to", "the", "role", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/acl/acl.go#L94-L100
135,197
vitessio/vitess
go/acl/acl.go
SendError
func SendError(w http.ResponseWriter, err error) { w.WriteHeader(http.StatusForbidden) fmt.Fprintf(w, "Access denied: %v\n", err) }
go
func SendError(w http.ResponseWriter, err error) { w.WriteHeader(http.StatusForbidden) fmt.Fprintf(w, "Access denied: %v\n", err) }
[ "func", "SendError", "(", "w", "http", ".", "ResponseWriter", ",", "err", "error", ")", "{", "w", ".", "WriteHeader", "(", "http", ".", "StatusForbidden", ")", "\n", "fmt", ".", "Fprintf", "(", "w", ",", "\"", "\\n", "\"", ",", "err", ")", "\n", "}...
// SendError is a convenience function that sends an ACL // error as an HTTP response.
[ "SendError", "is", "a", "convenience", "function", "that", "sends", "an", "ACL", "error", "as", "an", "HTTP", "response", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/acl/acl.go#L104-L107
135,198
vitessio/vitess
go/vt/vtctl/topo.go
DecodeContent
func DecodeContent(filename string, data []byte, json bool) (string, error) { name := path.Base(filename) var p proto.Message switch name { case topo.CellInfoFile: p = new(topodatapb.CellInfo) case topo.KeyspaceFile: p = new(topodatapb.Keyspace) case topo.ShardFile: p = new(topodatapb.Shard) case topo.VSc...
go
func DecodeContent(filename string, data []byte, json bool) (string, error) { name := path.Base(filename) var p proto.Message switch name { case topo.CellInfoFile: p = new(topodatapb.CellInfo) case topo.KeyspaceFile: p = new(topodatapb.Keyspace) case topo.ShardFile: p = new(topodatapb.Shard) case topo.VSc...
[ "func", "DecodeContent", "(", "filename", "string", ",", "data", "[", "]", "byte", ",", "json", "bool", ")", "(", "string", ",", "error", ")", "{", "name", ":=", "path", ".", "Base", "(", "filename", ")", "\n\n", "var", "p", "proto", ".", "Message", ...
// DecodeContent uses the filename to imply a type, and proto-decodes // the right object, then echoes it as a string.
[ "DecodeContent", "uses", "the", "filename", "to", "imply", "a", "type", "and", "proto", "-", "decodes", "the", "right", "object", "then", "echoes", "it", "as", "a", "string", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtctl/topo.go#L60-L100
135,199
vitessio/vitess
go/vt/servenv/grpc_auth.go
RegisterAuthPlugin
func RegisterAuthPlugin(name string, authPlugin func() (Authenticator, error)) { if _, ok := authPlugins[name]; ok { log.Fatalf("AuthPlugin named %v already exists", name) } authPlugins[name] = authPlugin }
go
func RegisterAuthPlugin(name string, authPlugin func() (Authenticator, error)) { if _, ok := authPlugins[name]; ok { log.Fatalf("AuthPlugin named %v already exists", name) } authPlugins[name] = authPlugin }
[ "func", "RegisterAuthPlugin", "(", "name", "string", ",", "authPlugin", "func", "(", ")", "(", "Authenticator", ",", "error", ")", ")", "{", "if", "_", ",", "ok", ":=", "authPlugins", "[", "name", "]", ";", "ok", "{", "log", ".", "Fatalf", "(", "\"",...
// RegisterAuthPlugin registers an implementation of AuthServer.
[ "RegisterAuthPlugin", "registers", "an", "implementation", "of", "AuthServer", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/servenv/grpc_auth.go#L40-L45