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,000
vitessio/vitess
go/pools/resource_pool.go
SetIdleTimeout
func (rp *ResourcePool) SetIdleTimeout(idleTimeout time.Duration) { if rp.idleTimer == nil { panic("SetIdleTimeout called when timer not initialized") } rp.idleTimeout.Set(idleTimeout) rp.idleTimer.SetInterval(idleTimeout / 10) }
go
func (rp *ResourcePool) SetIdleTimeout(idleTimeout time.Duration) { if rp.idleTimer == nil { panic("SetIdleTimeout called when timer not initialized") } rp.idleTimeout.Set(idleTimeout) rp.idleTimer.SetInterval(idleTimeout / 10) }
[ "func", "(", "rp", "*", "ResourcePool", ")", "SetIdleTimeout", "(", "idleTimeout", "time", ".", "Duration", ")", "{", "if", "rp", ".", "idleTimer", "==", "nil", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "rp", ".", "idleTimeout", ".", "Se...
// SetIdleTimeout sets the idle timeout. It can only be used if there was an // idle timeout set when the pool was created.
[ "SetIdleTimeout", "sets", "the", "idle", "timeout", ".", "It", "can", "only", "be", "used", "if", "there", "was", "an", "idle", "timeout", "set", "when", "the", "pool", "was", "created", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/pools/resource_pool.go#L279-L286
135,001
vitessio/vitess
go/pools/resource_pool.go
StatsJSON
func (rp *ResourcePool) StatsJSON() string { return fmt.Sprintf(`{"Capacity": %v, "Available": %v, "Active": %v, "InUse": %v, "MaxCapacity": %v, "WaitCount": %v, "WaitTime": %v, "IdleTimeout": %v, "IdleClosed": %v}`, rp.Capacity(), rp.Available(), rp.Active(), rp.InUse(), rp.MaxCap(), rp.WaitCount(), rp....
go
func (rp *ResourcePool) StatsJSON() string { return fmt.Sprintf(`{"Capacity": %v, "Available": %v, "Active": %v, "InUse": %v, "MaxCapacity": %v, "WaitCount": %v, "WaitTime": %v, "IdleTimeout": %v, "IdleClosed": %v}`, rp.Capacity(), rp.Available(), rp.Active(), rp.InUse(), rp.MaxCap(), rp.WaitCount(), rp....
[ "func", "(", "rp", "*", "ResourcePool", ")", "StatsJSON", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "`{\"Capacity\": %v, \"Available\": %v, \"Active\": %v, \"InUse\": %v, \"MaxCapacity\": %v, \"WaitCount\": %v, \"WaitTime\": %v, \"IdleTimeout\": %v, \"IdleClosed\...
// StatsJSON returns the stats in JSON format.
[ "StatsJSON", "returns", "the", "stats", "in", "JSON", "format", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/pools/resource_pool.go#L289-L301
135,002
vitessio/vitess
go/vt/topo/cells_aliases.go
GetCellsAliases
func (ts *Server) GetCellsAliases(ctx context.Context, strongRead bool) (ret map[string]*topodatapb.CellsAlias, err error) { conn := ts.globalCell if !strongRead { conn = ts.globalReadOnlyCell } entries, err := ts.globalCell.ListDir(ctx, CellsAliasesPath, false /*full*/) switch { case IsErrType(err, NoNode): ...
go
func (ts *Server) GetCellsAliases(ctx context.Context, strongRead bool) (ret map[string]*topodatapb.CellsAlias, err error) { conn := ts.globalCell if !strongRead { conn = ts.globalReadOnlyCell } entries, err := ts.globalCell.ListDir(ctx, CellsAliasesPath, false /*full*/) switch { case IsErrType(err, NoNode): ...
[ "func", "(", "ts", "*", "Server", ")", "GetCellsAliases", "(", "ctx", "context", ".", "Context", ",", "strongRead", "bool", ")", "(", "ret", "map", "[", "string", "]", "*", "topodatapb", ".", "CellsAlias", ",", "err", "error", ")", "{", "conn", ":=", ...
// GetCellsAliases returns the names of the existing cells. They are // sorted by name.
[ "GetCellsAliases", "returns", "the", "names", "of", "the", "existing", "cells", ".", "They", "are", "sorted", "by", "name", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/cells_aliases.go#L43-L75
135,003
vitessio/vitess
go/vt/topo/cells_aliases.go
DeleteCellsAlias
func (ts *Server) DeleteCellsAlias(ctx context.Context, alias string) error { ts.clearCellAliasesCache() filePath := pathForCellsAlias(alias) return ts.globalCell.Delete(ctx, filePath, nil) }
go
func (ts *Server) DeleteCellsAlias(ctx context.Context, alias string) error { ts.clearCellAliasesCache() filePath := pathForCellsAlias(alias) return ts.globalCell.Delete(ctx, filePath, nil) }
[ "func", "(", "ts", "*", "Server", ")", "DeleteCellsAlias", "(", "ctx", "context", ".", "Context", ",", "alias", "string", ")", "error", "{", "ts", ".", "clearCellAliasesCache", "(", ")", "\n\n", "filePath", ":=", "pathForCellsAlias", "(", "alias", ")", "\n...
// DeleteCellsAlias deletes the specified CellsAlias
[ "DeleteCellsAlias", "deletes", "the", "specified", "CellsAlias" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/cells_aliases.go#L78-L83
135,004
vitessio/vitess
go/vt/topo/cells_aliases.go
CreateCellsAlias
func (ts *Server) CreateCellsAlias(ctx context.Context, alias string, cellsAlias *topodatapb.CellsAlias) error { currentAliases, err := ts.GetCellsAliases(ctx, true) if err != nil { return err } if overlappingAliases(currentAliases, cellsAlias) { return fmt.Errorf("unsupported: you can't over overlapping alias...
go
func (ts *Server) CreateCellsAlias(ctx context.Context, alias string, cellsAlias *topodatapb.CellsAlias) error { currentAliases, err := ts.GetCellsAliases(ctx, true) if err != nil { return err } if overlappingAliases(currentAliases, cellsAlias) { return fmt.Errorf("unsupported: you can't over overlapping alias...
[ "func", "(", "ts", "*", "Server", ")", "CreateCellsAlias", "(", "ctx", "context", ".", "Context", ",", "alias", "string", ",", "cellsAlias", "*", "topodatapb", ".", "CellsAlias", ")", "error", "{", "currentAliases", ",", "err", ":=", "ts", ".", "GetCellsAl...
// CreateCellsAlias creates a new CellInfo with the provided content.
[ "CreateCellsAlias", "creates", "a", "new", "CellInfo", "with", "the", "provided", "content", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/cells_aliases.go#L86-L109
135,005
vitessio/vitess
go/vt/topo/cells_aliases.go
UpdateCellsAlias
func (ts *Server) UpdateCellsAlias(ctx context.Context, alias string, update func(*topodatapb.CellsAlias) error) error { ts.clearCellAliasesCache() filePath := pathForCellsAlias(alias) for { ca := &topodatapb.CellsAlias{} // Read the file, unpack the contents. contents, version, err := ts.globalCell.Get(ctx,...
go
func (ts *Server) UpdateCellsAlias(ctx context.Context, alias string, update func(*topodatapb.CellsAlias) error) error { ts.clearCellAliasesCache() filePath := pathForCellsAlias(alias) for { ca := &topodatapb.CellsAlias{} // Read the file, unpack the contents. contents, version, err := ts.globalCell.Get(ctx,...
[ "func", "(", "ts", "*", "Server", ")", "UpdateCellsAlias", "(", "ctx", "context", ".", "Context", ",", "alias", "string", ",", "update", "func", "(", "*", "topodatapb", ".", "CellsAlias", ")", "error", ")", "error", "{", "ts", ".", "clearCellAliasesCache",...
// UpdateCellsAlias updates cells for a given alias
[ "UpdateCellsAlias", "updates", "cells", "for", "a", "given", "alias" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/cells_aliases.go#L112-L160
135,006
vitessio/vitess
go/vt/mysqlctl/permissions.go
GetPermissions
func GetPermissions(mysqld MysqlDaemon) (*tabletmanagerdatapb.Permissions, error) { ctx := context.TODO() permissions := &tabletmanagerdatapb.Permissions{} // get Users qr, err := mysqld.FetchSuperQuery(ctx, "SELECT * FROM mysql.user ORDER BY host, user") if err != nil { return nil, err } for _, row := range ...
go
func GetPermissions(mysqld MysqlDaemon) (*tabletmanagerdatapb.Permissions, error) { ctx := context.TODO() permissions := &tabletmanagerdatapb.Permissions{} // get Users qr, err := mysqld.FetchSuperQuery(ctx, "SELECT * FROM mysql.user ORDER BY host, user") if err != nil { return nil, err } for _, row := range ...
[ "func", "GetPermissions", "(", "mysqld", "MysqlDaemon", ")", "(", "*", "tabletmanagerdatapb", ".", "Permissions", ",", "error", ")", "{", "ctx", ":=", "context", ".", "TODO", "(", ")", "\n", "permissions", ":=", "&", "tabletmanagerdatapb", ".", "Permissions", ...
// GetPermissions lists the permissions on the mysqld. // The rows are sorted in primary key order to help with comparing // permissions between tablets.
[ "GetPermissions", "lists", "the", "permissions", "on", "the", "mysqld", ".", "The", "rows", "are", "sorted", "in", "primary", "key", "order", "to", "help", "with", "comparing", "permissions", "between", "tablets", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/permissions.go#L28-L51
135,007
vitessio/vitess
go/json2/marshal.go
MarshalPB
func MarshalPB(pb proto.Message) ([]byte, error) { buf := new(bytes.Buffer) m := jsonpb.Marshaler{} if err := m.Marshal(buf, pb); err != nil { return nil, err } return buf.Bytes(), nil }
go
func MarshalPB(pb proto.Message) ([]byte, error) { buf := new(bytes.Buffer) m := jsonpb.Marshaler{} if err := m.Marshal(buf, pb); err != nil { return nil, err } return buf.Bytes(), nil }
[ "func", "MarshalPB", "(", "pb", "proto", ".", "Message", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "buf", ":=", "new", "(", "bytes", ".", "Buffer", ")", "\n", "m", ":=", "jsonpb", ".", "Marshaler", "{", "}", "\n", "if", "err", ":=", "...
// MarshalPB marshals a proto.
[ "MarshalPB", "marshals", "a", "proto", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/json2/marshal.go#L27-L34
135,008
vitessio/vitess
go/json2/marshal.go
MarshalIndentPB
func MarshalIndentPB(pb proto.Message, indent string) ([]byte, error) { buf := new(bytes.Buffer) m := jsonpb.Marshaler{ Indent: indent, } if err := m.Marshal(buf, pb); err != nil { return nil, err } return buf.Bytes(), nil }
go
func MarshalIndentPB(pb proto.Message, indent string) ([]byte, error) { buf := new(bytes.Buffer) m := jsonpb.Marshaler{ Indent: indent, } if err := m.Marshal(buf, pb); err != nil { return nil, err } return buf.Bytes(), nil }
[ "func", "MarshalIndentPB", "(", "pb", "proto", ".", "Message", ",", "indent", "string", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "buf", ":=", "new", "(", "bytes", ".", "Buffer", ")", "\n", "m", ":=", "jsonpb", ".", "Marshaler", "{", "Ind...
// MarshalIndentPB MarshalIndents a proto.
[ "MarshalIndentPB", "MarshalIndents", "a", "proto", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/json2/marshal.go#L37-L46
135,009
vitessio/vitess
go/stats/prometheusbackend/prometheusbackend.go
Init
func Init(namespace string) { http.Handle("/metrics", promhttp.Handler()) be.namespace = namespace stats.Register(be.publishPrometheusMetric) }
go
func Init(namespace string) { http.Handle("/metrics", promhttp.Handler()) be.namespace = namespace stats.Register(be.publishPrometheusMetric) }
[ "func", "Init", "(", "namespace", "string", ")", "{", "http", ".", "Handle", "(", "\"", "\"", ",", "promhttp", ".", "Handler", "(", ")", ")", "\n", "be", ".", "namespace", "=", "namespace", "\n", "stats", ".", "Register", "(", "be", ".", "publishProm...
// Init initializes the Prometheus be with the given namespace.
[ "Init", "initializes", "the", "Prometheus", "be", "with", "the", "given", "namespace", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/stats/prometheusbackend/prometheusbackend.go#L24-L28
135,010
vitessio/vitess
go/stats/prometheusbackend/prometheusbackend.go
buildPromName
func (be PromBackend) buildPromName(name string) string { s := strings.TrimPrefix(normalizeMetric(name), be.namespace+"_") return prometheus.BuildFQName("", be.namespace, s) }
go
func (be PromBackend) buildPromName(name string) string { s := strings.TrimPrefix(normalizeMetric(name), be.namespace+"_") return prometheus.BuildFQName("", be.namespace, s) }
[ "func", "(", "be", "PromBackend", ")", "buildPromName", "(", "name", "string", ")", "string", "{", "s", ":=", "strings", ".", "TrimPrefix", "(", "normalizeMetric", "(", "name", ")", ",", "be", ".", "namespace", "+", "\"", "\"", ")", "\n", "return", "pr...
// buildPromName specifies the namespace as a prefix to the metric name
[ "buildPromName", "specifies", "the", "namespace", "as", "a", "prefix", "to", "the", "metric", "name" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/stats/prometheusbackend/prometheusbackend.go#L78-L81
135,011
vitessio/vitess
go/stats/prometheusbackend/prometheusbackend.go
normalizeMetric
func normalizeMetric(name string) string { // Special cases r := strings.NewReplacer("VSchema", "vschema", "VtGate", "vtgate") name = r.Replace(name) return stats.GetSnakeName(name) }
go
func normalizeMetric(name string) string { // Special cases r := strings.NewReplacer("VSchema", "vschema", "VtGate", "vtgate") name = r.Replace(name) return stats.GetSnakeName(name) }
[ "func", "normalizeMetric", "(", "name", "string", ")", "string", "{", "// Special cases", "r", ":=", "strings", ".", "NewReplacer", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "name", "=", "r", ".", "Replace", "(", ...
// normalizeMetricForPrometheus produces a compliant name by applying // special case conversions and then applying a camel case to snake case converter.
[ "normalizeMetricForPrometheus", "produces", "a", "compliant", "name", "by", "applying", "special", "case", "conversions", "and", "then", "applying", "a", "camel", "case", "to", "snake", "case", "converter", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/stats/prometheusbackend/prometheusbackend.go#L93-L99
135,012
vitessio/vitess
go/vt/vtgate/executor.go
NewExecutor
func NewExecutor(ctx context.Context, serv srvtopo.Server, cell, statsName string, resolver *Resolver, normalize bool, streamSize int, queryPlanCacheSize int64, legacyAutocommit bool) *Executor { e := &Executor{ serv: serv, cell: cell, resolver: resolver, scatterConn: resol...
go
func NewExecutor(ctx context.Context, serv srvtopo.Server, cell, statsName string, resolver *Resolver, normalize bool, streamSize int, queryPlanCacheSize int64, legacyAutocommit bool) *Executor { e := &Executor{ serv: serv, cell: cell, resolver: resolver, scatterConn: resol...
[ "func", "NewExecutor", "(", "ctx", "context", ".", "Context", ",", "serv", "srvtopo", ".", "Server", ",", "cell", ",", "statsName", "string", ",", "resolver", "*", "Resolver", ",", "normalize", "bool", ",", "streamSize", "int", ",", "queryPlanCacheSize", "in...
// NewExecutor creates a new Executor.
[ "NewExecutor", "creates", "a", "new", "Executor", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L93-L122
135,013
vitessio/vitess
go/vt/vtgate/executor.go
Execute
func (e *Executor) Execute(ctx context.Context, method string, safeSession *SafeSession, sql string, bindVars map[string]*querypb.BindVariable) (result *sqltypes.Result, err error) { span, ctx := trace.NewSpan(ctx, "executor.Execute") span.Annotate("method", method) trace.AnnotateSQL(span, sql) defer span.Finish() ...
go
func (e *Executor) Execute(ctx context.Context, method string, safeSession *SafeSession, sql string, bindVars map[string]*querypb.BindVariable) (result *sqltypes.Result, err error) { span, ctx := trace.NewSpan(ctx, "executor.Execute") span.Annotate("method", method) trace.AnnotateSQL(span, sql) defer span.Finish() ...
[ "func", "(", "e", "*", "Executor", ")", "Execute", "(", "ctx", "context", ".", "Context", ",", "method", "string", ",", "safeSession", "*", "SafeSession", ",", "sql", "string", ",", "bindVars", "map", "[", "string", "]", "*", "querypb", ".", "BindVariabl...
// Execute executes a non-streaming query.
[ "Execute", "executes", "a", "non", "-", "streaming", "query", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L125-L142
135,014
vitessio/vitess
go/vt/vtgate/executor.go
StreamExecute
func (e *Executor) StreamExecute(ctx context.Context, method string, safeSession *SafeSession, sql string, bindVars map[string]*querypb.BindVariable, target querypb.Target, callback func(*sqltypes.Result) error) (err error) { logStats := NewLogStats(ctx, method, sql, bindVars) logStats.StmtType = sqlparser.StmtType(s...
go
func (e *Executor) StreamExecute(ctx context.Context, method string, safeSession *SafeSession, sql string, bindVars map[string]*querypb.BindVariable, target querypb.Target, callback func(*sqltypes.Result) error) (err error) { logStats := NewLogStats(ctx, method, sql, bindVars) logStats.StmtType = sqlparser.StmtType(s...
[ "func", "(", "e", "*", "Executor", ")", "StreamExecute", "(", "ctx", "context", ".", "Context", ",", "method", "string", ",", "safeSession", "*", "SafeSession", ",", "sql", "string", ",", "bindVars", "map", "[", "string", "]", "*", "querypb", ".", "BindV...
// StreamExecute executes a streaming query.
[ "StreamExecute", "executes", "a", "streaming", "query", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L1060-L1138
135,015
vitessio/vitess
go/vt/vtgate/executor.go
MessageStream
func (e *Executor) MessageStream(ctx context.Context, keyspace string, shard string, keyRange *topodatapb.KeyRange, name string, callback func(*sqltypes.Result) error) error { err := e.resolver.MessageStream( ctx, keyspace, shard, keyRange, name, callback, ) return formatError(err) }
go
func (e *Executor) MessageStream(ctx context.Context, keyspace string, shard string, keyRange *topodatapb.KeyRange, name string, callback func(*sqltypes.Result) error) error { err := e.resolver.MessageStream( ctx, keyspace, shard, keyRange, name, callback, ) return formatError(err) }
[ "func", "(", "e", "*", "Executor", ")", "MessageStream", "(", "ctx", "context", ".", "Context", ",", "keyspace", "string", ",", "shard", "string", ",", "keyRange", "*", "topodatapb", ".", "KeyRange", ",", "name", "string", ",", "callback", "func", "(", "...
// MessageStream is part of the vtgate service API. This is a V2 level API that's sent // to the Resolver.
[ "MessageStream", "is", "part", "of", "the", "vtgate", "service", "API", ".", "This", "is", "a", "V2", "level", "API", "that", "s", "sent", "to", "the", "Resolver", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L1172-L1182
135,016
vitessio/vitess
go/vt/vtgate/executor.go
IsKeyspaceRangeBasedSharded
func (e *Executor) IsKeyspaceRangeBasedSharded(keyspace string) bool { vschema := e.VSchema() ks, ok := vschema.Keyspaces[keyspace] if !ok { return false } if ks.Keyspace == nil { return false } return ks.Keyspace.Sharded }
go
func (e *Executor) IsKeyspaceRangeBasedSharded(keyspace string) bool { vschema := e.VSchema() ks, ok := vschema.Keyspaces[keyspace] if !ok { return false } if ks.Keyspace == nil { return false } return ks.Keyspace.Sharded }
[ "func", "(", "e", "*", "Executor", ")", "IsKeyspaceRangeBasedSharded", "(", "keyspace", "string", ")", "bool", "{", "vschema", ":=", "e", ".", "VSchema", "(", ")", "\n", "ks", ",", "ok", ":=", "vschema", ".", "Keyspaces", "[", "keyspace", "]", "\n", "i...
// IsKeyspaceRangeBasedSharded returns true if the keyspace in the vschema is // marked as sharded.
[ "IsKeyspaceRangeBasedSharded", "returns", "true", "if", "the", "keyspace", "in", "the", "vschema", "is", "marked", "as", "sharded", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L1238-L1248
135,017
vitessio/vitess
go/vt/vtgate/executor.go
VSchema
func (e *Executor) VSchema() *vindexes.VSchema { e.mu.Lock() defer e.mu.Unlock() return e.vschema }
go
func (e *Executor) VSchema() *vindexes.VSchema { e.mu.Lock() defer e.mu.Unlock() return e.vschema }
[ "func", "(", "e", "*", "Executor", ")", "VSchema", "(", ")", "*", "vindexes", ".", "VSchema", "{", "e", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "e", ".", "mu", ".", "Unlock", "(", ")", "\n", "return", "e", ".", "vschema", "\n", "}" ]
// VSchema returns the VSchema.
[ "VSchema", "returns", "the", "VSchema", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L1251-L1255
135,018
vitessio/vitess
go/vt/vtgate/executor.go
SaveVSchema
func (e *Executor) SaveVSchema(vschema *vindexes.VSchema, stats *VSchemaStats) { e.mu.Lock() defer e.mu.Unlock() e.vschema = vschema e.vschemaStats = stats e.plans.Clear() if vschemaCounters != nil { vschemaCounters.Add("Reload", 1) } }
go
func (e *Executor) SaveVSchema(vschema *vindexes.VSchema, stats *VSchemaStats) { e.mu.Lock() defer e.mu.Unlock() e.vschema = vschema e.vschemaStats = stats e.plans.Clear() if vschemaCounters != nil { vschemaCounters.Add("Reload", 1) } }
[ "func", "(", "e", "*", "Executor", ")", "SaveVSchema", "(", "vschema", "*", "vindexes", ".", "VSchema", ",", "stats", "*", "VSchemaStats", ")", "{", "e", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "e", ".", "mu", ".", "Unlock", "(", ")", "\...
// SaveVSchema updates the vschema and stats
[ "SaveVSchema", "updates", "the", "vschema", "and", "stats" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L1258-L1269
135,019
vitessio/vitess
go/vt/vtgate/executor.go
ParseDestinationTarget
func (e *Executor) ParseDestinationTarget(targetString string) (string, topodatapb.TabletType, key.Destination, error) { destKeyspace, destTabletType, dest, err := topoproto.ParseDestination(targetString, defaultTabletType) // Set default keyspace if destKeyspace == "" && len(e.VSchema().Keyspaces) == 1 { for k :=...
go
func (e *Executor) ParseDestinationTarget(targetString string) (string, topodatapb.TabletType, key.Destination, error) { destKeyspace, destTabletType, dest, err := topoproto.ParseDestination(targetString, defaultTabletType) // Set default keyspace if destKeyspace == "" && len(e.VSchema().Keyspaces) == 1 { for k :=...
[ "func", "(", "e", "*", "Executor", ")", "ParseDestinationTarget", "(", "targetString", "string", ")", "(", "string", ",", "topodatapb", ".", "TabletType", ",", "key", ".", "Destination", ",", "error", ")", "{", "destKeyspace", ",", "destTabletType", ",", "de...
// ParseDestinationTarget parses destination target string and sets default keyspace if possible.
[ "ParseDestinationTarget", "parses", "destination", "target", "string", "and", "sets", "default", "keyspace", "if", "possible", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L1272-L1281
135,020
vitessio/vitess
go/vt/vtgate/executor.go
getPlan
func (e *Executor) getPlan(vcursor *vcursorImpl, sql string, comments sqlparser.MarginComments, bindVars map[string]*querypb.BindVariable, skipQueryPlanCache bool, logStats *LogStats) (*engine.Plan, error) { if logStats != nil { logStats.SQL = comments.Leading + sql + comments.Trailing logStats.BindVariables = bin...
go
func (e *Executor) getPlan(vcursor *vcursorImpl, sql string, comments sqlparser.MarginComments, bindVars map[string]*querypb.BindVariable, skipQueryPlanCache bool, logStats *LogStats) (*engine.Plan, error) { if logStats != nil { logStats.SQL = comments.Leading + sql + comments.Trailing logStats.BindVariables = bin...
[ "func", "(", "e", "*", "Executor", ")", "getPlan", "(", "vcursor", "*", "vcursorImpl", ",", "sql", "string", ",", "comments", "sqlparser", ".", "MarginComments", ",", "bindVars", "map", "[", "string", "]", "*", "querypb", ".", "BindVariable", ",", "skipQue...
// getPlan computes the plan for the given query. If one is in // the cache, it reuses it.
[ "getPlan", "computes", "the", "plan", "for", "the", "given", "query", ".", "If", "one", "is", "in", "the", "cache", "it", "reuses", "it", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L1285-L1335
135,021
vitessio/vitess
go/vt/vtgate/executor.go
skipQueryPlanCache
func skipQueryPlanCache(safeSession *SafeSession) bool { if safeSession == nil || safeSession.Options == nil { return false } return safeSession.Options.SkipQueryPlanCache }
go
func skipQueryPlanCache(safeSession *SafeSession) bool { if safeSession == nil || safeSession.Options == nil { return false } return safeSession.Options.SkipQueryPlanCache }
[ "func", "skipQueryPlanCache", "(", "safeSession", "*", "SafeSession", ")", "bool", "{", "if", "safeSession", "==", "nil", "||", "safeSession", ".", "Options", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "safeSession", ".", "Options", ".",...
// skipQueryPlanCache extracts SkipQueryPlanCache from session
[ "skipQueryPlanCache", "extracts", "SkipQueryPlanCache", "from", "session" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L1338-L1343
135,022
vitessio/vitess
go/vt/vtgate/executor.go
ServeHTTP
func (e *Executor) ServeHTTP(response http.ResponseWriter, request *http.Request) { if err := acl.CheckAccessHTTP(request, acl.DEBUGGING); err != nil { acl.SendError(response, err) return } if request.URL.Path == "/debug/query_plans" { keys := e.plans.Keys() response.Header().Set("Content-Type", "text/plain"...
go
func (e *Executor) ServeHTTP(response http.ResponseWriter, request *http.Request) { if err := acl.CheckAccessHTTP(request, acl.DEBUGGING); err != nil { acl.SendError(response, err) return } if request.URL.Path == "/debug/query_plans" { keys := e.plans.Keys() response.Header().Set("Content-Type", "text/plain"...
[ "func", "(", "e", "*", "Executor", ")", "ServeHTTP", "(", "response", "http", ".", "ResponseWriter", ",", "request", "*", "http", ".", "Request", ")", "{", "if", "err", ":=", "acl", ".", "CheckAccessHTTP", "(", "request", ",", "acl", ".", "DEBUGGING", ...
// ServeHTTP shows the current plans in the query cache.
[ "ServeHTTP", "shows", "the", "current", "plans", "in", "the", "query", "cache", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L1346-L1379
135,023
vitessio/vitess
go/vt/vtgate/executor.go
VSchemaStats
func (e *Executor) VSchemaStats() *VSchemaStats { e.mu.Lock() defer e.mu.Unlock() if e.vschemaStats == nil { return &VSchemaStats{ Error: "No VSchema loaded yet.", } } return e.vschemaStats }
go
func (e *Executor) VSchemaStats() *VSchemaStats { e.mu.Lock() defer e.mu.Unlock() if e.vschemaStats == nil { return &VSchemaStats{ Error: "No VSchema loaded yet.", } } return e.vschemaStats }
[ "func", "(", "e", "*", "Executor", ")", "VSchemaStats", "(", ")", "*", "VSchemaStats", "{", "e", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "e", ".", "mu", ".", "Unlock", "(", ")", "\n", "if", "e", ".", "vschemaStats", "==", "nil", "{", "...
// VSchemaStats returns the loaded vschema stats.
[ "VSchemaStats", "returns", "the", "loaded", "vschema", "stats", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/executor.go#L1387-L1396
135,024
vitessio/vitess
go/vt/workflow/reshardingworkflowgen/workflow.go
initCheckpoint
func initCheckpoint(keyspace string, vtworkers []string, shardsToSplit [][][]string, minHealthyRdonlyTablets, splitCmd, splitDiffDestTabletType, phaseEnableApprovals string, skipStartWorkflows bool) (*workflowpb.WorkflowCheckpoint, error) { sourceShards := 0 destShards := 0 for _, shardToSplit := range shardsToSplit...
go
func initCheckpoint(keyspace string, vtworkers []string, shardsToSplit [][][]string, minHealthyRdonlyTablets, splitCmd, splitDiffDestTabletType, phaseEnableApprovals string, skipStartWorkflows bool) (*workflowpb.WorkflowCheckpoint, error) { sourceShards := 0 destShards := 0 for _, shardToSplit := range shardsToSplit...
[ "func", "initCheckpoint", "(", "keyspace", "string", ",", "vtworkers", "[", "]", "string", ",", "shardsToSplit", "[", "]", "[", "]", "[", "]", "string", ",", "minHealthyRdonlyTablets", ",", "splitCmd", ",", "splitDiffDestTabletType", ",", "phaseEnableApprovals", ...
// initCheckpoint initialize the checkpoint for keyspace reshard
[ "initCheckpoint", "initialize", "the", "checkpoint", "for", "keyspace", "reshard" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/workflow/reshardingworkflowgen/workflow.go#L191-L239
135,025
vitessio/vitess
go/vt/srvtopo/resolver.go
GetAllKeyspaces
func (r *Resolver) GetAllKeyspaces(ctx context.Context) ([]string, error) { keyspaces, err := r.topoServ.GetSrvKeyspaceNames(ctx, r.localCell) if err != nil { return nil, vterrors.Errorf(vtrpcpb.Code_UNKNOWN, "keyspace names fetch error: %v", err) } // FIXME(alainjobart) this should be unnecessary. The results /...
go
func (r *Resolver) GetAllKeyspaces(ctx context.Context) ([]string, error) { keyspaces, err := r.topoServ.GetSrvKeyspaceNames(ctx, r.localCell) if err != nil { return nil, vterrors.Errorf(vtrpcpb.Code_UNKNOWN, "keyspace names fetch error: %v", err) } // FIXME(alainjobart) this should be unnecessary. The results /...
[ "func", "(", "r", "*", "Resolver", ")", "GetAllKeyspaces", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "string", ",", "error", ")", "{", "keyspaces", ",", "err", ":=", "r", ".", "topoServ", ".", "GetSrvKeyspaceNames", "(", "ctx", ",", ...
// GetAllKeyspaces returns all the known keyspaces in the local cell.
[ "GetAllKeyspaces", "returns", "all", "the", "known", "keyspaces", "in", "the", "local", "cell", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/srvtopo/resolver.go#L151-L161
135,026
vitessio/vitess
go/vt/srvtopo/resolver.go
ResolveDestination
func (r *Resolver) ResolveDestination(ctx context.Context, keyspace string, tabletType topodatapb.TabletType, destination key.Destination) ([]*ResolvedShard, error) { rss, _, err := r.ResolveDestinations(ctx, keyspace, tabletType, nil, []key.Destination{destination}) return rss, err }
go
func (r *Resolver) ResolveDestination(ctx context.Context, keyspace string, tabletType topodatapb.TabletType, destination key.Destination) ([]*ResolvedShard, error) { rss, _, err := r.ResolveDestinations(ctx, keyspace, tabletType, nil, []key.Destination{destination}) return rss, err }
[ "func", "(", "r", "*", "Resolver", ")", "ResolveDestination", "(", "ctx", "context", ".", "Context", ",", "keyspace", "string", ",", "tabletType", "topodatapb", ".", "TabletType", ",", "destination", "key", ".", "Destination", ")", "(", "[", "]", "*", "Res...
// ResolveDestination is a shortcut to ResolveDestinations with only // one Destination, and no ids.
[ "ResolveDestination", "is", "a", "shortcut", "to", "ResolveDestinations", "with", "only", "one", "Destination", "and", "no", "ids", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/srvtopo/resolver.go#L228-L231
135,027
vitessio/vitess
go/vt/srvtopo/resolver.go
ValuesEqual
func ValuesEqual(vss1, vss2 [][]*querypb.Value) bool { if len(vss1) != len(vss2) { return false } for i, vs1 := range vss1 { if len(vs1) != len(vss2[i]) { return false } for j, v1 := range vs1 { if !proto.Equal(v1, vss2[i][j]) { return false } } } return true }
go
func ValuesEqual(vss1, vss2 [][]*querypb.Value) bool { if len(vss1) != len(vss2) { return false } for i, vs1 := range vss1 { if len(vs1) != len(vss2[i]) { return false } for j, v1 := range vs1 { if !proto.Equal(v1, vss2[i][j]) { return false } } } return true }
[ "func", "ValuesEqual", "(", "vss1", ",", "vss2", "[", "]", "[", "]", "*", "querypb", ".", "Value", ")", "bool", "{", "if", "len", "(", "vss1", ")", "!=", "len", "(", "vss2", ")", "{", "return", "false", "\n", "}", "\n", "for", "i", ",", "vs1", ...
// ValuesEqual is a helper method to compare arrays of values.
[ "ValuesEqual", "is", "a", "helper", "method", "to", "compare", "arrays", "of", "values", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/srvtopo/resolver.go#L234-L249
135,028
vitessio/vitess
go/vt/vttablet/endtoend/framework/server.go
StartServer
func StartServer(connParams, connAppDebugParams mysql.ConnParams, dbName string) error { // Setup a fake vtgate server. protocol := "resolveTest" *vtgateconn.VtgateProtocol = protocol vtgateconn.RegisterDialer(protocol, func(context.Context, string) (vtgateconn.Impl, error) { return &txResolver{ FakeVTGateConn...
go
func StartServer(connParams, connAppDebugParams mysql.ConnParams, dbName string) error { // Setup a fake vtgate server. protocol := "resolveTest" *vtgateconn.VtgateProtocol = protocol vtgateconn.RegisterDialer(protocol, func(context.Context, string) (vtgateconn.Impl, error) { return &txResolver{ FakeVTGateConn...
[ "func", "StartServer", "(", "connParams", ",", "connAppDebugParams", "mysql", ".", "ConnParams", ",", "dbName", "string", ")", "error", "{", "// Setup a fake vtgate server.", "protocol", ":=", "\"", "\"", "\n", "*", "vtgateconn", ".", "VtgateProtocol", "=", "proto...
// StartServer starts the server and initializes // all the global variables. This function should only be called // once at the beginning of the test.
[ "StartServer", "starts", "the", "server", "and", "initializes", "all", "the", "global", "variables", ".", "This", "function", "should", "only", "be", "called", "once", "at", "the", "beginning", "of", "the", "test", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/endtoend/framework/server.go#L54-L103
135,029
vitessio/vitess
go/vt/vtgate/engine/vindex_func.go
MarshalJSON
func (vf *VindexFunc) MarshalJSON() ([]byte, error) { v := struct { Opcode VindexOpcode Fields []*querypb.Field Cols []int Vindex string Value sqltypes.PlanValue }{ Opcode: vf.Opcode, Fields: vf.Fields, Cols: vf.Cols, Vindex: vf.Vindex.String(), Value: vf.Value, } return json.Marshal(v) }
go
func (vf *VindexFunc) MarshalJSON() ([]byte, error) { v := struct { Opcode VindexOpcode Fields []*querypb.Field Cols []int Vindex string Value sqltypes.PlanValue }{ Opcode: vf.Opcode, Fields: vf.Fields, Cols: vf.Cols, Vindex: vf.Vindex.String(), Value: vf.Value, } return json.Marshal(v) }
[ "func", "(", "vf", "*", "VindexFunc", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "v", ":=", "struct", "{", "Opcode", "VindexOpcode", "\n", "Fields", "[", "]", "*", "querypb", ".", "Field", "\n", "Cols", "[", "]", ...
// MarshalJSON serializes the VindexFunc into a JSON representation. // It's used for testing and diagnostics.
[ "MarshalJSON", "serializes", "the", "VindexFunc", "into", "a", "JSON", "representation", ".", "It", "s", "used", "for", "testing", "and", "diagnostics", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/engine/vindex_func.go#L45-L60
135,030
vitessio/vitess
go/trace/opentracing.go
Annotate
func (js openTracingSpan) Annotate(key string, value interface{}) { js.otSpan.SetTag(key, value) }
go
func (js openTracingSpan) Annotate(key string, value interface{}) { js.otSpan.SetTag(key, value) }
[ "func", "(", "js", "openTracingSpan", ")", "Annotate", "(", "key", "string", ",", "value", "interface", "{", "}", ")", "{", "js", ".", "otSpan", ".", "SetTag", "(", "key", ",", "value", ")", "\n", "}" ]
// Annotate will add information to an existing span
[ "Annotate", "will", "add", "information", "to", "an", "existing", "span" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/trace/opentracing.go#L37-L39
135,031
vitessio/vitess
go/trace/opentracing.go
AddGrpcServerOptions
func (jf openTracingService) AddGrpcServerOptions(addInterceptors func(s grpc.StreamServerInterceptor, u grpc.UnaryServerInterceptor)) { addInterceptors(otgrpc.OpenTracingStreamServerInterceptor(jf.Tracer), otgrpc.OpenTracingServerInterceptor(jf.Tracer)) }
go
func (jf openTracingService) AddGrpcServerOptions(addInterceptors func(s grpc.StreamServerInterceptor, u grpc.UnaryServerInterceptor)) { addInterceptors(otgrpc.OpenTracingStreamServerInterceptor(jf.Tracer), otgrpc.OpenTracingServerInterceptor(jf.Tracer)) }
[ "func", "(", "jf", "openTracingService", ")", "AddGrpcServerOptions", "(", "addInterceptors", "func", "(", "s", "grpc", ".", "StreamServerInterceptor", ",", "u", "grpc", ".", "UnaryServerInterceptor", ")", ")", "{", "addInterceptors", "(", "otgrpc", ".", "OpenTrac...
// AddGrpcServerOptions is part of an interface implementation
[ "AddGrpcServerOptions", "is", "part", "of", "an", "interface", "implementation" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/trace/opentracing.go#L48-L50
135,032
vitessio/vitess
go/trace/opentracing.go
AddGrpcClientOptions
func (jf openTracingService) AddGrpcClientOptions(addInterceptors func(s grpc.StreamClientInterceptor, u grpc.UnaryClientInterceptor)) { addInterceptors(otgrpc.OpenTracingStreamClientInterceptor(jf.Tracer), otgrpc.OpenTracingClientInterceptor(jf.Tracer)) }
go
func (jf openTracingService) AddGrpcClientOptions(addInterceptors func(s grpc.StreamClientInterceptor, u grpc.UnaryClientInterceptor)) { addInterceptors(otgrpc.OpenTracingStreamClientInterceptor(jf.Tracer), otgrpc.OpenTracingClientInterceptor(jf.Tracer)) }
[ "func", "(", "jf", "openTracingService", ")", "AddGrpcClientOptions", "(", "addInterceptors", "func", "(", "s", "grpc", ".", "StreamClientInterceptor", ",", "u", "grpc", ".", "UnaryClientInterceptor", ")", ")", "{", "addInterceptors", "(", "otgrpc", ".", "OpenTrac...
// AddGrpcClientOptions is part of an interface implementation
[ "AddGrpcClientOptions", "is", "part", "of", "an", "interface", "implementation" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/trace/opentracing.go#L53-L55
135,033
vitessio/vitess
go/trace/opentracing.go
NewClientSpan
func (jf openTracingService) NewClientSpan(parent Span, serviceName, label string) Span { span := jf.New(parent, label) span.Annotate("peer.service", serviceName) return span }
go
func (jf openTracingService) NewClientSpan(parent Span, serviceName, label string) Span { span := jf.New(parent, label) span.Annotate("peer.service", serviceName) return span }
[ "func", "(", "jf", "openTracingService", ")", "NewClientSpan", "(", "parent", "Span", ",", "serviceName", ",", "label", "string", ")", "Span", "{", "span", ":=", "jf", ".", "New", "(", "parent", ",", "label", ")", "\n", "span", ".", "Annotate", "(", "\...
// NewClientSpan is part of an interface implementation
[ "NewClientSpan", "is", "part", "of", "an", "interface", "implementation" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/trace/opentracing.go#L58-L62
135,034
vitessio/vitess
go/trace/opentracing.go
New
func (jf openTracingService) New(parent Span, label string) Span { var innerSpan opentracing.Span if parent == nil { innerSpan = jf.Tracer.StartSpan(label) } else { jaegerParent := parent.(openTracingSpan) span := jaegerParent.otSpan innerSpan = jf.Tracer.StartSpan(label, opentracing.ChildOf(span.Context()))...
go
func (jf openTracingService) New(parent Span, label string) Span { var innerSpan opentracing.Span if parent == nil { innerSpan = jf.Tracer.StartSpan(label) } else { jaegerParent := parent.(openTracingSpan) span := jaegerParent.otSpan innerSpan = jf.Tracer.StartSpan(label, opentracing.ChildOf(span.Context()))...
[ "func", "(", "jf", "openTracingService", ")", "New", "(", "parent", "Span", ",", "label", "string", ")", "Span", "{", "var", "innerSpan", "opentracing", ".", "Span", "\n", "if", "parent", "==", "nil", "{", "innerSpan", "=", "jf", ".", "Tracer", ".", "S...
// New is part of an interface implementation
[ "New", "is", "part", "of", "an", "interface", "implementation" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/trace/opentracing.go#L65-L75
135,035
vitessio/vitess
go/trace/opentracing.go
FromContext
func (jf openTracingService) FromContext(ctx context.Context) (Span, bool) { innerSpan := opentracing.SpanFromContext(ctx) if innerSpan != nil { return openTracingSpan{otSpan: innerSpan}, true } else { return nil, false } }
go
func (jf openTracingService) FromContext(ctx context.Context) (Span, bool) { innerSpan := opentracing.SpanFromContext(ctx) if innerSpan != nil { return openTracingSpan{otSpan: innerSpan}, true } else { return nil, false } }
[ "func", "(", "jf", "openTracingService", ")", "FromContext", "(", "ctx", "context", ".", "Context", ")", "(", "Span", ",", "bool", ")", "{", "innerSpan", ":=", "opentracing", ".", "SpanFromContext", "(", "ctx", ")", "\n\n", "if", "innerSpan", "!=", "nil", ...
// FromContext is part of an interface implementation
[ "FromContext", "is", "part", "of", "an", "interface", "implementation" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/trace/opentracing.go#L78-L86
135,036
vitessio/vitess
go/trace/opentracing.go
NewContext
func (jf openTracingService) NewContext(parent context.Context, s Span) context.Context { span, ok := s.(openTracingSpan) if !ok { return nil } return opentracing.ContextWithSpan(parent, span.otSpan) }
go
func (jf openTracingService) NewContext(parent context.Context, s Span) context.Context { span, ok := s.(openTracingSpan) if !ok { return nil } return opentracing.ContextWithSpan(parent, span.otSpan) }
[ "func", "(", "jf", "openTracingService", ")", "NewContext", "(", "parent", "context", ".", "Context", ",", "s", "Span", ")", "context", ".", "Context", "{", "span", ",", "ok", ":=", "s", ".", "(", "openTracingSpan", ")", "\n", "if", "!", "ok", "{", "...
// NewContext is part of an interface implementation
[ "NewContext", "is", "part", "of", "an", "interface", "implementation" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/trace/opentracing.go#L89-L95
135,037
vitessio/vitess
go/vt/topo/server.go
RegisterFactory
func RegisterFactory(name string, factory Factory) { if factories[name] != nil { log.Fatalf("Duplicate topo.Factory registration for %v", name) } factories[name] = factory }
go
func RegisterFactory(name string, factory Factory) { if factories[name] != nil { log.Fatalf("Duplicate topo.Factory registration for %v", name) } factories[name] = factory }
[ "func", "RegisterFactory", "(", "name", "string", ",", "factory", "Factory", ")", "{", "if", "factories", "[", "name", "]", "!=", "nil", "{", "log", ".", "Fatalf", "(", "\"", "\"", ",", "name", ")", "\n", "}", "\n", "factories", "[", "name", "]", "...
// RegisterFactory registers a Factory for an implementation for a Server. // If an implementation with that name already exists, it log.Fatals out. // Call this in the 'init' function in your topology implementation module.
[ "RegisterFactory", "registers", "a", "Factory", "for", "an", "implementation", "for", "a", "Server", ".", "If", "an", "implementation", "with", "that", "name", "already", "exists", "it", "log", ".", "Fatals", "out", ".", "Call", "this", "in", "the", "init", ...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/server.go#L169-L174
135,038
vitessio/vitess
go/vt/topo/server.go
NewWithFactory
func NewWithFactory(factory Factory, serverAddress, root string) (*Server, error) { conn, err := factory.Create(GlobalCell, serverAddress, root) if err != nil { return nil, err } conn = NewStatsConn(GlobalCell, conn) var connReadOnly Conn if factory.HasGlobalReadOnlyCell(serverAddress, root) { connReadOnly, ...
go
func NewWithFactory(factory Factory, serverAddress, root string) (*Server, error) { conn, err := factory.Create(GlobalCell, serverAddress, root) if err != nil { return nil, err } conn = NewStatsConn(GlobalCell, conn) var connReadOnly Conn if factory.HasGlobalReadOnlyCell(serverAddress, root) { connReadOnly, ...
[ "func", "NewWithFactory", "(", "factory", "Factory", ",", "serverAddress", ",", "root", "string", ")", "(", "*", "Server", ",", "error", ")", "{", "conn", ",", "err", ":=", "factory", ".", "Create", "(", "GlobalCell", ",", "serverAddress", ",", "root", "...
// NewWithFactory creates a new Server based on the given Factory. // It also opens the global cell connection.
[ "NewWithFactory", "creates", "a", "new", "Server", "based", "on", "the", "given", "Factory", ".", "It", "also", "opens", "the", "global", "cell", "connection", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/server.go#L178-L202
135,039
vitessio/vitess
go/vt/topo/server.go
OpenServer
func OpenServer(implementation, serverAddress, root string) (*Server, error) { factory, ok := factories[implementation] if !ok { return nil, NewError(NoImplementation, implementation) } return NewWithFactory(factory, serverAddress, root) }
go
func OpenServer(implementation, serverAddress, root string) (*Server, error) { factory, ok := factories[implementation] if !ok { return nil, NewError(NoImplementation, implementation) } return NewWithFactory(factory, serverAddress, root) }
[ "func", "OpenServer", "(", "implementation", ",", "serverAddress", ",", "root", "string", ")", "(", "*", "Server", ",", "error", ")", "{", "factory", ",", "ok", ":=", "factories", "[", "implementation", "]", "\n", "if", "!", "ok", "{", "return", "nil", ...
// OpenServer returns a Server using the provided implementation, // address and root for the global server.
[ "OpenServer", "returns", "a", "Server", "using", "the", "provided", "implementation", "address", "and", "root", "for", "the", "global", "server", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/server.go#L206-L212
135,040
vitessio/vitess
go/vt/topo/server.go
Open
func Open() *Server { if *topoGlobalServerAddress == "" { log.Exitf("topo_global_server_address must be configured") } ts, err := OpenServer(*topoImplementation, *topoGlobalServerAddress, *topoGlobalRoot) if err != nil { log.Exitf("Failed to open topo server (%v,%v,%v): %v", *topoImplementation, *topoGlobalServ...
go
func Open() *Server { if *topoGlobalServerAddress == "" { log.Exitf("topo_global_server_address must be configured") } ts, err := OpenServer(*topoImplementation, *topoGlobalServerAddress, *topoGlobalRoot) if err != nil { log.Exitf("Failed to open topo server (%v,%v,%v): %v", *topoImplementation, *topoGlobalServ...
[ "func", "Open", "(", ")", "*", "Server", "{", "if", "*", "topoGlobalServerAddress", "==", "\"", "\"", "{", "log", ".", "Exitf", "(", "\"", "\"", ")", "\n", "}", "\n", "ts", ",", "err", ":=", "OpenServer", "(", "*", "topoImplementation", ",", "*", "...
// Open returns a Server using the command line parameter flags // for implementation, address and root. It log.Exits out if an error occurs.
[ "Open", "returns", "a", "Server", "using", "the", "command", "line", "parameter", "flags", "for", "implementation", "address", "and", "root", ".", "It", "log", ".", "Exits", "out", "if", "an", "error", "occurs", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/server.go#L216-L225
135,041
vitessio/vitess
go/vt/topo/server.go
ConnForCell
func (ts *Server) ConnForCell(ctx context.Context, cell string) (Conn, error) { // Global cell is the easy case. if cell == GlobalCell { return ts.globalCell, nil } // Return a cached client if present. ts.mu.Lock() conn, ok := ts.cells[cell] ts.mu.Unlock() if ok { return conn, nil } // Fetch cell clust...
go
func (ts *Server) ConnForCell(ctx context.Context, cell string) (Conn, error) { // Global cell is the easy case. if cell == GlobalCell { return ts.globalCell, nil } // Return a cached client if present. ts.mu.Lock() conn, ok := ts.cells[cell] ts.mu.Unlock() if ok { return conn, nil } // Fetch cell clust...
[ "func", "(", "ts", "*", "Server", ")", "ConnForCell", "(", "ctx", "context", ".", "Context", ",", "cell", "string", ")", "(", "Conn", ",", "error", ")", "{", "// Global cell is the easy case.", "if", "cell", "==", "GlobalCell", "{", "return", "ts", ".", ...
// ConnForCell returns a Conn object for the given cell. // It caches Conn objects from previously requested cells.
[ "ConnForCell", "returns", "a", "Conn", "object", "for", "the", "given", "cell", ".", "It", "caches", "Conn", "objects", "from", "previously", "requested", "cells", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/server.go#L229-L275
135,042
vitessio/vitess
go/vt/topo/server.go
GetAliasByCell
func GetAliasByCell(ctx context.Context, ts *Server, cell string) string { cellsAliases.mu.Lock() defer cellsAliases.mu.Unlock() if region, ok := cellsAliases.cellsToAliases[cell]; ok { return region } if ts != nil { // lazily get the region from cell info if `aliases` are available cellAliases, err := ts.Ge...
go
func GetAliasByCell(ctx context.Context, ts *Server, cell string) string { cellsAliases.mu.Lock() defer cellsAliases.mu.Unlock() if region, ok := cellsAliases.cellsToAliases[cell]; ok { return region } if ts != nil { // lazily get the region from cell info if `aliases` are available cellAliases, err := ts.Ge...
[ "func", "GetAliasByCell", "(", "ctx", "context", ".", "Context", ",", "ts", "*", "Server", ",", "cell", "string", ")", "string", "{", "cellsAliases", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "cellsAliases", ".", "mu", ".", "Unlock", "(", ")", ...
// GetAliasByCell returns the alias group this `cell` belongs to, if there's none, it returns the `cell` as alias.
[ "GetAliasByCell", "returns", "the", "alias", "group", "this", "cell", "belongs", "to", "if", "there", "s", "none", "it", "returns", "the", "cell", "as", "alias", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/server.go#L278-L303
135,043
vitessio/vitess
go/vt/topo/server.go
Close
func (ts *Server) Close() { ts.globalCell.Close() if ts.globalReadOnlyCell != ts.globalCell { ts.globalReadOnlyCell.Close() } ts.globalCell = nil ts.globalReadOnlyCell = nil ts.mu.Lock() defer ts.mu.Unlock() for _, conn := range ts.cells { conn.Close() } ts.cells = make(map[string]Conn) }
go
func (ts *Server) Close() { ts.globalCell.Close() if ts.globalReadOnlyCell != ts.globalCell { ts.globalReadOnlyCell.Close() } ts.globalCell = nil ts.globalReadOnlyCell = nil ts.mu.Lock() defer ts.mu.Unlock() for _, conn := range ts.cells { conn.Close() } ts.cells = make(map[string]Conn) }
[ "func", "(", "ts", "*", "Server", ")", "Close", "(", ")", "{", "ts", ".", "globalCell", ".", "Close", "(", ")", "\n", "if", "ts", ".", "globalReadOnlyCell", "!=", "ts", ".", "globalCell", "{", "ts", ".", "globalReadOnlyCell", ".", "Close", "(", ")", ...
// Close will close all connections to underlying topo Server. // It will nil all member variables, so any further access will panic.
[ "Close", "will", "close", "all", "connections", "to", "underlying", "topo", "Server", ".", "It", "will", "nil", "all", "member", "variables", "so", "any", "further", "access", "will", "panic", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/server.go#L307-L320
135,044
vitessio/vitess
go/vt/vttablet/tabletserver/planbuilder/permission.go
BuildPermissions
func BuildPermissions(stmt sqlparser.Statement) []Permission { var permissions []Permission // All Statement types myst be covered here. switch node := stmt.(type) { case *sqlparser.Union, *sqlparser.Select: permissions = buildSubqueryPermissions(node, tableacl.READER, permissions) case *sqlparser.Insert: perm...
go
func BuildPermissions(stmt sqlparser.Statement) []Permission { var permissions []Permission // All Statement types myst be covered here. switch node := stmt.(type) { case *sqlparser.Union, *sqlparser.Select: permissions = buildSubqueryPermissions(node, tableacl.READER, permissions) case *sqlparser.Insert: perm...
[ "func", "BuildPermissions", "(", "stmt", "sqlparser", ".", "Statement", ")", "[", "]", "Permission", "{", "var", "permissions", "[", "]", "Permission", "\n", "// All Statement types myst be covered here.", "switch", "node", ":=", "stmt", ".", "(", "type", ")", "...
// BuildPermissions builds the list of required permissions for all the // tables referenced in a query.
[ "BuildPermissions", "builds", "the", "list", "of", "required", "permissions", "for", "all", "the", "tables", "referenced", "in", "a", "query", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/planbuilder/permission.go#L35-L64
135,045
vitessio/vitess
go/sqltypes/plan_value.go
IsNull
func (pv PlanValue) IsNull() bool { return pv.Key == "" && pv.Value.IsNull() && pv.ListKey == "" && pv.Values == nil }
go
func (pv PlanValue) IsNull() bool { return pv.Key == "" && pv.Value.IsNull() && pv.ListKey == "" && pv.Values == nil }
[ "func", "(", "pv", "PlanValue", ")", "IsNull", "(", ")", "bool", "{", "return", "pv", ".", "Key", "==", "\"", "\"", "&&", "pv", ".", "Value", ".", "IsNull", "(", ")", "&&", "pv", ".", "ListKey", "==", "\"", "\"", "&&", "pv", ".", "Values", "=="...
// IsNull returns true if the PlanValue is NULL.
[ "IsNull", "returns", "true", "if", "the", "PlanValue", "is", "NULL", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqltypes/plan_value.go#L67-L69
135,046
vitessio/vitess
go/sqltypes/plan_value.go
ResolveList
func (pv PlanValue) ResolveList(bindVars map[string]*querypb.BindVariable) ([]Value, error) { switch { case pv.ListKey != "": bv, err := pv.lookupList(bindVars) if err != nil { return nil, err } values := make([]Value, 0, len(bv.Values)) for _, val := range bv.Values { values = append(values, MakeTrus...
go
func (pv PlanValue) ResolveList(bindVars map[string]*querypb.BindVariable) ([]Value, error) { switch { case pv.ListKey != "": bv, err := pv.lookupList(bindVars) if err != nil { return nil, err } values := make([]Value, 0, len(bv.Values)) for _, val := range bv.Values { values = append(values, MakeTrus...
[ "func", "(", "pv", "PlanValue", ")", "ResolveList", "(", "bindVars", "map", "[", "string", "]", "*", "querypb", ".", "BindVariable", ")", "(", "[", "]", "Value", ",", "error", ")", "{", "switch", "{", "case", "pv", ".", "ListKey", "!=", "\"", "\"", ...
// ResolveList resolves a PlanValue as a list of values based on the supplied bindvars.
[ "ResolveList", "resolves", "a", "PlanValue", "as", "a", "list", "of", "values", "based", "on", "the", "supplied", "bindvars", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqltypes/plan_value.go#L107-L133
135,047
vitessio/vitess
go/sqltypes/plan_value.go
MarshalJSON
func (pv PlanValue) MarshalJSON() ([]byte, error) { switch { case pv.Key != "": return json.Marshal(":" + pv.Key) case !pv.Value.IsNull(): if pv.Value.IsIntegral() { return pv.Value.ToBytes(), nil } return json.Marshal(pv.Value.ToString()) case pv.ListKey != "": return json.Marshal("::" + pv.ListKey) ...
go
func (pv PlanValue) MarshalJSON() ([]byte, error) { switch { case pv.Key != "": return json.Marshal(":" + pv.Key) case !pv.Value.IsNull(): if pv.Value.IsIntegral() { return pv.Value.ToBytes(), nil } return json.Marshal(pv.Value.ToString()) case pv.ListKey != "": return json.Marshal("::" + pv.ListKey) ...
[ "func", "(", "pv", "PlanValue", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "switch", "{", "case", "pv", ".", "Key", "!=", "\"", "\"", ":", "return", "json", ".", "Marshal", "(", "\"", "\"", "+", "pv", ".", "Key...
// MarshalJSON should be used only for testing.
[ "MarshalJSON", "should", "be", "used", "only", "for", "testing", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqltypes/plan_value.go#L147-L162
135,048
vitessio/vitess
go/vt/discovery/healthcheck.go
ParseTabletURLTemplateFromFlag
func ParseTabletURLTemplateFromFlag() { tabletURLTemplate = template.New("") _, err := tabletURLTemplate.Parse(*tabletURLTemplateString) if err != nil { log.Exitf("error parsing template: %v", err) } }
go
func ParseTabletURLTemplateFromFlag() { tabletURLTemplate = template.New("") _, err := tabletURLTemplate.Parse(*tabletURLTemplateString) if err != nil { log.Exitf("error parsing template: %v", err) } }
[ "func", "ParseTabletURLTemplateFromFlag", "(", ")", "{", "tabletURLTemplate", "=", "template", ".", "New", "(", "\"", "\"", ")", "\n", "_", ",", "err", ":=", "tabletURLTemplate", ".", "Parse", "(", "*", "tabletURLTemplateString", ")", "\n", "if", "err", "!="...
// ParseTabletURLTemplateFromFlag loads or reloads the URL template.
[ "ParseTabletURLTemplateFromFlag", "loads", "or", "reloads", "the", "URL", "template", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L128-L134
135,049
vitessio/vitess
go/vt/discovery/healthcheck.go
DeepEqual
func (e *TabletStats) DeepEqual(f *TabletStats) bool { return e.Key == f.Key && proto.Equal(e.Tablet, f.Tablet) && e.Name == f.Name && proto.Equal(e.Target, f.Target) && e.Up == f.Up && e.Serving == f.Serving && e.TabletExternallyReparentedTimestamp == f.TabletExternallyReparentedTimestamp && proto.Equal...
go
func (e *TabletStats) DeepEqual(f *TabletStats) bool { return e.Key == f.Key && proto.Equal(e.Tablet, f.Tablet) && e.Name == f.Name && proto.Equal(e.Target, f.Target) && e.Up == f.Up && e.Serving == f.Serving && e.TabletExternallyReparentedTimestamp == f.TabletExternallyReparentedTimestamp && proto.Equal...
[ "func", "(", "e", "*", "TabletStats", ")", "DeepEqual", "(", "f", "*", "TabletStats", ")", "bool", "{", "return", "e", ".", "Key", "==", "f", ".", "Key", "&&", "proto", ".", "Equal", "(", "e", ".", "Tablet", ",", "f", ".", "Tablet", ")", "&&", ...
// DeepEqual compares two TabletStats. Since we include protos, we // need to use proto.Equal on these.
[ "DeepEqual", "compares", "two", "TabletStats", ".", "Since", "we", "include", "protos", "we", "need", "to", "use", "proto", ".", "Equal", "on", "these", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L193-L204
135,050
vitessio/vitess
go/vt/discovery/healthcheck.go
GetTabletHostPort
func (e TabletStats) GetTabletHostPort() string { vtPort := e.Tablet.PortMap["vt"] return netutil.JoinHostPort(e.Tablet.Hostname, vtPort) }
go
func (e TabletStats) GetTabletHostPort() string { vtPort := e.Tablet.PortMap["vt"] return netutil.JoinHostPort(e.Tablet.Hostname, vtPort) }
[ "func", "(", "e", "TabletStats", ")", "GetTabletHostPort", "(", ")", "string", "{", "vtPort", ":=", "e", ".", "Tablet", ".", "PortMap", "[", "\"", "\"", "]", "\n", "return", "netutil", ".", "JoinHostPort", "(", "e", ".", "Tablet", ".", "Hostname", ",",...
// GetTabletHostPort formats a tablet host port address.
[ "GetTabletHostPort", "formats", "a", "tablet", "host", "port", "address", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L213-L216
135,051
vitessio/vitess
go/vt/discovery/healthcheck.go
GetHostNameLevel
func (e TabletStats) GetHostNameLevel(level int) string { chunkedHostname := strings.Split(e.Tablet.Hostname, ".") if level < 0 { return chunkedHostname[0] } else if level >= len(chunkedHostname) { return chunkedHostname[len(chunkedHostname)-1] } else { return chunkedHostname[level] } }
go
func (e TabletStats) GetHostNameLevel(level int) string { chunkedHostname := strings.Split(e.Tablet.Hostname, ".") if level < 0 { return chunkedHostname[0] } else if level >= len(chunkedHostname) { return chunkedHostname[len(chunkedHostname)-1] } else { return chunkedHostname[level] } }
[ "func", "(", "e", "TabletStats", ")", "GetHostNameLevel", "(", "level", "int", ")", "string", "{", "chunkedHostname", ":=", "strings", ".", "Split", "(", "e", ".", "Tablet", ".", "Hostname", ",", "\"", "\"", ")", "\n\n", "if", "level", "<", "0", "{", ...
// GetHostNameLevel returns the specified hostname level. If the level does not exist it will pick the closest level. // This seems unused but can be utilized by certain url formatting templates. See getTabletDebugURL for more details.
[ "GetHostNameLevel", "returns", "the", "specified", "hostname", "level", ".", "If", "the", "level", "does", "not", "exist", "it", "will", "pick", "the", "closest", "level", ".", "This", "seems", "unused", "but", "can", "be", "utilized", "by", "certain", "url"...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L220-L230
135,052
vitessio/vitess
go/vt/discovery/healthcheck.go
RegisterStats
func (hc *HealthCheckImpl) RegisterStats() { stats.NewGaugesFuncWithMultiLabels( "HealthcheckConnections", "the number of healthcheck connections registered", []string{"Keyspace", "ShardName", "TabletType"}, hc.servingConnStats) stats.NewGaugeFunc( "HealthcheckChecksum", "crc32 checksum of the current he...
go
func (hc *HealthCheckImpl) RegisterStats() { stats.NewGaugesFuncWithMultiLabels( "HealthcheckConnections", "the number of healthcheck connections registered", []string{"Keyspace", "ShardName", "TabletType"}, hc.servingConnStats) stats.NewGaugeFunc( "HealthcheckChecksum", "crc32 checksum of the current he...
[ "func", "(", "hc", "*", "HealthCheckImpl", ")", "RegisterStats", "(", ")", "{", "stats", ".", "NewGaugesFuncWithMultiLabels", "(", "\"", "\"", ",", "\"", "\"", ",", "[", "]", "string", "{", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", "}", ",", "h...
// RegisterStats registers the connection counts stats
[ "RegisterStats", "registers", "the", "connection", "counts", "stats" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L378-L389
135,053
vitessio/vitess
go/vt/discovery/healthcheck.go
ServeHTTP
func (hc *HealthCheckImpl) ServeHTTP(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") status := hc.cacheStatusMap() b, err := json.MarshalIndent(status, "", " ") if err != nil { w.Write([]byte(err.Error())) return } buf := bytes.NewBuffer(nil) json....
go
func (hc *HealthCheckImpl) ServeHTTP(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json; charset=utf-8") status := hc.cacheStatusMap() b, err := json.MarshalIndent(status, "", " ") if err != nil { w.Write([]byte(err.Error())) return } buf := bytes.NewBuffer(nil) json....
[ "func", "(", "hc", "*", "HealthCheckImpl", ")", "ServeHTTP", "(", "w", "http", ".", "ResponseWriter", ",", "_", "*", "http", ".", "Request", ")", "{", "w", ".", "Header", "(", ")", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "status"...
// ServeHTTP is part of the http.Handler interface. It renders the current state of the discovery gateway tablet cache into json.
[ "ServeHTTP", "is", "part", "of", "the", "http", ".", "Handler", "interface", ".", "It", "renders", "the", "current", "state", "of", "the", "discovery", "gateway", "tablet", "cache", "into", "json", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L392-L404
135,054
vitessio/vitess
go/vt/discovery/healthcheck.go
stateChecksum
func (hc *HealthCheckImpl) stateChecksum() int64 { // CacheStatus is sorted so this should be stable across vtgates cacheStatus := hc.CacheStatus() var buf bytes.Buffer for _, st := range cacheStatus { fmt.Fprintf(&buf, "%v%v%v%v\n", st.Cell, st.Target.Keyspace, st.Target.Shard, st.Target.TabletTyp...
go
func (hc *HealthCheckImpl) stateChecksum() int64 { // CacheStatus is sorted so this should be stable across vtgates cacheStatus := hc.CacheStatus() var buf bytes.Buffer for _, st := range cacheStatus { fmt.Fprintf(&buf, "%v%v%v%v\n", st.Cell, st.Target.Keyspace, st.Target.Shard, st.Target.TabletTyp...
[ "func", "(", "hc", "*", "HealthCheckImpl", ")", "stateChecksum", "(", ")", "int64", "{", "// CacheStatus is sorted so this should be stable across vtgates", "cacheStatus", ":=", "hc", ".", "CacheStatus", "(", ")", "\n", "var", "buf", "bytes", ".", "Buffer", "\n", ...
// stateChecksum returns a crc32 checksum of the healthcheck state
[ "stateChecksum", "returns", "a", "crc32", "checksum", "of", "the", "healthcheck", "state" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L422-L441
135,055
vitessio/vitess
go/vt/discovery/healthcheck.go
updateHealth
func (hc *HealthCheckImpl) updateHealth(ts *TabletStats, conn queryservice.QueryService) { // Unconditionally send the received update at the end. defer func() { if hc.listener != nil { hc.listener.StatsUpdate(ts) } }() hc.mu.Lock() th, ok := hc.addrToHealth[ts.Key] if !ok { // This can happen on delete...
go
func (hc *HealthCheckImpl) updateHealth(ts *TabletStats, conn queryservice.QueryService) { // Unconditionally send the received update at the end. defer func() { if hc.listener != nil { hc.listener.StatsUpdate(ts) } }() hc.mu.Lock() th, ok := hc.addrToHealth[ts.Key] if !ok { // This can happen on delete...
[ "func", "(", "hc", "*", "HealthCheckImpl", ")", "updateHealth", "(", "ts", "*", "TabletStats", ",", "conn", "queryservice", ".", "QueryService", ")", "{", "// Unconditionally send the received update at the end.", "defer", "func", "(", ")", "{", "if", "hc", ".", ...
// updateHealth updates the tabletHealth record and transmits the tablet stats // to the listener.
[ "updateHealth", "updates", "the", "tabletHealth", "record", "and", "transmits", "the", "tablet", "stats", "to", "the", "listener", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L445-L483
135,056
vitessio/vitess
go/vt/discovery/healthcheck.go
checkConn
func (hc *HealthCheckImpl) checkConn(hcc *healthCheckConn, name string) { defer hc.connsWG.Done() defer hc.finalizeConn(hcc) // Initial notification for downstream about the tablet existence. hc.updateHealth(hcc.tabletStats.Copy(), hcc.conn) hc.initialUpdatesWG.Done() retryDelay := hc.retryDelay for { stream...
go
func (hc *HealthCheckImpl) checkConn(hcc *healthCheckConn, name string) { defer hc.connsWG.Done() defer hc.finalizeConn(hcc) // Initial notification for downstream about the tablet existence. hc.updateHealth(hcc.tabletStats.Copy(), hcc.conn) hc.initialUpdatesWG.Done() retryDelay := hc.retryDelay for { stream...
[ "func", "(", "hc", "*", "HealthCheckImpl", ")", "checkConn", "(", "hcc", "*", "healthCheckConn", ",", "name", "string", ")", "{", "defer", "hc", ".", "connsWG", ".", "Done", "(", ")", "\n", "defer", "hc", ".", "finalizeConn", "(", "hcc", ")", "\n\n", ...
// checkConn performs health checking on the given tablet.
[ "checkConn", "performs", "health", "checking", "on", "the", "given", "tablet", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L506-L583
135,057
vitessio/vitess
go/vt/discovery/healthcheck.go
setServingState
func (hcc *healthCheckConn) setServingState(serving bool, reason string) { if !hcc.loggedServingState || (serving != hcc.tabletStats.Serving) { // Emit the log from a separate goroutine to avoid holding // the hcc lock while logging is happening go log.Infof("HealthCheckUpdate(Serving State): %v, tablet: %v serv...
go
func (hcc *healthCheckConn) setServingState(serving bool, reason string) { if !hcc.loggedServingState || (serving != hcc.tabletStats.Serving) { // Emit the log from a separate goroutine to avoid holding // the hcc lock while logging is happening go log.Infof("HealthCheckUpdate(Serving State): %v, tablet: %v serv...
[ "func", "(", "hcc", "*", "healthCheckConn", ")", "setServingState", "(", "serving", "bool", ",", "reason", "string", ")", "{", "if", "!", "hcc", ".", "loggedServingState", "||", "(", "serving", "!=", "hcc", ".", "tabletStats", ".", "Serving", ")", "{", "...
// setServingState sets the tablet state to the given value. // // If the state changes, it logs the change so that failures // from the health check connection are logged the first time, // but don't continue to log if the connection stays down. // // hcc.mu must be locked before calling this function
[ "setServingState", "sets", "the", "tablet", "state", "to", "the", "given", "value", ".", "If", "the", "state", "changes", "it", "logs", "the", "change", "so", "that", "failures", "from", "the", "health", "check", "connection", "are", "logged", "the", "first"...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L592-L609
135,058
vitessio/vitess
go/vt/discovery/healthcheck.go
stream
func (hcc *healthCheckConn) stream(ctx context.Context, hc *HealthCheckImpl, callback func(*querypb.StreamHealthResponse) error) { if hcc.conn == nil { conn, err := tabletconn.GetDialer()(hcc.tabletStats.Tablet, grpcclient.FailFast(true)) if err != nil { hcc.tabletStats.LastError = err return } hcc.conn ...
go
func (hcc *healthCheckConn) stream(ctx context.Context, hc *HealthCheckImpl, callback func(*querypb.StreamHealthResponse) error) { if hcc.conn == nil { conn, err := tabletconn.GetDialer()(hcc.tabletStats.Tablet, grpcclient.FailFast(true)) if err != nil { hcc.tabletStats.LastError = err return } hcc.conn ...
[ "func", "(", "hcc", "*", "healthCheckConn", ")", "stream", "(", "ctx", "context", ".", "Context", ",", "hc", "*", "HealthCheckImpl", ",", "callback", "func", "(", "*", "querypb", ".", "StreamHealthResponse", ")", "error", ")", "{", "if", "hcc", ".", "con...
// stream streams healthcheck responses to callback.
[ "stream", "streams", "healthcheck", "responses", "to", "callback", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L612-L631
135,059
vitessio/vitess
go/vt/discovery/healthcheck.go
processResponse
func (hcc *healthCheckConn) processResponse(hc *HealthCheckImpl, shr *querypb.StreamHealthResponse) error { select { case <-hcc.ctx.Done(): return hcc.ctx.Err() default: } // Check for invalid data, better than panicking. if shr.Target == nil || shr.RealtimeStats == nil { return fmt.Errorf("health stats is n...
go
func (hcc *healthCheckConn) processResponse(hc *HealthCheckImpl, shr *querypb.StreamHealthResponse) error { select { case <-hcc.ctx.Done(): return hcc.ctx.Err() default: } // Check for invalid data, better than panicking. if shr.Target == nil || shr.RealtimeStats == nil { return fmt.Errorf("health stats is n...
[ "func", "(", "hcc", "*", "healthCheckConn", ")", "processResponse", "(", "hc", "*", "HealthCheckImpl", ",", "shr", "*", "querypb", ".", "StreamHealthResponse", ")", "error", "{", "select", "{", "case", "<-", "hcc", ".", "ctx", ".", "Done", "(", ")", ":",...
// processResponse reads one health check response, and notifies HealthCheckStatsListener.
[ "processResponse", "reads", "one", "health", "check", "response", "and", "notifies", "HealthCheckStatsListener", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L634-L680
135,060
vitessio/vitess
go/vt/discovery/healthcheck.go
ReplaceTablet
func (hc *HealthCheckImpl) ReplaceTablet(old, new *topodatapb.Tablet, name string) { go func() { hc.deleteConn(old) hc.AddTablet(new, name) }() }
go
func (hc *HealthCheckImpl) ReplaceTablet(old, new *topodatapb.Tablet, name string) { go func() { hc.deleteConn(old) hc.AddTablet(new, name) }() }
[ "func", "(", "hc", "*", "HealthCheckImpl", ")", "ReplaceTablet", "(", "old", ",", "new", "*", "topodatapb", ".", "Tablet", ",", "name", "string", ")", "{", "go", "func", "(", ")", "{", "hc", ".", "deleteConn", "(", "old", ")", "\n", "hc", ".", "Add...
// ReplaceTablet removes the old tablet and adds the new tablet.
[ "ReplaceTablet", "removes", "the", "old", "tablet", "and", "adds", "the", "new", "tablet", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L759-L764
135,061
vitessio/vitess
go/vt/discovery/healthcheck.go
StatusAsHTML
func (tcs *TabletsCacheStatus) StatusAsHTML() template.HTML { tLinks := make([]string, 0, 1) if tcs.TabletsStats != nil { sort.Sort(tcs.TabletsStats) } for _, ts := range tcs.TabletsStats { color := "green" extra := "" if ts.LastError != nil { color = "red" extra = fmt.Sprintf(" (%v)", ts.LastError) ...
go
func (tcs *TabletsCacheStatus) StatusAsHTML() template.HTML { tLinks := make([]string, 0, 1) if tcs.TabletsStats != nil { sort.Sort(tcs.TabletsStats) } for _, ts := range tcs.TabletsStats { color := "green" extra := "" if ts.LastError != nil { color = "red" extra = fmt.Sprintf(" (%v)", ts.LastError) ...
[ "func", "(", "tcs", "*", "TabletsCacheStatus", ")", "StatusAsHTML", "(", ")", "template", ".", "HTML", "{", "tLinks", ":=", "make", "(", "[", "]", "string", ",", "0", ",", "1", ")", "\n", "if", "tcs", ".", "TabletsStats", "!=", "nil", "{", "sort", ...
// StatusAsHTML returns an HTML version of the status.
[ "StatusAsHTML", "returns", "an", "HTML", "version", "of", "the", "status", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L818-L847
135,062
vitessio/vitess
go/vt/discovery/healthcheck.go
CacheStatus
func (hc *HealthCheckImpl) CacheStatus() TabletsCacheStatusList { tcsMap := hc.cacheStatusMap() tcsl := make(TabletsCacheStatusList, 0, len(tcsMap)) for _, tcs := range tcsMap { tcsl = append(tcsl, tcs) } sort.Sort(tcsl) return tcsl }
go
func (hc *HealthCheckImpl) CacheStatus() TabletsCacheStatusList { tcsMap := hc.cacheStatusMap() tcsl := make(TabletsCacheStatusList, 0, len(tcsMap)) for _, tcs := range tcsMap { tcsl = append(tcsl, tcs) } sort.Sort(tcsl) return tcsl }
[ "func", "(", "hc", "*", "HealthCheckImpl", ")", "CacheStatus", "(", ")", "TabletsCacheStatusList", "{", "tcsMap", ":=", "hc", ".", "cacheStatusMap", "(", ")", "\n", "tcsl", ":=", "make", "(", "TabletsCacheStatusList", ",", "0", ",", "len", "(", "tcsMap", "...
// CacheStatus returns a displayable version of the cache.
[ "CacheStatus", "returns", "a", "displayable", "version", "of", "the", "cache", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L869-L877
135,063
vitessio/vitess
go/vt/discovery/healthcheck.go
TabletToMapKey
func TabletToMapKey(tablet *topodatapb.Tablet) string { parts := make([]string, 0, 1) for name, port := range tablet.PortMap { parts = append(parts, netutil.JoinHostPort(name, port)) } sort.Strings(parts) parts = append([]string{tablet.Hostname}, parts...) return strings.Join(parts, ",") }
go
func TabletToMapKey(tablet *topodatapb.Tablet) string { parts := make([]string, 0, 1) for name, port := range tablet.PortMap { parts = append(parts, netutil.JoinHostPort(name, port)) } sort.Strings(parts) parts = append([]string{tablet.Hostname}, parts...) return strings.Join(parts, ",") }
[ "func", "TabletToMapKey", "(", "tablet", "*", "topodatapb", ".", "Tablet", ")", "string", "{", "parts", ":=", "make", "(", "[", "]", "string", ",", "0", ",", "1", ")", "\n", "for", "name", ",", "port", ":=", "range", "tablet", ".", "PortMap", "{", ...
// TabletToMapKey creates a key to the map from tablet's host and ports. // It should only be used in discovery and related module.
[ "TabletToMapKey", "creates", "a", "key", "to", "the", "map", "from", "tablet", "s", "host", "and", "ports", ".", "It", "should", "only", "be", "used", "in", "discovery", "and", "related", "module", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/discovery/healthcheck.go#L922-L930
135,064
vitessio/vitess
go/vt/vterrors/grpc.go
CodeToLegacyErrorCode
func CodeToLegacyErrorCode(code vtrpcpb.Code) vtrpcpb.LegacyErrorCode { switch code { case vtrpcpb.Code_OK: return vtrpcpb.LegacyErrorCode_SUCCESS_LEGACY case vtrpcpb.Code_CANCELED: return vtrpcpb.LegacyErrorCode_CANCELLED_LEGACY case vtrpcpb.Code_UNKNOWN: return vtrpcpb.LegacyErrorCode_UNKNOWN_ERROR_LEGACY ...
go
func CodeToLegacyErrorCode(code vtrpcpb.Code) vtrpcpb.LegacyErrorCode { switch code { case vtrpcpb.Code_OK: return vtrpcpb.LegacyErrorCode_SUCCESS_LEGACY case vtrpcpb.Code_CANCELED: return vtrpcpb.LegacyErrorCode_CANCELLED_LEGACY case vtrpcpb.Code_UNKNOWN: return vtrpcpb.LegacyErrorCode_UNKNOWN_ERROR_LEGACY ...
[ "func", "CodeToLegacyErrorCode", "(", "code", "vtrpcpb", ".", "Code", ")", "vtrpcpb", ".", "LegacyErrorCode", "{", "switch", "code", "{", "case", "vtrpcpb", ".", "Code_OK", ":", "return", "vtrpcpb", ".", "LegacyErrorCode_SUCCESS_LEGACY", "\n", "case", "vtrpcpb", ...
// This file contains functions to convert errors to and from gRPC codes. // Use these methods to return an error through gRPC and still // retain its code. // CodeToLegacyErrorCode maps a vtrpcpb.Code to a vtrpcpb.LegacyErrorCode.
[ "This", "file", "contains", "functions", "to", "convert", "errors", "to", "and", "from", "gRPC", "codes", ".", "Use", "these", "methods", "to", "return", "an", "error", "through", "gRPC", "and", "still", "retain", "its", "code", ".", "CodeToLegacyErrorCode", ...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vterrors/grpc.go#L34-L66
135,065
vitessio/vitess
go/vt/vterrors/grpc.go
truncateError
func truncateError(err error) string { // For more details see: https://github.com/grpc/grpc-go/issues/443 // The gRPC spec says "Clients may limit the size of Response-Headers, // Trailers, and Trailers-Only, with a default of 8 KiB each suggested." // Therefore, we assume 8 KiB minus some headroom. GRPCErrorLimi...
go
func truncateError(err error) string { // For more details see: https://github.com/grpc/grpc-go/issues/443 // The gRPC spec says "Clients may limit the size of Response-Headers, // Trailers, and Trailers-Only, with a default of 8 KiB each suggested." // Therefore, we assume 8 KiB minus some headroom. GRPCErrorLimi...
[ "func", "truncateError", "(", "err", "error", ")", "string", "{", "// For more details see: https://github.com/grpc/grpc-go/issues/443", "// The gRPC spec says \"Clients may limit the size of Response-Headers,", "// Trailers, and Trailers-Only, with a default of 8 KiB each suggested.\"", "// T...
// truncateError shortens errors because gRPC has a size restriction on them.
[ "truncateError", "shortens", "errors", "because", "gRPC", "has", "a", "size", "restriction", "on", "them", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vterrors/grpc.go#L104-L116
135,066
vitessio/vitess
go/vt/vterrors/grpc.go
ToGRPC
func ToGRPC(err error) error { if err == nil { return nil } return status.Errorf(codes.Code(Code(err)), "%v", truncateError(err)) }
go
func ToGRPC(err error) error { if err == nil { return nil } return status.Errorf(codes.Code(Code(err)), "%v", truncateError(err)) }
[ "func", "ToGRPC", "(", "err", "error", ")", "error", "{", "if", "err", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "status", ".", "Errorf", "(", "codes", ".", "Code", "(", "Code", "(", "err", ")", ")", ",", "\"", "\"", ",", "t...
// ToGRPC returns an error as a gRPC error, with the appropriate error code.
[ "ToGRPC", "returns", "an", "error", "as", "a", "gRPC", "error", "with", "the", "appropriate", "error", "code", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vterrors/grpc.go#L119-L124
135,067
vitessio/vitess
go/vt/vterrors/grpc.go
FromGRPC
func FromGRPC(err error) error { if err == nil { return nil } if err == io.EOF { // Do not wrap io.EOF because we compare against it for finished streams. return err } code := codes.Unknown if s, ok := status.FromError(err); ok { code = s.Code() } return New(vtrpcpb.Code(code), err.Error()) }
go
func FromGRPC(err error) error { if err == nil { return nil } if err == io.EOF { // Do not wrap io.EOF because we compare against it for finished streams. return err } code := codes.Unknown if s, ok := status.FromError(err); ok { code = s.Code() } return New(vtrpcpb.Code(code), err.Error()) }
[ "func", "FromGRPC", "(", "err", "error", ")", "error", "{", "if", "err", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "if", "err", "==", "io", ".", "EOF", "{", "// Do not wrap io.EOF because we compare against it for finished streams.", "return", "err", ...
// FromGRPC returns a gRPC error as a vtError, translating between error codes. // However, there are a few errors which are not translated and passed as they // are. For example, io.EOF since our code base checks for this error to find // out that a stream has finished.
[ "FromGRPC", "returns", "a", "gRPC", "error", "as", "a", "vtError", "translating", "between", "error", "codes", ".", "However", "there", "are", "a", "few", "errors", "which", "are", "not", "translated", "and", "passed", "as", "they", "are", ".", "For", "exa...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vterrors/grpc.go#L130-L143
135,068
vitessio/vitess
go/vt/worker/legacy_row_splitter.go
NewRowSplitter
func NewRowSplitter(shardInfos []*topo.ShardInfo, keyResolver keyspaceIDResolver) *RowSplitter { result := &RowSplitter{ KeyResolver: keyResolver, KeyRanges: make([]*topodatapb.KeyRange, len(shardInfos)), } for i, si := range shardInfos { result.KeyRanges[i] = si.KeyRange } return result }
go
func NewRowSplitter(shardInfos []*topo.ShardInfo, keyResolver keyspaceIDResolver) *RowSplitter { result := &RowSplitter{ KeyResolver: keyResolver, KeyRanges: make([]*topodatapb.KeyRange, len(shardInfos)), } for i, si := range shardInfos { result.KeyRanges[i] = si.KeyRange } return result }
[ "func", "NewRowSplitter", "(", "shardInfos", "[", "]", "*", "topo", ".", "ShardInfo", ",", "keyResolver", "keyspaceIDResolver", ")", "*", "RowSplitter", "{", "result", ":=", "&", "RowSplitter", "{", "KeyResolver", ":", "keyResolver", ",", "KeyRanges", ":", "ma...
// NewRowSplitter returns a new row splitter for the given shard distribution.
[ "NewRowSplitter", "returns", "a", "new", "row", "splitter", "for", "the", "given", "shard", "distribution", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/worker/legacy_row_splitter.go#L39-L48
135,069
vitessio/vitess
go/vt/worker/legacy_row_splitter.go
StartSplit
func (rs *RowSplitter) StartSplit() [][][]sqltypes.Value { return make([][][]sqltypes.Value, len(rs.KeyRanges)) }
go
func (rs *RowSplitter) StartSplit() [][][]sqltypes.Value { return make([][][]sqltypes.Value, len(rs.KeyRanges)) }
[ "func", "(", "rs", "*", "RowSplitter", ")", "StartSplit", "(", ")", "[", "]", "[", "]", "[", "]", "sqltypes", ".", "Value", "{", "return", "make", "(", "[", "]", "[", "]", "[", "]", "sqltypes", ".", "Value", ",", "len", "(", "rs", ".", "KeyRang...
// StartSplit starts a new split. Split can then be called multiple times.
[ "StartSplit", "starts", "a", "new", "split", ".", "Split", "can", "then", "be", "called", "multiple", "times", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/worker/legacy_row_splitter.go#L51-L53
135,070
vitessio/vitess
go/vt/worker/legacy_row_splitter.go
Split
func (rs *RowSplitter) Split(result [][][]sqltypes.Value, rows [][]sqltypes.Value) error { for _, row := range rows { k, err := rs.KeyResolver.keyspaceID(row) if err != nil { return err } for i, kr := range rs.KeyRanges { if key.KeyRangeContains(kr, k) { result[i] = append(result[i], row) break ...
go
func (rs *RowSplitter) Split(result [][][]sqltypes.Value, rows [][]sqltypes.Value) error { for _, row := range rows { k, err := rs.KeyResolver.keyspaceID(row) if err != nil { return err } for i, kr := range rs.KeyRanges { if key.KeyRangeContains(kr, k) { result[i] = append(result[i], row) break ...
[ "func", "(", "rs", "*", "RowSplitter", ")", "Split", "(", "result", "[", "]", "[", "]", "[", "]", "sqltypes", ".", "Value", ",", "rows", "[", "]", "[", "]", "sqltypes", ".", "Value", ")", "error", "{", "for", "_", ",", "row", ":=", "range", "ro...
// Split will split the rows into subset for each distribution
[ "Split", "will", "split", "the", "rows", "into", "subset", "for", "each", "distribution" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/worker/legacy_row_splitter.go#L56-L70
135,071
vitessio/vitess
go/vt/worker/legacy_row_splitter.go
Send
func (rs *RowSplitter) Send(fields []*querypb.Field, result [][][]sqltypes.Value, baseCmds []string, insertChannels []chan string, abort <-chan struct{}) bool { for i, c := range insertChannels { // one of the chunks might be empty, so no need // to send data in that case if len(result[i]) > 0 { cmd := baseCm...
go
func (rs *RowSplitter) Send(fields []*querypb.Field, result [][][]sqltypes.Value, baseCmds []string, insertChannels []chan string, abort <-chan struct{}) bool { for i, c := range insertChannels { // one of the chunks might be empty, so no need // to send data in that case if len(result[i]) > 0 { cmd := baseCm...
[ "func", "(", "rs", "*", "RowSplitter", ")", "Send", "(", "fields", "[", "]", "*", "querypb", ".", "Field", ",", "result", "[", "]", "[", "]", "[", "]", "sqltypes", ".", "Value", ",", "baseCmds", "[", "]", "string", ",", "insertChannels", "[", "]", ...
// Send will send the rows to the list of channels. Returns true if aborted.
[ "Send", "will", "send", "the", "rows", "to", "the", "list", "of", "channels", ".", "Returns", "true", "if", "aborted", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/worker/legacy_row_splitter.go#L73-L88
135,072
vitessio/vitess
go/vt/vttablet/heartbeat/writer.go
NewWriter
func NewWriter(checker connpool.MySQLChecker, alias topodatapb.TabletAlias, config tabletenv.TabletConfig) *Writer { if !config.HeartbeatEnable { return &Writer{} } return &Writer{ enabled: true, tabletAlias: alias, now: time.Now, interval: config.HeartbeatInterval, ticks: timer.NewT...
go
func NewWriter(checker connpool.MySQLChecker, alias topodatapb.TabletAlias, config tabletenv.TabletConfig) *Writer { if !config.HeartbeatEnable { return &Writer{} } return &Writer{ enabled: true, tabletAlias: alias, now: time.Now, interval: config.HeartbeatInterval, ticks: timer.NewT...
[ "func", "NewWriter", "(", "checker", "connpool", ".", "MySQLChecker", ",", "alias", "topodatapb", ".", "TabletAlias", ",", "config", "tabletenv", ".", "TabletConfig", ")", "*", "Writer", "{", "if", "!", "config", ".", "HeartbeatEnable", "{", "return", "&", "...
// NewWriter creates a new Writer.
[ "NewWriter", "creates", "a", "new", "Writer", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/heartbeat/writer.go#L77-L90
135,073
vitessio/vitess
go/vt/vttablet/heartbeat/writer.go
Init
func (w *Writer) Init(target querypb.Target) error { if !w.enabled { return nil } w.mu.Lock() defer w.mu.Unlock() log.Info("Initializing heartbeat table.") w.dbName = sqlescape.EscapeID(w.dbconfigs.SidecarDBName.Get()) w.keyspaceShard = fmt.Sprintf("%s:%s", target.Keyspace, target.Shard) err := w.initializeTa...
go
func (w *Writer) Init(target querypb.Target) error { if !w.enabled { return nil } w.mu.Lock() defer w.mu.Unlock() log.Info("Initializing heartbeat table.") w.dbName = sqlescape.EscapeID(w.dbconfigs.SidecarDBName.Get()) w.keyspaceShard = fmt.Sprintf("%s:%s", target.Keyspace, target.Shard) err := w.initializeTa...
[ "func", "(", "w", "*", "Writer", ")", "Init", "(", "target", "querypb", ".", "Target", ")", "error", "{", "if", "!", "w", ".", "enabled", "{", "return", "nil", "\n", "}", "\n", "w", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "w", ".", "...
// Init runs at tablet startup and last minute initialization of db settings, and // creates the necessary tables for heartbeat.
[ "Init", "runs", "at", "tablet", "startup", "and", "last", "minute", "initialization", "of", "db", "settings", "and", "creates", "the", "necessary", "tables", "for", "heartbeat", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/heartbeat/writer.go#L99-L115
135,074
vitessio/vitess
go/vt/vttablet/heartbeat/writer.go
Open
func (w *Writer) Open() { if !w.enabled { return } w.mu.Lock() defer w.mu.Unlock() if w.isOpen { return } log.Info("Beginning heartbeat writes") w.pool.Open(w.dbconfigs.AppWithDB(), w.dbconfigs.DbaWithDB(), w.dbconfigs.AppDebugWithDB()) w.ticks.Start(func() { w.writeHeartbeat() }) w.isOpen = true }
go
func (w *Writer) Open() { if !w.enabled { return } w.mu.Lock() defer w.mu.Unlock() if w.isOpen { return } log.Info("Beginning heartbeat writes") w.pool.Open(w.dbconfigs.AppWithDB(), w.dbconfigs.DbaWithDB(), w.dbconfigs.AppDebugWithDB()) w.ticks.Start(func() { w.writeHeartbeat() }) w.isOpen = true }
[ "func", "(", "w", "*", "Writer", ")", "Open", "(", ")", "{", "if", "!", "w", ".", "enabled", "{", "return", "\n", "}", "\n", "w", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "w", ".", "mu", ".", "Unlock", "(", ")", "\n", "if", "w", "...
// Open sets up the Writer's db connection and launches the ticker // responsible for periodically writing to the heartbeat table. // Open may be called multiple times, as long as it was closed since // last invocation.
[ "Open", "sets", "up", "the", "Writer", "s", "db", "connection", "and", "launches", "the", "ticker", "responsible", "for", "periodically", "writing", "to", "the", "heartbeat", "table", ".", "Open", "may", "be", "called", "multiple", "times", "as", "long", "as...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/heartbeat/writer.go#L121-L134
135,075
vitessio/vitess
go/vt/vttablet/heartbeat/writer.go
Close
func (w *Writer) Close() { if !w.enabled { return } w.mu.Lock() defer w.mu.Unlock() if !w.isOpen { return } w.ticks.Stop() w.pool.Close() log.Info("Stopped heartbeat writes.") w.isOpen = false }
go
func (w *Writer) Close() { if !w.enabled { return } w.mu.Lock() defer w.mu.Unlock() if !w.isOpen { return } w.ticks.Stop() w.pool.Close() log.Info("Stopped heartbeat writes.") w.isOpen = false }
[ "func", "(", "w", "*", "Writer", ")", "Close", "(", ")", "{", "if", "!", "w", ".", "enabled", "{", "return", "\n", "}", "\n", "w", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "w", ".", "mu", ".", "Unlock", "(", ")", "\n", "if", "!", ...
// Close closes the Writer's db connection and stops the periodic ticker. A writer // object can be re-opened after closing.
[ "Close", "closes", "the", "Writer", "s", "db", "connection", "and", "stops", "the", "periodic", "ticker", ".", "A", "writer", "object", "can", "be", "re", "-", "opened", "after", "closing", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/heartbeat/writer.go#L138-L151
135,076
vitessio/vitess
go/vt/vttablet/heartbeat/writer.go
writeHeartbeat
func (w *Writer) writeHeartbeat() { defer tabletenv.LogError() ctx, cancel := context.WithDeadline(context.Background(), w.now().Add(w.interval)) defer cancel() update, err := w.bindHeartbeatVars(sqlUpdateHeartbeat) if err != nil { w.recordError(err) return } err = w.exec(ctx, update) if err != nil { w.re...
go
func (w *Writer) writeHeartbeat() { defer tabletenv.LogError() ctx, cancel := context.WithDeadline(context.Background(), w.now().Add(w.interval)) defer cancel() update, err := w.bindHeartbeatVars(sqlUpdateHeartbeat) if err != nil { w.recordError(err) return } err = w.exec(ctx, update) if err != nil { w.re...
[ "func", "(", "w", "*", "Writer", ")", "writeHeartbeat", "(", ")", "{", "defer", "tabletenv", ".", "LogError", "(", ")", "\n", "ctx", ",", "cancel", ":=", "context", ".", "WithDeadline", "(", "context", ".", "Background", "(", ")", ",", "w", ".", "now...
// writeHeartbeat updates the heartbeat row for this tablet with the current time in nanoseconds.
[ "writeHeartbeat", "updates", "the", "heartbeat", "row", "for", "this", "tablet", "with", "the", "current", "time", "in", "nanoseconds", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/heartbeat/writer.go#L204-L219
135,077
vitessio/vitess
go/vt/workflow/topovalidator/validator.go
Run
func (w *Workflow) Run(ctx context.Context, manager *workflow.Manager, wi *topo.WorkflowInfo) error { w.uiUpdate() w.rootUINode.Display = workflow.NodeDisplayDeterminate w.rootUINode.BroadcastChanges(false /* updateChildren */) // Run all the validators. They may add fixers. for name, v := range validators { w....
go
func (w *Workflow) Run(ctx context.Context, manager *workflow.Manager, wi *topo.WorkflowInfo) error { w.uiUpdate() w.rootUINode.Display = workflow.NodeDisplayDeterminate w.rootUINode.BroadcastChanges(false /* updateChildren */) // Run all the validators. They may add fixers. for name, v := range validators { w....
[ "func", "(", "w", "*", "Workflow", ")", "Run", "(", "ctx", "context", ".", "Context", ",", "manager", "*", "workflow", ".", "Manager", ",", "wi", "*", "topo", ".", "WorkflowInfo", ")", "error", "{", "w", ".", "uiUpdate", "(", ")", "\n", "w", ".", ...
// Run is part of the workflow.Workflow interface.
[ "Run", "is", "part", "of", "the", "workflow", ".", "Workflow", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/workflow/topovalidator/validator.go#L120-L175
135,078
vitessio/vitess
go/vt/workflow/topovalidator/validator.go
uiUpdate
func (w *Workflow) uiUpdate() { c := len(validators) w.rootUINode.Progress = 100 * w.runCount / c w.rootUINode.ProgressMessage = fmt.Sprintf("%v/%v", w.runCount, c) w.rootUINode.Log = w.logger.String() }
go
func (w *Workflow) uiUpdate() { c := len(validators) w.rootUINode.Progress = 100 * w.runCount / c w.rootUINode.ProgressMessage = fmt.Sprintf("%v/%v", w.runCount, c) w.rootUINode.Log = w.logger.String() }
[ "func", "(", "w", "*", "Workflow", ")", "uiUpdate", "(", ")", "{", "c", ":=", "len", "(", "validators", ")", "\n", "w", ".", "rootUINode", ".", "Progress", "=", "100", "*", "w", ".", "runCount", "/", "c", "\n", "w", ".", "rootUINode", ".", "Progr...
// uiUpdate updates the computed parts of the Node, based on the // current state.
[ "uiUpdate", "updates", "the", "computed", "parts", "of", "the", "Node", "based", "on", "the", "current", "state", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/workflow/topovalidator/validator.go#L179-L184
135,079
vitessio/vitess
go/vt/vtgate/engine/primitive.go
AddStats
func (p *Plan) AddStats(execCount uint64, execTime time.Duration, shardQueries, rows, errors uint64) { p.mu.Lock() p.ExecCount += execCount p.ExecTime += execTime p.ShardQueries += shardQueries p.Rows += rows p.Errors += errors p.mu.Unlock() }
go
func (p *Plan) AddStats(execCount uint64, execTime time.Duration, shardQueries, rows, errors uint64) { p.mu.Lock() p.ExecCount += execCount p.ExecTime += execTime p.ShardQueries += shardQueries p.Rows += rows p.Errors += errors p.mu.Unlock() }
[ "func", "(", "p", "*", "Plan", ")", "AddStats", "(", "execCount", "uint64", ",", "execTime", "time", ".", "Duration", ",", "shardQueries", ",", "rows", ",", "errors", "uint64", ")", "{", "p", ".", "mu", ".", "Lock", "(", ")", "\n", "p", ".", "ExecC...
// AddStats updates the plan execution statistics
[ "AddStats", "updates", "the", "plan", "execution", "statistics" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/engine/primitive.go#L94-L102
135,080
vitessio/vitess
go/vt/vtgate/planbuilder/select.go
buildSelectPlan
func buildSelectPlan(sel *sqlparser.Select, vschema ContextVSchema) (primitive engine.Primitive, err error) { pb := newPrimitiveBuilder(vschema, newJointab(sqlparser.GetBindvars(sel))) if err := pb.processSelect(sel, nil); err != nil { return nil, err } if err := pb.bldr.Wireup(pb.bldr, pb.jt); err != nil { ret...
go
func buildSelectPlan(sel *sqlparser.Select, vschema ContextVSchema) (primitive engine.Primitive, err error) { pb := newPrimitiveBuilder(vschema, newJointab(sqlparser.GetBindvars(sel))) if err := pb.processSelect(sel, nil); err != nil { return nil, err } if err := pb.bldr.Wireup(pb.bldr, pb.jt); err != nil { ret...
[ "func", "buildSelectPlan", "(", "sel", "*", "sqlparser", ".", "Select", ",", "vschema", "ContextVSchema", ")", "(", "primitive", "engine", ".", "Primitive", ",", "err", "error", ")", "{", "pb", ":=", "newPrimitiveBuilder", "(", "vschema", ",", "newJointab", ...
// buildSelectPlan is the new function to build a Select plan.
[ "buildSelectPlan", "is", "the", "new", "function", "to", "build", "a", "Select", "plan", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/select.go#L28-L37
135,081
vitessio/vitess
go/vt/vtgate/planbuilder/select.go
pushFilter
func (pb *primitiveBuilder) pushFilter(boolExpr sqlparser.Expr, whereType string) error { filters := splitAndExpression(nil, boolExpr) reorderBySubquery(filters) for _, filter := range filters { pullouts, origin, expr, err := pb.findOrigin(filter) if err != nil { return err } // The returned expression ma...
go
func (pb *primitiveBuilder) pushFilter(boolExpr sqlparser.Expr, whereType string) error { filters := splitAndExpression(nil, boolExpr) reorderBySubquery(filters) for _, filter := range filters { pullouts, origin, expr, err := pb.findOrigin(filter) if err != nil { return err } // The returned expression ma...
[ "func", "(", "pb", "*", "primitiveBuilder", ")", "pushFilter", "(", "boolExpr", "sqlparser", ".", "Expr", ",", "whereType", "string", ")", "error", "{", "filters", ":=", "splitAndExpression", "(", "nil", ",", "boolExpr", ")", "\n", "reorderBySubquery", "(", ...
// pushFilter identifies the target route for the specified bool expr, // pushes it down, and updates the route info if the new constraint improves // the primitive. This function can push to a WHERE or HAVING clause.
[ "pushFilter", "identifies", "the", "target", "route", "for", "the", "specified", "bool", "expr", "pushes", "it", "down", "and", "updates", "the", "route", "info", "if", "the", "new", "constraint", "improves", "the", "primitive", ".", "This", "function", "can",...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/select.go#L127-L144
135,082
vitessio/vitess
go/vt/vtgate/planbuilder/select.go
reorderBySubquery
func reorderBySubquery(filters []sqlparser.Expr) { max := len(filters) for i := 0; i < max; i++ { if !hasSubquery(filters[i]) { continue } saved := filters[i] for j := i; j < len(filters)-1; j++ { filters[j] = filters[j+1] } filters[len(filters)-1] = saved max-- } }
go
func reorderBySubquery(filters []sqlparser.Expr) { max := len(filters) for i := 0; i < max; i++ { if !hasSubquery(filters[i]) { continue } saved := filters[i] for j := i; j < len(filters)-1; j++ { filters[j] = filters[j+1] } filters[len(filters)-1] = saved max-- } }
[ "func", "reorderBySubquery", "(", "filters", "[", "]", "sqlparser", ".", "Expr", ")", "{", "max", ":=", "len", "(", "filters", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "max", ";", "i", "++", "{", "if", "!", "hasSubquery", "(", "filters", ...
// reorderBySubquery reorders the filters by pushing subqueries // to the end. This allows the non-subquery filters to be // pushed first because they can potentially improve the routing // plan, which can later allow a filter containing a subquery // to successfully merge with the corresponding route.
[ "reorderBySubquery", "reorders", "the", "filters", "by", "pushing", "subqueries", "to", "the", "end", ".", "This", "allows", "the", "non", "-", "subquery", "filters", "to", "be", "pushed", "first", "because", "they", "can", "potentially", "improve", "the", "ro...
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/select.go#L151-L164
135,083
vitessio/vitess
go/vt/vtgate/planbuilder/select.go
addPullouts
func (pb *primitiveBuilder) addPullouts(pullouts []*pulloutSubquery) { for _, pullout := range pullouts { pullout.setUnderlying(pb.bldr) pb.bldr = pullout } }
go
func (pb *primitiveBuilder) addPullouts(pullouts []*pulloutSubquery) { for _, pullout := range pullouts { pullout.setUnderlying(pb.bldr) pb.bldr = pullout } }
[ "func", "(", "pb", "*", "primitiveBuilder", ")", "addPullouts", "(", "pullouts", "[", "]", "*", "pulloutSubquery", ")", "{", "for", "_", ",", "pullout", ":=", "range", "pullouts", "{", "pullout", ".", "setUnderlying", "(", "pb", ".", "bldr", ")", "\n", ...
// addPullouts adds the pullout subqueries to the primitiveBuilder.
[ "addPullouts", "adds", "the", "pullout", "subqueries", "to", "the", "primitiveBuilder", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/select.go#L167-L172
135,084
vitessio/vitess
go/vt/vtgate/planbuilder/select.go
pushSelectExprs
func (pb *primitiveBuilder) pushSelectExprs(sel *sqlparser.Select, grouper groupByHandler) error { resultColumns, err := pb.pushSelectRoutes(sel.SelectExprs) if err != nil { return err } pb.st.SetResultColumns(resultColumns) return pb.pushGroupBy(sel, grouper) }
go
func (pb *primitiveBuilder) pushSelectExprs(sel *sqlparser.Select, grouper groupByHandler) error { resultColumns, err := pb.pushSelectRoutes(sel.SelectExprs) if err != nil { return err } pb.st.SetResultColumns(resultColumns) return pb.pushGroupBy(sel, grouper) }
[ "func", "(", "pb", "*", "primitiveBuilder", ")", "pushSelectExprs", "(", "sel", "*", "sqlparser", ".", "Select", ",", "grouper", "groupByHandler", ")", "error", "{", "resultColumns", ",", "err", ":=", "pb", ".", "pushSelectRoutes", "(", "sel", ".", "SelectEx...
// pushSelectExprs identifies the target route for the // select expressions and pushes them down.
[ "pushSelectExprs", "identifies", "the", "target", "route", "for", "the", "select", "expressions", "and", "pushes", "them", "down", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/select.go#L176-L183
135,085
vitessio/vitess
go/vt/vtgate/planbuilder/select.go
pushSelectRoutes
func (pb *primitiveBuilder) pushSelectRoutes(selectExprs sqlparser.SelectExprs) ([]*resultColumn, error) { resultColumns := make([]*resultColumn, 0, len(selectExprs)) for _, node := range selectExprs { switch node := node.(type) { case *sqlparser.AliasedExpr: pullouts, origin, expr, err := pb.findOrigin(node.E...
go
func (pb *primitiveBuilder) pushSelectRoutes(selectExprs sqlparser.SelectExprs) ([]*resultColumn, error) { resultColumns := make([]*resultColumn, 0, len(selectExprs)) for _, node := range selectExprs { switch node := node.(type) { case *sqlparser.AliasedExpr: pullouts, origin, expr, err := pb.findOrigin(node.E...
[ "func", "(", "pb", "*", "primitiveBuilder", ")", "pushSelectRoutes", "(", "selectExprs", "sqlparser", ".", "SelectExprs", ")", "(", "[", "]", "*", "resultColumn", ",", "error", ")", "{", "resultColumns", ":=", "make", "(", "[", "]", "*", "resultColumn", ",...
// pusheSelectRoutes is a convenience function that pushes all the select // expressions and returns the list of resultColumns generated for it.
[ "pusheSelectRoutes", "is", "a", "convenience", "function", "that", "pushes", "all", "the", "select", "expressions", "and", "returns", "the", "list", "of", "resultColumns", "generated", "for", "it", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/select.go#L187-L243
135,086
vitessio/vitess
go/mysql/client.go
Ping
func (c *Conn) Ping() error { // This is a new command, need to reset the sequence. c.sequence = 0 if err := c.writePacket([]byte{ComPing}); err != nil { return NewSQLError(CRServerGone, SSUnknownSQLState, "%v", err) } data, err := c.readEphemeralPacket() if err != nil { return NewSQLError(CRServerLost, SSUn...
go
func (c *Conn) Ping() error { // This is a new command, need to reset the sequence. c.sequence = 0 if err := c.writePacket([]byte{ComPing}); err != nil { return NewSQLError(CRServerGone, SSUnknownSQLState, "%v", err) } data, err := c.readEphemeralPacket() if err != nil { return NewSQLError(CRServerLost, SSUn...
[ "func", "(", "c", "*", "Conn", ")", "Ping", "(", ")", "error", "{", "// This is a new command, need to reset the sequence.", "c", ".", "sequence", "=", "0", "\n\n", "if", "err", ":=", "c", ".", "writePacket", "(", "[", "]", "byte", "{", "ComPing", "}", "...
// Ping implements mysql ping command.
[ "Ping", "implements", "mysql", "ping", "command", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/client.go#L172-L191
135,087
vitessio/vitess
go/mysql/client.go
writeSSLRequest
func (c *Conn) writeSSLRequest(capabilities uint32, characterSet uint8, params *ConnParams) error { // Build our flags, with CapabilityClientSSL. var flags uint32 = CapabilityClientLongPassword | CapabilityClientLongFlag | CapabilityClientProtocol41 | CapabilityClientTransactions | CapabilityClientSecureConne...
go
func (c *Conn) writeSSLRequest(capabilities uint32, characterSet uint8, params *ConnParams) error { // Build our flags, with CapabilityClientSSL. var flags uint32 = CapabilityClientLongPassword | CapabilityClientLongFlag | CapabilityClientProtocol41 | CapabilityClientTransactions | CapabilityClientSecureConne...
[ "func", "(", "c", "*", "Conn", ")", "writeSSLRequest", "(", "capabilities", "uint32", ",", "characterSet", "uint8", ",", "params", "*", "ConnParams", ")", "error", "{", "// Build our flags, with CapabilityClientSSL.", "var", "flags", "uint32", "=", "CapabilityClient...
// writeSSLRequest writes the SSLRequest packet. It's just a truncated // HandshakeResponse41.
[ "writeSSLRequest", "writes", "the", "SSLRequest", "packet", ".", "It", "s", "just", "a", "truncated", "HandshakeResponse41", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/client.go#L495-L541
135,088
vitessio/vitess
go/mysql/client.go
writeHandshakeResponse41
func (c *Conn) writeHandshakeResponse41(capabilities uint32, scrambledPassword []byte, characterSet uint8, params *ConnParams) error { // Build our flags. var flags uint32 = CapabilityClientLongPassword | CapabilityClientLongFlag | CapabilityClientProtocol41 | CapabilityClientTransactions | CapabilityClientSe...
go
func (c *Conn) writeHandshakeResponse41(capabilities uint32, scrambledPassword []byte, characterSet uint8, params *ConnParams) error { // Build our flags. var flags uint32 = CapabilityClientLongPassword | CapabilityClientLongFlag | CapabilityClientProtocol41 | CapabilityClientTransactions | CapabilityClientSe...
[ "func", "(", "c", "*", "Conn", ")", "writeHandshakeResponse41", "(", "capabilities", "uint32", ",", "scrambledPassword", "[", "]", "byte", ",", "characterSet", "uint8", ",", "params", "*", "ConnParams", ")", "error", "{", "// Build our flags.", "var", "flags", ...
// writeHandshakeResponse41 writes the handshake response. // Returns a SQLError.
[ "writeHandshakeResponse41", "writes", "the", "handshake", "response", ".", "Returns", "a", "SQLError", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/client.go#L545-L633
135,089
vitessio/vitess
go/mysql/client.go
writeClearTextPassword
func (c *Conn) writeClearTextPassword(params *ConnParams) error { length := len(params.Pass) + 1 data := c.startEphemeralPacket(length) pos := 0 pos = writeNullString(data, pos, params.Pass) // Sanity check. if pos != len(data) { return vterrors.Errorf(vtrpc.Code_INTERNAL, "error building ClearTextPassword pack...
go
func (c *Conn) writeClearTextPassword(params *ConnParams) error { length := len(params.Pass) + 1 data := c.startEphemeralPacket(length) pos := 0 pos = writeNullString(data, pos, params.Pass) // Sanity check. if pos != len(data) { return vterrors.Errorf(vtrpc.Code_INTERNAL, "error building ClearTextPassword pack...
[ "func", "(", "c", "*", "Conn", ")", "writeClearTextPassword", "(", "params", "*", "ConnParams", ")", "error", "{", "length", ":=", "len", "(", "params", ".", "Pass", ")", "+", "1", "\n", "data", ":=", "c", ".", "startEphemeralPacket", "(", "length", ")...
// writeClearTextPassword writes the clear text password. // Returns a SQLError.
[ "writeClearTextPassword", "writes", "the", "clear", "text", "password", ".", "Returns", "a", "SQLError", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/client.go#L647-L657
135,090
vitessio/vitess
go/vt/callinfo/plugin_grpc.go
GRPCCallInfo
func GRPCCallInfo(ctx context.Context) context.Context { method, ok := grpc.Method(ctx) if !ok { return ctx } callinfo := &gRPCCallInfoImpl{ method: method, } peer, ok := peer.FromContext(ctx) if ok { callinfo.remoteAddr = peer.Addr.String() } return NewContext(ctx, callinfo) }
go
func GRPCCallInfo(ctx context.Context) context.Context { method, ok := grpc.Method(ctx) if !ok { return ctx } callinfo := &gRPCCallInfoImpl{ method: method, } peer, ok := peer.FromContext(ctx) if ok { callinfo.remoteAddr = peer.Addr.String() } return NewContext(ctx, callinfo) }
[ "func", "GRPCCallInfo", "(", "ctx", "context", ".", "Context", ")", "context", ".", "Context", "{", "method", ",", "ok", ":=", "grpc", ".", "Method", "(", "ctx", ")", "\n", "if", "!", "ok", "{", "return", "ctx", "\n", "}", "\n\n", "callinfo", ":=", ...
// GRPCCallInfo returns an augmented context with a CallInfo structure, // only for gRPC contexts.
[ "GRPCCallInfo", "returns", "an", "augmented", "context", "with", "a", "CallInfo", "structure", "only", "for", "gRPC", "contexts", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/callinfo/plugin_grpc.go#L32-L47
135,091
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlclient/client.go
Start
func (c *client) Start(ctx context.Context, mysqldArgs ...string) error { return c.withRetry(ctx, func() error { _, err := c.c.Start(ctx, &mysqlctlpb.StartRequest{ MysqldArgs: mysqldArgs, }) return err }) }
go
func (c *client) Start(ctx context.Context, mysqldArgs ...string) error { return c.withRetry(ctx, func() error { _, err := c.c.Start(ctx, &mysqlctlpb.StartRequest{ MysqldArgs: mysqldArgs, }) return err }) }
[ "func", "(", "c", "*", "client", ")", "Start", "(", "ctx", "context", ".", "Context", ",", "mysqldArgs", "...", "string", ")", "error", "{", "return", "c", ".", "withRetry", "(", "ctx", ",", "func", "(", ")", "error", "{", "_", ",", "err", ":=", ...
// Start is part of the MysqlctlClient interface.
[ "Start", "is", "part", "of", "the", "MysqlctlClient", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlclient/client.go#L60-L67
135,092
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlclient/client.go
Shutdown
func (c *client) Shutdown(ctx context.Context, waitForMysqld bool) error { return c.withRetry(ctx, func() error { _, err := c.c.Shutdown(ctx, &mysqlctlpb.ShutdownRequest{ WaitForMysqld: waitForMysqld, }) return err }) }
go
func (c *client) Shutdown(ctx context.Context, waitForMysqld bool) error { return c.withRetry(ctx, func() error { _, err := c.c.Shutdown(ctx, &mysqlctlpb.ShutdownRequest{ WaitForMysqld: waitForMysqld, }) return err }) }
[ "func", "(", "c", "*", "client", ")", "Shutdown", "(", "ctx", "context", ".", "Context", ",", "waitForMysqld", "bool", ")", "error", "{", "return", "c", ".", "withRetry", "(", "ctx", ",", "func", "(", ")", "error", "{", "_", ",", "err", ":=", "c", ...
// Shutdown is part of the MysqlctlClient interface.
[ "Shutdown", "is", "part", "of", "the", "MysqlctlClient", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlclient/client.go#L70-L77
135,093
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlclient/client.go
RunMysqlUpgrade
func (c *client) RunMysqlUpgrade(ctx context.Context) error { return c.withRetry(ctx, func() error { _, err := c.c.RunMysqlUpgrade(ctx, &mysqlctlpb.RunMysqlUpgradeRequest{}) return err }) }
go
func (c *client) RunMysqlUpgrade(ctx context.Context) error { return c.withRetry(ctx, func() error { _, err := c.c.RunMysqlUpgrade(ctx, &mysqlctlpb.RunMysqlUpgradeRequest{}) return err }) }
[ "func", "(", "c", "*", "client", ")", "RunMysqlUpgrade", "(", "ctx", "context", ".", "Context", ")", "error", "{", "return", "c", ".", "withRetry", "(", "ctx", ",", "func", "(", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "c", ".", "RunMy...
// RunMysqlUpgrade is part of the MysqlctlClient interface.
[ "RunMysqlUpgrade", "is", "part", "of", "the", "MysqlctlClient", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlclient/client.go#L80-L85
135,094
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlclient/client.go
ReinitConfig
func (c *client) ReinitConfig(ctx context.Context) error { return c.withRetry(ctx, func() error { _, err := c.c.ReinitConfig(ctx, &mysqlctlpb.ReinitConfigRequest{}) return err }) }
go
func (c *client) ReinitConfig(ctx context.Context) error { return c.withRetry(ctx, func() error { _, err := c.c.ReinitConfig(ctx, &mysqlctlpb.ReinitConfigRequest{}) return err }) }
[ "func", "(", "c", "*", "client", ")", "ReinitConfig", "(", "ctx", "context", ".", "Context", ")", "error", "{", "return", "c", ".", "withRetry", "(", "ctx", ",", "func", "(", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "c", ".", "ReinitCo...
// ReinitConfig is part of the MysqlctlClient interface.
[ "ReinitConfig", "is", "part", "of", "the", "MysqlctlClient", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlclient/client.go#L88-L93
135,095
vitessio/vitess
go/vt/mysqlctl/grpcmysqlctlclient/client.go
RefreshConfig
func (c *client) RefreshConfig(ctx context.Context) error { return c.withRetry(ctx, func() error { _, err := c.c.RefreshConfig(ctx, &mysqlctlpb.RefreshConfigRequest{}) return err }) }
go
func (c *client) RefreshConfig(ctx context.Context) error { return c.withRetry(ctx, func() error { _, err := c.c.RefreshConfig(ctx, &mysqlctlpb.RefreshConfigRequest{}) return err }) }
[ "func", "(", "c", "*", "client", ")", "RefreshConfig", "(", "ctx", "context", ".", "Context", ")", "error", "{", "return", "c", ".", "withRetry", "(", "ctx", ",", "func", "(", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "c", ".", "Refresh...
// RefreshConfig is part of the MysqlctlClient interface.
[ "RefreshConfig", "is", "part", "of", "the", "MysqlctlClient", "interface", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/grpcmysqlctlclient/client.go#L96-L101
135,096
vitessio/vitess
go/vt/topo/helpers/compare.go
CompareKeyspaces
func CompareKeyspaces(ctx context.Context, fromTS, toTS *topo.Server) error { keyspaces, err := fromTS.GetKeyspaces(ctx) if err != nil { return vterrors.Wrapf(err, "GetKeyspace(%v)", keyspaces) } for _, keyspace := range keyspaces { fromKs, err := fromTS.GetKeyspace(ctx, keyspace) if err != nil { return ...
go
func CompareKeyspaces(ctx context.Context, fromTS, toTS *topo.Server) error { keyspaces, err := fromTS.GetKeyspaces(ctx) if err != nil { return vterrors.Wrapf(err, "GetKeyspace(%v)", keyspaces) } for _, keyspace := range keyspaces { fromKs, err := fromTS.GetKeyspace(ctx, keyspace) if err != nil { return ...
[ "func", "CompareKeyspaces", "(", "ctx", "context", ".", "Context", ",", "fromTS", ",", "toTS", "*", "topo", ".", "Server", ")", "error", "{", "keyspaces", ",", "err", ":=", "fromTS", ".", "GetKeyspaces", "(", "ctx", ")", "\n", "if", "err", "!=", "nil",...
// CompareKeyspaces will compare the keyspaces in the destination topo.
[ "CompareKeyspaces", "will", "compare", "the", "keyspaces", "in", "the", "destination", "topo", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/helpers/compare.go#L32-L79
135,097
vitessio/vitess
go/vt/topo/helpers/compare.go
CompareShards
func CompareShards(ctx context.Context, fromTS, toTS *topo.Server) error { keyspaces, err := fromTS.GetKeyspaces(ctx) if err != nil { return vterrors.Wrapf(err, "fromTS.GetKeyspaces") } for _, keyspace := range keyspaces { shards, err := fromTS.GetShardNames(ctx, keyspace) if err != nil { return vterrors....
go
func CompareShards(ctx context.Context, fromTS, toTS *topo.Server) error { keyspaces, err := fromTS.GetKeyspaces(ctx) if err != nil { return vterrors.Wrapf(err, "fromTS.GetKeyspaces") } for _, keyspace := range keyspaces { shards, err := fromTS.GetShardNames(ctx, keyspace) if err != nil { return vterrors....
[ "func", "CompareShards", "(", "ctx", "context", ".", "Context", ",", "fromTS", ",", "toTS", "*", "topo", ".", "Server", ")", "error", "{", "keyspaces", ",", "err", ":=", "fromTS", ".", "GetKeyspaces", "(", "ctx", ")", "\n", "if", "err", "!=", "nil", ...
// CompareShards will compare the shards in the destination topo.
[ "CompareShards", "will", "compare", "the", "shards", "in", "the", "destination", "topo", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/helpers/compare.go#L82-L110
135,098
vitessio/vitess
go/vt/topo/helpers/compare.go
CompareTablets
func CompareTablets(ctx context.Context, fromTS, toTS *topo.Server) error { cells, err := fromTS.GetKnownCells(ctx) if err != nil { return vterrors.Wrapf(err, "fromTS.GetKnownCells") } for _, cell := range cells { tabletAliases, err := fromTS.GetTabletsByCell(ctx, cell) if err != nil { return vterrors.Wra...
go
func CompareTablets(ctx context.Context, fromTS, toTS *topo.Server) error { cells, err := fromTS.GetKnownCells(ctx) if err != nil { return vterrors.Wrapf(err, "fromTS.GetKnownCells") } for _, cell := range cells { tabletAliases, err := fromTS.GetTabletsByCell(ctx, cell) if err != nil { return vterrors.Wra...
[ "func", "CompareTablets", "(", "ctx", "context", ".", "Context", ",", "fromTS", ",", "toTS", "*", "topo", ".", "Server", ")", "error", "{", "cells", ",", "err", ":=", "fromTS", ".", "GetKnownCells", "(", "ctx", ")", "\n", "if", "err", "!=", "nil", "{...
// CompareTablets will compare the tablets in the destination topo.
[ "CompareTablets", "will", "compare", "the", "tablets", "in", "the", "destination", "topo", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/helpers/compare.go#L113-L141
135,099
vitessio/vitess
go/vt/topo/helpers/compare.go
CompareShardReplications
func CompareShardReplications(ctx context.Context, fromTS, toTS *topo.Server) error { keyspaces, err := fromTS.GetKeyspaces(ctx) if err != nil { return vterrors.Wrapf(err, "fromTS.GetKeyspaces") } cells, err := fromTS.GetCellInfoNames(ctx) if err != nil { return vterrors.Wrap(err, "GetCellInfoNames()") } fo...
go
func CompareShardReplications(ctx context.Context, fromTS, toTS *topo.Server) error { keyspaces, err := fromTS.GetKeyspaces(ctx) if err != nil { return vterrors.Wrapf(err, "fromTS.GetKeyspaces") } cells, err := fromTS.GetCellInfoNames(ctx) if err != nil { return vterrors.Wrap(err, "GetCellInfoNames()") } fo...
[ "func", "CompareShardReplications", "(", "ctx", "context", ".", "Context", ",", "fromTS", ",", "toTS", "*", "topo", ".", "Server", ")", "error", "{", "keyspaces", ",", "err", ":=", "fromTS", ".", "GetKeyspaces", "(", "ctx", ")", "\n", "if", "err", "!=", ...
// CompareShardReplications will compare the ShardReplication objects in // the destination topo.
[ "CompareShardReplications", "will", "compare", "the", "ShardReplication", "objects", "in", "the", "destination", "topo", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/topo/helpers/compare.go#L145-L182