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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
136,300 | vitessio/vitess | go/vt/vttablet/endtoend/framework/client.go | Execute | func (client *QueryClient) Execute(query string, bindvars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
return client.ExecuteWithOptions(query, bindvars, &querypb.ExecuteOptions{IncludedFields: querypb.ExecuteOptions_ALL})
} | go | func (client *QueryClient) Execute(query string, bindvars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
return client.ExecuteWithOptions(query, bindvars, &querypb.ExecuteOptions{IncludedFields: querypb.ExecuteOptions_ALL})
} | [
"func",
"(",
"client",
"*",
"QueryClient",
")",
"Execute",
"(",
"query",
"string",
",",
"bindvars",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
")",
"(",
"*",
"sqltypes",
".",
"Result",
",",
"error",
")",
"{",
"return",
"client",
".... | // Execute executes a query. | [
"Execute",
"executes",
"a",
"query",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/endtoend/framework/client.go#L143-L145 |
136,301 | vitessio/vitess | go/vt/vttablet/endtoend/framework/client.go | BeginExecute | func (client *QueryClient) BeginExecute(query string, bindvars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
if client.transactionID != 0 {
return nil, errors.New("already in transaction")
}
qr, transactionID, err := client.server.BeginExecute(
client.ctx,
&client.target,
query,
bindvars,
... | go | func (client *QueryClient) BeginExecute(query string, bindvars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
if client.transactionID != 0 {
return nil, errors.New("already in transaction")
}
qr, transactionID, err := client.server.BeginExecute(
client.ctx,
&client.target,
query,
bindvars,
... | [
"func",
"(",
"client",
"*",
"QueryClient",
")",
"BeginExecute",
"(",
"query",
"string",
",",
"bindvars",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
")",
"(",
"*",
"sqltypes",
".",
"Result",
",",
"error",
")",
"{",
"if",
"client",
"... | // BeginExecute performs a BeginExecute. | [
"BeginExecute",
"performs",
"a",
"BeginExecute",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/endtoend/framework/client.go#L148-L164 |
136,302 | vitessio/vitess | go/vt/vttablet/endtoend/framework/client.go | ExecuteWithOptions | func (client *QueryClient) ExecuteWithOptions(query string, bindvars map[string]*querypb.BindVariable, options *querypb.ExecuteOptions) (*sqltypes.Result, error) {
return client.server.Execute(
client.ctx,
&client.target,
query,
bindvars,
client.transactionID,
options,
)
} | go | func (client *QueryClient) ExecuteWithOptions(query string, bindvars map[string]*querypb.BindVariable, options *querypb.ExecuteOptions) (*sqltypes.Result, error) {
return client.server.Execute(
client.ctx,
&client.target,
query,
bindvars,
client.transactionID,
options,
)
} | [
"func",
"(",
"client",
"*",
"QueryClient",
")",
"ExecuteWithOptions",
"(",
"query",
"string",
",",
"bindvars",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
",",
"options",
"*",
"querypb",
".",
"ExecuteOptions",
")",
"(",
"*",
"sqltypes",
... | // ExecuteWithOptions executes a query using 'options'. | [
"ExecuteWithOptions",
"executes",
"a",
"query",
"using",
"options",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/endtoend/framework/client.go#L167-L176 |
136,303 | vitessio/vitess | go/vt/vttablet/endtoend/framework/client.go | StreamExecute | func (client *QueryClient) StreamExecute(query string, bindvars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
return client.StreamExecuteWithOptions(query, bindvars, &querypb.ExecuteOptions{IncludedFields: querypb.ExecuteOptions_ALL})
} | go | func (client *QueryClient) StreamExecute(query string, bindvars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
return client.StreamExecuteWithOptions(query, bindvars, &querypb.ExecuteOptions{IncludedFields: querypb.ExecuteOptions_ALL})
} | [
"func",
"(",
"client",
"*",
"QueryClient",
")",
"StreamExecute",
"(",
"query",
"string",
",",
"bindvars",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
")",
"(",
"*",
"sqltypes",
".",
"Result",
",",
"error",
")",
"{",
"return",
"client"... | // StreamExecute executes a query & returns the results. | [
"StreamExecute",
"executes",
"a",
"query",
"&",
"returns",
"the",
"results",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/endtoend/framework/client.go#L179-L181 |
136,304 | vitessio/vitess | go/vt/vttablet/endtoend/framework/client.go | StreamExecuteWithOptions | func (client *QueryClient) StreamExecuteWithOptions(query string, bindvars map[string]*querypb.BindVariable, options *querypb.ExecuteOptions) (*sqltypes.Result, error) {
result := &sqltypes.Result{}
err := client.server.StreamExecute(
client.ctx,
&client.target,
query,
bindvars,
0,
options,
func(res *sq... | go | func (client *QueryClient) StreamExecuteWithOptions(query string, bindvars map[string]*querypb.BindVariable, options *querypb.ExecuteOptions) (*sqltypes.Result, error) {
result := &sqltypes.Result{}
err := client.server.StreamExecute(
client.ctx,
&client.target,
query,
bindvars,
0,
options,
func(res *sq... | [
"func",
"(",
"client",
"*",
"QueryClient",
")",
"StreamExecuteWithOptions",
"(",
"query",
"string",
",",
"bindvars",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
",",
"options",
"*",
"querypb",
".",
"ExecuteOptions",
")",
"(",
"*",
"sqltyp... | // StreamExecuteWithOptions executes a query & returns the results using 'options'. | [
"StreamExecuteWithOptions",
"executes",
"a",
"query",
"&",
"returns",
"the",
"results",
"using",
"options",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/endtoend/framework/client.go#L184-L206 |
136,305 | vitessio/vitess | go/vt/vttablet/endtoend/framework/client.go | Stream | func (client *QueryClient) Stream(query string, bindvars map[string]*querypb.BindVariable, sendFunc func(*sqltypes.Result) error) error {
return client.server.StreamExecute(
client.ctx,
&client.target,
query,
bindvars,
0,
&querypb.ExecuteOptions{IncludedFields: querypb.ExecuteOptions_ALL},
sendFunc,
)
} | go | func (client *QueryClient) Stream(query string, bindvars map[string]*querypb.BindVariable, sendFunc func(*sqltypes.Result) error) error {
return client.server.StreamExecute(
client.ctx,
&client.target,
query,
bindvars,
0,
&querypb.ExecuteOptions{IncludedFields: querypb.ExecuteOptions_ALL},
sendFunc,
)
} | [
"func",
"(",
"client",
"*",
"QueryClient",
")",
"Stream",
"(",
"query",
"string",
",",
"bindvars",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
",",
"sendFunc",
"func",
"(",
"*",
"sqltypes",
".",
"Result",
")",
"error",
")",
"error",
... | // Stream streams the results of a query. | [
"Stream",
"streams",
"the",
"results",
"of",
"a",
"query",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/endtoend/framework/client.go#L209-L219 |
136,306 | vitessio/vitess | go/vt/vttablet/endtoend/framework/client.go | ExecuteBatch | func (client *QueryClient) ExecuteBatch(queries []*querypb.BoundQuery, asTransaction bool) ([]sqltypes.Result, error) {
return client.server.ExecuteBatch(
client.ctx,
&client.target,
queries,
asTransaction,
client.transactionID,
&querypb.ExecuteOptions{IncludedFields: querypb.ExecuteOptions_ALL},
)
} | go | func (client *QueryClient) ExecuteBatch(queries []*querypb.BoundQuery, asTransaction bool) ([]sqltypes.Result, error) {
return client.server.ExecuteBatch(
client.ctx,
&client.target,
queries,
asTransaction,
client.transactionID,
&querypb.ExecuteOptions{IncludedFields: querypb.ExecuteOptions_ALL},
)
} | [
"func",
"(",
"client",
"*",
"QueryClient",
")",
"ExecuteBatch",
"(",
"queries",
"[",
"]",
"*",
"querypb",
".",
"BoundQuery",
",",
"asTransaction",
"bool",
")",
"(",
"[",
"]",
"sqltypes",
".",
"Result",
",",
"error",
")",
"{",
"return",
"client",
".",
"... | // ExecuteBatch executes a batch of queries. | [
"ExecuteBatch",
"executes",
"a",
"batch",
"of",
"queries",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/endtoend/framework/client.go#L222-L231 |
136,307 | vitessio/vitess | go/vt/vttablet/endtoend/framework/client.go | MessageStream | func (client *QueryClient) MessageStream(name string, callback func(*sqltypes.Result) error) (err error) {
return client.server.MessageStream(client.ctx, &client.target, name, callback)
} | go | func (client *QueryClient) MessageStream(name string, callback func(*sqltypes.Result) error) (err error) {
return client.server.MessageStream(client.ctx, &client.target, name, callback)
} | [
"func",
"(",
"client",
"*",
"QueryClient",
")",
"MessageStream",
"(",
"name",
"string",
",",
"callback",
"func",
"(",
"*",
"sqltypes",
".",
"Result",
")",
"error",
")",
"(",
"err",
"error",
")",
"{",
"return",
"client",
".",
"server",
".",
"MessageStream... | // MessageStream streams messages from the message table. | [
"MessageStream",
"streams",
"messages",
"from",
"the",
"message",
"table",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/endtoend/framework/client.go#L234-L236 |
136,308 | vitessio/vitess | go/vt/vttablet/endtoend/framework/client.go | MessageAck | func (client *QueryClient) MessageAck(name string, ids []string) (int64, error) {
bids := make([]*querypb.Value, 0, len(ids))
for _, id := range ids {
bids = append(bids, &querypb.Value{
Type: sqltypes.VarChar,
Value: []byte(id),
})
}
return client.server.MessageAck(client.ctx, &client.target, name, bids... | go | func (client *QueryClient) MessageAck(name string, ids []string) (int64, error) {
bids := make([]*querypb.Value, 0, len(ids))
for _, id := range ids {
bids = append(bids, &querypb.Value{
Type: sqltypes.VarChar,
Value: []byte(id),
})
}
return client.server.MessageAck(client.ctx, &client.target, name, bids... | [
"func",
"(",
"client",
"*",
"QueryClient",
")",
"MessageAck",
"(",
"name",
"string",
",",
"ids",
"[",
"]",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"bids",
":=",
"make",
"(",
"[",
"]",
"*",
"querypb",
".",
"Value",
",",
"0",
",",
"len... | // MessageAck acks messages | [
"MessageAck",
"acks",
"messages"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/endtoend/framework/client.go#L239-L248 |
136,309 | vitessio/vitess | go/vt/worker/command.go | AddCommand | func AddCommand(groupName string, c Command) {
for i, group := range commands {
if group.Name == groupName {
commands[i].Commands = append(commands[i].Commands, c)
return
}
}
panic(vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "trying to add to missing group %v", groupName))
} | go | func AddCommand(groupName string, c Command) {
for i, group := range commands {
if group.Name == groupName {
commands[i].Commands = append(commands[i].Commands, c)
return
}
}
panic(vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "trying to add to missing group %v", groupName))
} | [
"func",
"AddCommand",
"(",
"groupName",
"string",
",",
"c",
"Command",
")",
"{",
"for",
"i",
",",
"group",
":=",
"range",
"commands",
"{",
"if",
"group",
".",
"Name",
"==",
"groupName",
"{",
"commands",
"[",
"i",
"]",
".",
"Commands",
"=",
"append",
... | // AddCommand registers a command and makes it available. | [
"AddCommand",
"registers",
"a",
"command",
"and",
"makes",
"it",
"available",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/worker/command.go#L73-L81 |
136,310 | vitessio/vitess | go/vt/worker/command.go | WaitForCommand | func (wi *Instance) WaitForCommand(wrk Worker, done chan struct{}) error {
// display the status every second
timer := time.NewTicker(wi.commandDisplayInterval)
defer timer.Stop()
for {
select {
case <-done:
log.Info(wrk.StatusAsText())
wi.currentWorkerMutex.Lock()
err := wi.lastRunError
wi.currentW... | go | func (wi *Instance) WaitForCommand(wrk Worker, done chan struct{}) error {
// display the status every second
timer := time.NewTicker(wi.commandDisplayInterval)
defer timer.Stop()
for {
select {
case <-done:
log.Info(wrk.StatusAsText())
wi.currentWorkerMutex.Lock()
err := wi.lastRunError
wi.currentW... | [
"func",
"(",
"wi",
"*",
"Instance",
")",
"WaitForCommand",
"(",
"wrk",
"Worker",
",",
"done",
"chan",
"struct",
"{",
"}",
")",
"error",
"{",
"// display the status every second",
"timer",
":=",
"time",
".",
"NewTicker",
"(",
"wi",
".",
"commandDisplayInterval"... | // WaitForCommand blocks until "done" is closed. In the meantime, it logs the status of "wrk". | [
"WaitForCommand",
"blocks",
"until",
"done",
"is",
"closed",
".",
"In",
"the",
"meantime",
"it",
"logs",
"the",
"status",
"of",
"wrk",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/worker/command.go#L146-L165 |
136,311 | vitessio/vitess | go/vt/worker/command.go | PrintAllCommands | func PrintAllCommands(logger logutil.Logger) {
for _, group := range commands {
if group.Name == "Debugging" {
continue
}
logger.Printf("%v: %v\n", group.Name, group.Description)
for _, cmd := range group.Commands {
logger.Printf(" %v %v\n", cmd.Name, cmd.Params)
}
logger.Printf("\n")
}
} | go | func PrintAllCommands(logger logutil.Logger) {
for _, group := range commands {
if group.Name == "Debugging" {
continue
}
logger.Printf("%v: %v\n", group.Name, group.Description)
for _, cmd := range group.Commands {
logger.Printf(" %v %v\n", cmd.Name, cmd.Params)
}
logger.Printf("\n")
}
} | [
"func",
"PrintAllCommands",
"(",
"logger",
"logutil",
".",
"Logger",
")",
"{",
"for",
"_",
",",
"group",
":=",
"range",
"commands",
"{",
"if",
"group",
".",
"Name",
"==",
"\"",
"\"",
"{",
"continue",
"\n",
"}",
"\n",
"logger",
".",
"Printf",
"(",
"\"... | // PrintAllCommands prints a help text for all registered commands to the given Logger. | [
"PrintAllCommands",
"prints",
"a",
"help",
"text",
"for",
"all",
"registered",
"commands",
"to",
"the",
"given",
"Logger",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/worker/command.go#L168-L179 |
136,312 | vitessio/vitess | go/vt/binlog/binlog_streamer.go | NewStreamer | func NewStreamer(cp *mysql.ConnParams, se *schema.Engine, clientCharset *binlogdatapb.Charset, startPos mysql.Position, timestamp int64, sendTransaction sendTransactionFunc) *Streamer {
return &Streamer{
cp: cp,
se: se,
clientCharset: clientCharset,
startPos: startPos,
time... | go | func NewStreamer(cp *mysql.ConnParams, se *schema.Engine, clientCharset *binlogdatapb.Charset, startPos mysql.Position, timestamp int64, sendTransaction sendTransactionFunc) *Streamer {
return &Streamer{
cp: cp,
se: se,
clientCharset: clientCharset,
startPos: startPos,
time... | [
"func",
"NewStreamer",
"(",
"cp",
"*",
"mysql",
".",
"ConnParams",
",",
"se",
"*",
"schema",
".",
"Engine",
",",
"clientCharset",
"*",
"binlogdatapb",
".",
"Charset",
",",
"startPos",
"mysql",
".",
"Position",
",",
"timestamp",
"int64",
",",
"sendTransaction... | // NewStreamer creates a binlog Streamer.
//
// dbname specifes the database to stream events for.
// mysqld is the local instance of mysqlctl.Mysqld.
// charset is the default character set on the BinlogPlayer side.
// startPos is the position to start streaming at. Incompatible with timestamp.
// timestamp is the tim... | [
"NewStreamer",
"creates",
"a",
"binlog",
"Streamer",
".",
"dbname",
"specifes",
"the",
"database",
"to",
"stream",
"events",
"for",
".",
"mysqld",
"is",
"the",
"local",
"instance",
"of",
"mysqlctl",
".",
"Mysqld",
".",
"charset",
"is",
"the",
"default",
"cha... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/binlog/binlog_streamer.go#L158-L167 |
136,313 | vitessio/vitess | go/vt/binlog/binlog_streamer.go | writeValuesAsSQL | func writeValuesAsSQL(sql *sqlparser.TrackedBuffer, tce *tableCacheEntry, rs *mysql.Rows, rowIndex int, getPK bool) (sqltypes.Value, []sqltypes.Value, error) {
valueIndex := 0
data := rs.Rows[rowIndex].Data
pos := 0
var keyspaceIDCell sqltypes.Value
var pkValues []sqltypes.Value
if getPK {
pkValues = make([]sql... | go | func writeValuesAsSQL(sql *sqlparser.TrackedBuffer, tce *tableCacheEntry, rs *mysql.Rows, rowIndex int, getPK bool) (sqltypes.Value, []sqltypes.Value, error) {
valueIndex := 0
data := rs.Rows[rowIndex].Data
pos := 0
var keyspaceIDCell sqltypes.Value
var pkValues []sqltypes.Value
if getPK {
pkValues = make([]sql... | [
"func",
"writeValuesAsSQL",
"(",
"sql",
"*",
"sqlparser",
".",
"TrackedBuffer",
",",
"tce",
"*",
"tableCacheEntry",
",",
"rs",
"*",
"mysql",
".",
"Rows",
",",
"rowIndex",
"int",
",",
"getPK",
"bool",
")",
"(",
"sqltypes",
".",
"Value",
",",
"[",
"]",
"... | // writeValuesAsSQL is a helper method to print the values as SQL in the
// provided bytes.Buffer. It also returns the value for the keyspaceIDColumn,
// and the array of values for the PK, if necessary. | [
"writeValuesAsSQL",
"is",
"a",
"helper",
"method",
"to",
"print",
"the",
"values",
"as",
"SQL",
"in",
"the",
"provided",
"bytes",
".",
"Buffer",
".",
"It",
"also",
"returns",
"the",
"value",
"for",
"the",
"keyspaceIDColumn",
"and",
"the",
"array",
"of",
"v... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/binlog/binlog_streamer.go#L723-L779 |
136,314 | vitessio/vitess | go/mysql/flavor_mariadb.go | setSlavePositionCommands | func (mariadbFlavor) setSlavePositionCommands(pos Position) []string {
return []string{
// RESET MASTER will clear out gtid_binlog_pos,
// which then guarantees that gtid_current_pos = gtid_slave_pos,
// since gtid_current_pos = MAX(gtid_binlog_pos,gtid_slave_pos).
// This also emptys the binlogs, which allows... | go | func (mariadbFlavor) setSlavePositionCommands(pos Position) []string {
return []string{
// RESET MASTER will clear out gtid_binlog_pos,
// which then guarantees that gtid_current_pos = gtid_slave_pos,
// since gtid_current_pos = MAX(gtid_binlog_pos,gtid_slave_pos).
// This also emptys the binlogs, which allows... | [
"func",
"(",
"mariadbFlavor",
")",
"setSlavePositionCommands",
"(",
"pos",
"Position",
")",
"[",
"]",
"string",
"{",
"return",
"[",
"]",
"string",
"{",
"// RESET MASTER will clear out gtid_binlog_pos,",
"// which then guarantees that gtid_current_pos = gtid_slave_pos,",
"// s... | // setSlavePositionCommands is part of the Flavor interface. | [
"setSlavePositionCommands",
"is",
"part",
"of",
"the",
"Flavor",
"interface",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/flavor_mariadb.go#L97-L117 |
136,315 | vitessio/vitess | go/vt/wrangler/version.go | GetVersion | func (wr *Wrangler) GetVersion(ctx context.Context, tabletAlias *topodatapb.TabletAlias) (string, error) {
tablet, err := wr.ts.GetTablet(ctx, tabletAlias)
if err != nil {
return "", err
}
version, err := getVersionFromTablet(tablet.Addr())
if err != nil {
return "", err
}
log.Infof("Tablet %v is running ve... | go | func (wr *Wrangler) GetVersion(ctx context.Context, tabletAlias *topodatapb.TabletAlias) (string, error) {
tablet, err := wr.ts.GetTablet(ctx, tabletAlias)
if err != nil {
return "", err
}
version, err := getVersionFromTablet(tablet.Addr())
if err != nil {
return "", err
}
log.Infof("Tablet %v is running ve... | [
"func",
"(",
"wr",
"*",
"Wrangler",
")",
"GetVersion",
"(",
"ctx",
"context",
".",
"Context",
",",
"tabletAlias",
"*",
"topodatapb",
".",
"TabletAlias",
")",
"(",
"string",
",",
"error",
")",
"{",
"tablet",
",",
"err",
":=",
"wr",
".",
"ts",
".",
"Ge... | // GetVersion returns the version string from a tablet | [
"GetVersion",
"returns",
"the",
"version",
"string",
"from",
"a",
"tablet"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/wrangler/version.go#L72-L84 |
136,316 | vitessio/vitess | go/vt/wrangler/version.go | diffVersion | func (wr *Wrangler) diffVersion(ctx context.Context, masterVersion string, masterAlias *topodatapb.TabletAlias, alias *topodatapb.TabletAlias, wg *sync.WaitGroup, er concurrency.ErrorRecorder) {
defer wg.Done()
log.Infof("Gathering version for %v", topoproto.TabletAliasString(alias))
slaveVersion, err := wr.GetVersi... | go | func (wr *Wrangler) diffVersion(ctx context.Context, masterVersion string, masterAlias *topodatapb.TabletAlias, alias *topodatapb.TabletAlias, wg *sync.WaitGroup, er concurrency.ErrorRecorder) {
defer wg.Done()
log.Infof("Gathering version for %v", topoproto.TabletAliasString(alias))
slaveVersion, err := wr.GetVersi... | [
"func",
"(",
"wr",
"*",
"Wrangler",
")",
"diffVersion",
"(",
"ctx",
"context",
".",
"Context",
",",
"masterVersion",
"string",
",",
"masterAlias",
"*",
"topodatapb",
".",
"TabletAlias",
",",
"alias",
"*",
"topodatapb",
".",
"TabletAlias",
",",
"wg",
"*",
"... | // helper method to asynchronously get and diff a version | [
"helper",
"method",
"to",
"asynchronously",
"get",
"and",
"diff",
"a",
"version"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/wrangler/version.go#L87-L99 |
136,317 | vitessio/vitess | go/vt/wrangler/version.go | ValidateVersionShard | func (wr *Wrangler) ValidateVersionShard(ctx context.Context, keyspace, shard string) error {
si, err := wr.ts.GetShard(ctx, keyspace, shard)
if err != nil {
return err
}
// get version from the master, or error
if !si.HasMaster() {
return fmt.Errorf("no master in shard %v/%v", keyspace, shard)
}
log.Infof(... | go | func (wr *Wrangler) ValidateVersionShard(ctx context.Context, keyspace, shard string) error {
si, err := wr.ts.GetShard(ctx, keyspace, shard)
if err != nil {
return err
}
// get version from the master, or error
if !si.HasMaster() {
return fmt.Errorf("no master in shard %v/%v", keyspace, shard)
}
log.Infof(... | [
"func",
"(",
"wr",
"*",
"Wrangler",
")",
"ValidateVersionShard",
"(",
"ctx",
"context",
".",
"Context",
",",
"keyspace",
",",
"shard",
"string",
")",
"error",
"{",
"si",
",",
"err",
":=",
"wr",
".",
"ts",
".",
"GetShard",
"(",
"ctx",
",",
"keyspace",
... | // ValidateVersionShard validates all versions are the same in all
// tablets in a shard | [
"ValidateVersionShard",
"validates",
"all",
"versions",
"are",
"the",
"same",
"in",
"all",
"tablets",
"in",
"a",
"shard"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/wrangler/version.go#L103-L142 |
136,318 | vitessio/vitess | go/vt/wrangler/version.go | ValidateVersionKeyspace | func (wr *Wrangler) ValidateVersionKeyspace(ctx context.Context, keyspace string) error {
// find all the shards
shards, err := wr.ts.GetShardNames(ctx, keyspace)
if err != nil {
return err
}
// corner cases
if len(shards) == 0 {
return fmt.Errorf("no shards in keyspace %v", keyspace)
}
sort.Strings(shards... | go | func (wr *Wrangler) ValidateVersionKeyspace(ctx context.Context, keyspace string) error {
// find all the shards
shards, err := wr.ts.GetShardNames(ctx, keyspace)
if err != nil {
return err
}
// corner cases
if len(shards) == 0 {
return fmt.Errorf("no shards in keyspace %v", keyspace)
}
sort.Strings(shards... | [
"func",
"(",
"wr",
"*",
"Wrangler",
")",
"ValidateVersionKeyspace",
"(",
"ctx",
"context",
".",
"Context",
",",
"keyspace",
"string",
")",
"error",
"{",
"// find all the shards",
"shards",
",",
"err",
":=",
"wr",
".",
"ts",
".",
"GetShardNames",
"(",
"ctx",
... | // ValidateVersionKeyspace validates all versions are the same in all
// tablets in a keyspace | [
"ValidateVersionKeyspace",
"validates",
"all",
"versions",
"are",
"the",
"same",
"in",
"all",
"tablets",
"in",
"a",
"keyspace"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/wrangler/version.go#L146-L201 |
136,319 | vitessio/vitess | go/vt/vtgate/vtgate.go | Execute | func (vtg *VTGate) Execute(ctx context.Context, session *vtgatepb.Session, sql string, bindVariables map[string]*querypb.BindVariable) (newSession *vtgatepb.Session, qr *sqltypes.Result, err error) {
// In this context, we don't care if we can't fully parse destination
destKeyspace, destTabletType, _, _ := vtg.execut... | go | func (vtg *VTGate) Execute(ctx context.Context, session *vtgatepb.Session, sql string, bindVariables map[string]*querypb.BindVariable) (newSession *vtgatepb.Session, qr *sqltypes.Result, err error) {
// In this context, we don't care if we can't fully parse destination
destKeyspace, destTabletType, _, _ := vtg.execut... | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"Execute",
"(",
"ctx",
"context",
".",
"Context",
",",
"session",
"*",
"vtgatepb",
".",
"Session",
",",
"sql",
"string",
",",
"bindVariables",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
")",
... | // Execute executes a non-streaming query. This is a V3 function. | [
"Execute",
"executes",
"a",
"non",
"-",
"streaming",
"query",
".",
"This",
"is",
"a",
"V3",
"function",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L276-L301 |
136,320 | vitessio/vitess | go/vt/vtgate/vtgate.go | ExecuteBatch | func (vtg *VTGate) ExecuteBatch(ctx context.Context, session *vtgatepb.Session, sqlList []string, bindVariablesList []map[string]*querypb.BindVariable) (*vtgatepb.Session, []sqltypes.QueryResponse, error) {
// In this context, we don't care if we can't fully parse destination
destKeyspace, destTabletType, _, _ := vtg... | go | func (vtg *VTGate) ExecuteBatch(ctx context.Context, session *vtgatepb.Session, sqlList []string, bindVariablesList []map[string]*querypb.BindVariable) (*vtgatepb.Session, []sqltypes.QueryResponse, error) {
// In this context, we don't care if we can't fully parse destination
destKeyspace, destTabletType, _, _ := vtg... | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"ExecuteBatch",
"(",
"ctx",
"context",
".",
"Context",
",",
"session",
"*",
"vtgatepb",
".",
"Session",
",",
"sqlList",
"[",
"]",
"string",
",",
"bindVariablesList",
"[",
"]",
"map",
"[",
"string",
"]",
"*",
"que... | // ExecuteBatch executes a batch of queries. This is a V3 function. | [
"ExecuteBatch",
"executes",
"a",
"batch",
"of",
"queries",
".",
"This",
"is",
"a",
"V3",
"function",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L304-L328 |
136,321 | vitessio/vitess | go/vt/vtgate/vtgate.go | StreamExecute | func (vtg *VTGate) StreamExecute(ctx context.Context, session *vtgatepb.Session, sql string, bindVariables map[string]*querypb.BindVariable, callback func(*sqltypes.Result) error) error {
// In this context, we don't care if we can't fully parse destination
destKeyspace, destTabletType, dest, _ := vtg.executor.ParseD... | go | func (vtg *VTGate) StreamExecute(ctx context.Context, session *vtgatepb.Session, sql string, bindVariables map[string]*querypb.BindVariable, callback func(*sqltypes.Result) error) error {
// In this context, we don't care if we can't fully parse destination
destKeyspace, destTabletType, dest, _ := vtg.executor.ParseD... | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"StreamExecute",
"(",
"ctx",
"context",
".",
"Context",
",",
"session",
"*",
"vtgatepb",
".",
"Session",
",",
"sql",
"string",
",",
"bindVariables",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
"... | // StreamExecute executes a streaming query. This is a V3 function.
// Note we guarantee the callback will not be called concurrently
// by mutiple go routines. | [
"StreamExecute",
"executes",
"a",
"streaming",
"query",
".",
"This",
"is",
"a",
"V3",
"function",
".",
"Note",
"we",
"guarantee",
"the",
"callback",
"will",
"not",
"be",
"called",
"concurrently",
"by",
"mutiple",
"go",
"routines",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L333-L388 |
136,322 | vitessio/vitess | go/vt/vtgate/vtgate.go | ExecuteKeyRanges | func (vtg *VTGate) ExecuteKeyRanges(ctx context.Context, sql string, bindVariables map[string]*querypb.BindVariable, keyspace string, keyRanges []*topodatapb.KeyRange, tabletType topodatapb.TabletType, session *vtgatepb.Session, notInTransaction bool, options *querypb.ExecuteOptions) (*sqltypes.Result, error) {
startT... | go | func (vtg *VTGate) ExecuteKeyRanges(ctx context.Context, sql string, bindVariables map[string]*querypb.BindVariable, keyspace string, keyRanges []*topodatapb.KeyRange, tabletType topodatapb.TabletType, session *vtgatepb.Session, notInTransaction bool, options *querypb.ExecuteOptions) (*sqltypes.Result, error) {
startT... | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"ExecuteKeyRanges",
"(",
"ctx",
"context",
".",
"Context",
",",
"sql",
"string",
",",
"bindVariables",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
",",
"keyspace",
"string",
",",
"keyRanges",
"[",... | // ExecuteKeyRanges executes a non-streaming query based on the specified keyranges. This is a legacy function. | [
"ExecuteKeyRanges",
"executes",
"a",
"non",
"-",
"streaming",
"query",
"based",
"on",
"the",
"specified",
"keyranges",
".",
"This",
"is",
"a",
"legacy",
"function",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L483-L518 |
136,323 | vitessio/vitess | go/vt/vtgate/vtgate.go | ExecuteBatchShards | func (vtg *VTGate) ExecuteBatchShards(ctx context.Context, queries []*vtgatepb.BoundShardQuery, tabletType topodatapb.TabletType, asTransaction bool, session *vtgatepb.Session, options *querypb.ExecuteOptions) ([]sqltypes.Result, error) {
startTime := time.Now()
ltt := topoproto.TabletTypeLString(tabletType)
statsKe... | go | func (vtg *VTGate) ExecuteBatchShards(ctx context.Context, queries []*vtgatepb.BoundShardQuery, tabletType topodatapb.TabletType, asTransaction bool, session *vtgatepb.Session, options *querypb.ExecuteOptions) ([]sqltypes.Result, error) {
startTime := time.Now()
ltt := topoproto.TabletTypeLString(tabletType)
statsKe... | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"ExecuteBatchShards",
"(",
"ctx",
"context",
".",
"Context",
",",
"queries",
"[",
"]",
"*",
"vtgatepb",
".",
"BoundShardQuery",
",",
"tabletType",
"topodatapb",
".",
"TabletType",
",",
"asTransaction",
"bool",
",",
"se... | // ExecuteBatchShards executes a group of queries on the specified shards. This is a legacy function. | [
"ExecuteBatchShards",
"executes",
"a",
"group",
"of",
"queries",
"on",
"the",
"specified",
"shards",
".",
"This",
"is",
"a",
"legacy",
"function",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L560-L606 |
136,324 | vitessio/vitess | go/vt/vtgate/vtgate.go | StreamExecuteKeyspaceIds | func (vtg *VTGate) StreamExecuteKeyspaceIds(ctx context.Context, sql string, bindVariables map[string]*querypb.BindVariable, keyspace string, keyspaceIds [][]byte, tabletType topodatapb.TabletType, options *querypb.ExecuteOptions, callback func(*sqltypes.Result) error) error {
startTime := time.Now()
ltt := topoproto... | go | func (vtg *VTGate) StreamExecuteKeyspaceIds(ctx context.Context, sql string, bindVariables map[string]*querypb.BindVariable, keyspace string, keyspaceIds [][]byte, tabletType topodatapb.TabletType, options *querypb.ExecuteOptions, callback func(*sqltypes.Result) error) error {
startTime := time.Now()
ltt := topoproto... | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"StreamExecuteKeyspaceIds",
"(",
"ctx",
"context",
".",
"Context",
",",
"sql",
"string",
",",
"bindVariables",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
",",
"keyspace",
"string",
",",
"keyspaceId... | // StreamExecuteKeyspaceIds executes a streaming query on the specified KeyspaceIds.
// The KeyspaceIds are resolved to shards using the serving graph.
// This function currently temporarily enforces the restriction of executing on
// one shard since it cannot merge-sort the results to guarantee ordering of
// response... | [
"StreamExecuteKeyspaceIds",
"executes",
"a",
"streaming",
"query",
"on",
"the",
"specified",
"KeyspaceIds",
".",
"The",
"KeyspaceIds",
"are",
"resolved",
"to",
"shards",
"using",
"the",
"serving",
"graph",
".",
"This",
"function",
"currently",
"temporarily",
"enforc... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L665-L704 |
136,325 | vitessio/vitess | go/vt/vtgate/vtgate.go | Begin | func (vtg *VTGate) Begin(ctx context.Context, singledb bool) (*vtgatepb.Session, error) {
if !singledb && vtg.txConn.mode == vtgatepb.TransactionMode_SINGLE {
return nil, vterrors.New(vtrpcpb.Code_INVALID_ARGUMENT, "multi-db transaction disallowed")
}
return &vtgatepb.Session{
InTransaction: true,
SingleDb: ... | go | func (vtg *VTGate) Begin(ctx context.Context, singledb bool) (*vtgatepb.Session, error) {
if !singledb && vtg.txConn.mode == vtgatepb.TransactionMode_SINGLE {
return nil, vterrors.New(vtrpcpb.Code_INVALID_ARGUMENT, "multi-db transaction disallowed")
}
return &vtgatepb.Session{
InTransaction: true,
SingleDb: ... | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"Begin",
"(",
"ctx",
"context",
".",
"Context",
",",
"singledb",
"bool",
")",
"(",
"*",
"vtgatepb",
".",
"Session",
",",
"error",
")",
"{",
"if",
"!",
"singledb",
"&&",
"vtg",
".",
"txConn",
".",
"mode",
"=="... | // Begin begins a transaction. This is a legacy function. | [
"Begin",
"begins",
"a",
"transaction",
".",
"This",
"is",
"a",
"legacy",
"function",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L800-L808 |
136,326 | vitessio/vitess | go/vt/vtgate/vtgate.go | Commit | func (vtg *VTGate) Commit(ctx context.Context, twopc bool, session *vtgatepb.Session) error {
if session == nil {
return formatError(vterrors.New(vtrpcpb.Code_INVALID_ARGUMENT, "cannot commit: empty session"))
}
if !session.InTransaction {
return formatError(vterrors.New(vtrpcpb.Code_ABORTED, "cannot commit: not... | go | func (vtg *VTGate) Commit(ctx context.Context, twopc bool, session *vtgatepb.Session) error {
if session == nil {
return formatError(vterrors.New(vtrpcpb.Code_INVALID_ARGUMENT, "cannot commit: empty session"))
}
if !session.InTransaction {
return formatError(vterrors.New(vtrpcpb.Code_ABORTED, "cannot commit: not... | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"Commit",
"(",
"ctx",
"context",
".",
"Context",
",",
"twopc",
"bool",
",",
"session",
"*",
"vtgatepb",
".",
"Session",
")",
"error",
"{",
"if",
"session",
"==",
"nil",
"{",
"return",
"formatError",
"(",
"vterror... | // Commit commits a transaction. This is a legacy function. | [
"Commit",
"commits",
"a",
"transaction",
".",
"This",
"is",
"a",
"legacy",
"function",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L811-L822 |
136,327 | vitessio/vitess | go/vt/vtgate/vtgate.go | Rollback | func (vtg *VTGate) Rollback(ctx context.Context, session *vtgatepb.Session) error {
return formatError(vtg.txConn.Rollback(ctx, NewSafeSession(session)))
} | go | func (vtg *VTGate) Rollback(ctx context.Context, session *vtgatepb.Session) error {
return formatError(vtg.txConn.Rollback(ctx, NewSafeSession(session)))
} | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"Rollback",
"(",
"ctx",
"context",
".",
"Context",
",",
"session",
"*",
"vtgatepb",
".",
"Session",
")",
"error",
"{",
"return",
"formatError",
"(",
"vtg",
".",
"txConn",
".",
"Rollback",
"(",
"ctx",
",",
"NewSaf... | // Rollback rolls back a transaction. This is a legacy function. | [
"Rollback",
"rolls",
"back",
"a",
"transaction",
".",
"This",
"is",
"a",
"legacy",
"function",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L825-L827 |
136,328 | vitessio/vitess | go/vt/vtgate/vtgate.go | ResolveTransaction | func (vtg *VTGate) ResolveTransaction(ctx context.Context, dtid string) error {
return formatError(vtg.txConn.Resolve(ctx, dtid))
} | go | func (vtg *VTGate) ResolveTransaction(ctx context.Context, dtid string) error {
return formatError(vtg.txConn.Resolve(ctx, dtid))
} | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"ResolveTransaction",
"(",
"ctx",
"context",
".",
"Context",
",",
"dtid",
"string",
")",
"error",
"{",
"return",
"formatError",
"(",
"vtg",
".",
"txConn",
".",
"Resolve",
"(",
"ctx",
",",
"dtid",
")",
")",
"\n",
... | // ResolveTransaction resolves the specified 2PC transaction. | [
"ResolveTransaction",
"resolves",
"the",
"specified",
"2PC",
"transaction",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L830-L832 |
136,329 | vitessio/vitess | go/vt/vtgate/vtgate.go | GetSrvKeyspace | func (vtg *VTGate) GetSrvKeyspace(ctx context.Context, keyspace string) (*topodatapb.SrvKeyspace, error) {
return vtg.resolver.toposerv.GetSrvKeyspace(ctx, vtg.resolver.cell, keyspace)
} | go | func (vtg *VTGate) GetSrvKeyspace(ctx context.Context, keyspace string) (*topodatapb.SrvKeyspace, error) {
return vtg.resolver.toposerv.GetSrvKeyspace(ctx, vtg.resolver.cell, keyspace)
} | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"GetSrvKeyspace",
"(",
"ctx",
"context",
".",
"Context",
",",
"keyspace",
"string",
")",
"(",
"*",
"topodatapb",
".",
"SrvKeyspace",
",",
"error",
")",
"{",
"return",
"vtg",
".",
"resolver",
".",
"toposerv",
".",
... | // GetSrvKeyspace is part of the vtgate service API. | [
"GetSrvKeyspace",
"is",
"part",
"of",
"the",
"vtgate",
"service",
"API",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L939-L941 |
136,330 | vitessio/vitess | go/vt/vtgate/vtgate.go | MessageStream | func (vtg *VTGate) MessageStream(ctx context.Context, keyspace string, shard string, keyRange *topodatapb.KeyRange, name string, callback func(*sqltypes.Result) error) error {
startTime := time.Now()
ltt := topoproto.TabletTypeLString(topodatapb.TabletType_MASTER)
statsKey := []string{"MessageStream", keyspace, ltt}... | go | func (vtg *VTGate) MessageStream(ctx context.Context, keyspace string, shard string, keyRange *topodatapb.KeyRange, name string, callback func(*sqltypes.Result) error) error {
startTime := time.Now()
ltt := topoproto.TabletTypeLString(topodatapb.TabletType_MASTER)
statsKey := []string{"MessageStream", keyspace, ltt}... | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"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.
// Note we guarantee the callback will not be called concurrently
// by mutiple go routines. | [
"MessageStream",
"is",
"part",
"of",
"the",
"vtgate",
"service",
"API",
".",
"This",
"is",
"a",
"V2",
"level",
"API",
"that",
"s",
"sent",
"to",
"the",
"Resolver",
".",
"Note",
"we",
"guarantee",
"the",
"callback",
"will",
"not",
"be",
"called",
"concurr... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L947-L972 |
136,331 | vitessio/vitess | go/vt/vtgate/vtgate.go | UpdateStream | func (vtg *VTGate) UpdateStream(ctx context.Context, keyspace string, shard string, keyRange *topodatapb.KeyRange, tabletType topodatapb.TabletType, timestamp int64, event *querypb.EventToken, callback func(*querypb.StreamEvent, int64) error) error {
startTime := time.Now()
ltt := topoproto.TabletTypeLString(tabletTy... | go | func (vtg *VTGate) UpdateStream(ctx context.Context, keyspace string, shard string, keyRange *topodatapb.KeyRange, tabletType topodatapb.TabletType, timestamp int64, event *querypb.EventToken, callback func(*querypb.StreamEvent, int64) error) error {
startTime := time.Now()
ltt := topoproto.TabletTypeLString(tabletTy... | [
"func",
"(",
"vtg",
"*",
"VTGate",
")",
"UpdateStream",
"(",
"ctx",
"context",
".",
"Context",
",",
"keyspace",
"string",
",",
"shard",
"string",
",",
"keyRange",
"*",
"topodatapb",
".",
"KeyRange",
",",
"tabletType",
"topodatapb",
".",
"TabletType",
",",
... | // UpdateStream is part of the vtgate service API.
// Note we guarantee the callback will not be called concurrently
// by mutiple go routines, as the current implementation can only target
// one shard. | [
"UpdateStream",
"is",
"part",
"of",
"the",
"vtgate",
"service",
"API",
".",
"Note",
"we",
"guarantee",
"the",
"callback",
"will",
"not",
"be",
"called",
"concurrently",
"by",
"mutiple",
"go",
"routines",
"as",
"the",
"current",
"implementation",
"can",
"only",... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L1016-L1043 |
136,332 | vitessio/vitess | go/vt/vtgate/vtgate.go | annotateBoundKeyspaceIDQueries | func annotateBoundKeyspaceIDQueries(queries []*vtgatepb.BoundKeyspaceIdQuery) {
for i, q := range queries {
queries[i].Query.Sql = sqlannotation.AnnotateIfDML(q.Query.Sql, q.KeyspaceIds)
}
} | go | func annotateBoundKeyspaceIDQueries(queries []*vtgatepb.BoundKeyspaceIdQuery) {
for i, q := range queries {
queries[i].Query.Sql = sqlannotation.AnnotateIfDML(q.Query.Sql, q.KeyspaceIds)
}
} | [
"func",
"annotateBoundKeyspaceIDQueries",
"(",
"queries",
"[",
"]",
"*",
"vtgatepb",
".",
"BoundKeyspaceIdQuery",
")",
"{",
"for",
"i",
",",
"q",
":=",
"range",
"queries",
"{",
"queries",
"[",
"i",
"]",
".",
"Query",
".",
"Sql",
"=",
"sqlannotation",
".",
... | // Helper function used in ExecuteBatchKeyspaceIds | [
"Helper",
"function",
"used",
"in",
"ExecuteBatchKeyspaceIds"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L1114-L1118 |
136,333 | vitessio/vitess | go/vt/vtgate/vtgate.go | annotateBoundShardQueriesAsUnfriendly | func annotateBoundShardQueriesAsUnfriendly(queries []*vtgatepb.BoundShardQuery) {
for i, q := range queries {
queries[i].Query.Sql = sqlannotation.AnnotateIfDML(q.Query.Sql, nil)
}
} | go | func annotateBoundShardQueriesAsUnfriendly(queries []*vtgatepb.BoundShardQuery) {
for i, q := range queries {
queries[i].Query.Sql = sqlannotation.AnnotateIfDML(q.Query.Sql, nil)
}
} | [
"func",
"annotateBoundShardQueriesAsUnfriendly",
"(",
"queries",
"[",
"]",
"*",
"vtgatepb",
".",
"BoundShardQuery",
")",
"{",
"for",
"i",
",",
"q",
":=",
"range",
"queries",
"{",
"queries",
"[",
"i",
"]",
".",
"Query",
".",
"Sql",
"=",
"sqlannotation",
"."... | // Helper function used in ExecuteBatchShards | [
"Helper",
"function",
"used",
"in",
"ExecuteBatchShards"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L1121-L1125 |
136,334 | vitessio/vitess | go/vt/vtgate/vtgate.go | unambiguousKeyspaceBKSIQ | func unambiguousKeyspaceBKSIQ(queries []*vtgatepb.BoundKeyspaceIdQuery) string {
switch len(queries) {
case 0:
return ""
case 1:
return queries[0].Keyspace
default:
keyspace := queries[0].Keyspace
for _, q := range queries[1:] {
if q.Keyspace != keyspace {
// Request targets at least two different ke... | go | func unambiguousKeyspaceBKSIQ(queries []*vtgatepb.BoundKeyspaceIdQuery) string {
switch len(queries) {
case 0:
return ""
case 1:
return queries[0].Keyspace
default:
keyspace := queries[0].Keyspace
for _, q := range queries[1:] {
if q.Keyspace != keyspace {
// Request targets at least two different ke... | [
"func",
"unambiguousKeyspaceBKSIQ",
"(",
"queries",
"[",
"]",
"*",
"vtgatepb",
".",
"BoundKeyspaceIdQuery",
")",
"string",
"{",
"switch",
"len",
"(",
"queries",
")",
"{",
"case",
"0",
":",
"return",
"\"",
"\"",
"\n",
"case",
"1",
":",
"return",
"queries",
... | // unambiguousKeyspaceBKSIQ is a helper function used in the
// ExecuteBatchKeyspaceIds method to determine the "keyspace" label for the
// stats reporting.
// If all queries target the same keyspace, it returns that keyspace.
// Otherwise it returns an empty string. | [
"unambiguousKeyspaceBKSIQ",
"is",
"a",
"helper",
"function",
"used",
"in",
"the",
"ExecuteBatchKeyspaceIds",
"method",
"to",
"determine",
"the",
"keyspace",
"label",
"for",
"the",
"stats",
"reporting",
".",
"If",
"all",
"queries",
"target",
"the",
"same",
"keyspac... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L1132-L1148 |
136,335 | vitessio/vitess | go/vt/vtgate/vtgate.go | unambiguousKeyspaceBSQ | func unambiguousKeyspaceBSQ(queries []*vtgatepb.BoundShardQuery) string {
switch len(queries) {
case 0:
return ""
case 1:
return queries[0].Keyspace
default:
keyspace := queries[0].Keyspace
for _, q := range queries[1:] {
if q.Keyspace != keyspace {
// Request targets at least two different keyspaces... | go | func unambiguousKeyspaceBSQ(queries []*vtgatepb.BoundShardQuery) string {
switch len(queries) {
case 0:
return ""
case 1:
return queries[0].Keyspace
default:
keyspace := queries[0].Keyspace
for _, q := range queries[1:] {
if q.Keyspace != keyspace {
// Request targets at least two different keyspaces... | [
"func",
"unambiguousKeyspaceBSQ",
"(",
"queries",
"[",
"]",
"*",
"vtgatepb",
".",
"BoundShardQuery",
")",
"string",
"{",
"switch",
"len",
"(",
"queries",
")",
"{",
"case",
"0",
":",
"return",
"\"",
"\"",
"\n",
"case",
"1",
":",
"return",
"queries",
"[",
... | // unambiguousKeyspaceBSQ is the same as unambiguousKeyspaceBKSIQ but for the
// ExecuteBatchShards method. We are intentionally duplicating the code here and
// do not try to generalize it because this may be less performant. | [
"unambiguousKeyspaceBSQ",
"is",
"the",
"same",
"as",
"unambiguousKeyspaceBKSIQ",
"but",
"for",
"the",
"ExecuteBatchShards",
"method",
".",
"We",
"are",
"intentionally",
"duplicating",
"the",
"code",
"here",
"and",
"do",
"not",
"try",
"to",
"generalize",
"it",
"bec... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/vtgate.go#L1153-L1169 |
136,336 | vitessio/vitess | go/vt/throttler/grpcthrottlerclient/grpcthrottlerclient.go | MaxRates | func (c *client) MaxRates(ctx context.Context) (map[string]int64, error) {
response, err := c.gRPCClient.MaxRates(ctx, &throttlerdatapb.MaxRatesRequest{})
if err != nil {
return nil, vterrors.FromGRPC(err)
}
return response.Rates, nil
} | go | func (c *client) MaxRates(ctx context.Context) (map[string]int64, error) {
response, err := c.gRPCClient.MaxRates(ctx, &throttlerdatapb.MaxRatesRequest{})
if err != nil {
return nil, vterrors.FromGRPC(err)
}
return response.Rates, nil
} | [
"func",
"(",
"c",
"*",
"client",
")",
"MaxRates",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"map",
"[",
"string",
"]",
"int64",
",",
"error",
")",
"{",
"response",
",",
"err",
":=",
"c",
".",
"gRPCClient",
".",
"MaxRates",
"(",
"ctx",
",",
... | // MaxRates is part of the throttlerclient.Client interface and returns the
// current max rate for each throttler of the process. | [
"MaxRates",
"is",
"part",
"of",
"the",
"throttlerclient",
".",
"Client",
"interface",
"and",
"returns",
"the",
"current",
"max",
"rate",
"for",
"each",
"throttler",
"of",
"the",
"process",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/grpcthrottlerclient/grpcthrottlerclient.go#L62-L68 |
136,337 | vitessio/vitess | go/vt/throttler/grpcthrottlerclient/grpcthrottlerclient.go | SetMaxRate | func (c *client) SetMaxRate(ctx context.Context, rate int64) ([]string, error) {
request := &throttlerdatapb.SetMaxRateRequest{
Rate: rate,
}
response, err := c.gRPCClient.SetMaxRate(ctx, request)
if err != nil {
return nil, vterrors.FromGRPC(err)
}
return response.Names, nil
} | go | func (c *client) SetMaxRate(ctx context.Context, rate int64) ([]string, error) {
request := &throttlerdatapb.SetMaxRateRequest{
Rate: rate,
}
response, err := c.gRPCClient.SetMaxRate(ctx, request)
if err != nil {
return nil, vterrors.FromGRPC(err)
}
return response.Names, nil
} | [
"func",
"(",
"c",
"*",
"client",
")",
"SetMaxRate",
"(",
"ctx",
"context",
".",
"Context",
",",
"rate",
"int64",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"request",
":=",
"&",
"throttlerdatapb",
".",
"SetMaxRateRequest",
"{",
"Rate",
":",
... | // SetMaxRate is part of the throttlerclient.Client interface and sets the rate
// on all throttlers of the server. | [
"SetMaxRate",
"is",
"part",
"of",
"the",
"throttlerclient",
".",
"Client",
"interface",
"and",
"sets",
"the",
"rate",
"on",
"all",
"throttlers",
"of",
"the",
"server",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/grpcthrottlerclient/grpcthrottlerclient.go#L72-L82 |
136,338 | vitessio/vitess | go/vt/throttler/grpcthrottlerclient/grpcthrottlerclient.go | GetConfiguration | func (c *client) GetConfiguration(ctx context.Context, throttlerName string) (map[string]*throttlerdatapb.Configuration, error) {
response, err := c.gRPCClient.GetConfiguration(ctx, &throttlerdatapb.GetConfigurationRequest{
ThrottlerName: throttlerName,
})
if err != nil {
return nil, vterrors.FromGRPC(err)
}
r... | go | func (c *client) GetConfiguration(ctx context.Context, throttlerName string) (map[string]*throttlerdatapb.Configuration, error) {
response, err := c.gRPCClient.GetConfiguration(ctx, &throttlerdatapb.GetConfigurationRequest{
ThrottlerName: throttlerName,
})
if err != nil {
return nil, vterrors.FromGRPC(err)
}
r... | [
"func",
"(",
"c",
"*",
"client",
")",
"GetConfiguration",
"(",
"ctx",
"context",
".",
"Context",
",",
"throttlerName",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"*",
"throttlerdatapb",
".",
"Configuration",
",",
"error",
")",
"{",
"response",
",",
"... | // GetConfiguration is part of the throttlerclient.Client interface. | [
"GetConfiguration",
"is",
"part",
"of",
"the",
"throttlerclient",
".",
"Client",
"interface",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/grpcthrottlerclient/grpcthrottlerclient.go#L85-L93 |
136,339 | vitessio/vitess | go/vt/throttler/grpcthrottlerclient/grpcthrottlerclient.go | UpdateConfiguration | func (c *client) UpdateConfiguration(ctx context.Context, throttlerName string, configuration *throttlerdatapb.Configuration, copyZeroValues bool) ([]string, error) {
response, err := c.gRPCClient.UpdateConfiguration(ctx, &throttlerdatapb.UpdateConfigurationRequest{
ThrottlerName: throttlerName,
Configuration: c... | go | func (c *client) UpdateConfiguration(ctx context.Context, throttlerName string, configuration *throttlerdatapb.Configuration, copyZeroValues bool) ([]string, error) {
response, err := c.gRPCClient.UpdateConfiguration(ctx, &throttlerdatapb.UpdateConfigurationRequest{
ThrottlerName: throttlerName,
Configuration: c... | [
"func",
"(",
"c",
"*",
"client",
")",
"UpdateConfiguration",
"(",
"ctx",
"context",
".",
"Context",
",",
"throttlerName",
"string",
",",
"configuration",
"*",
"throttlerdatapb",
".",
"Configuration",
",",
"copyZeroValues",
"bool",
")",
"(",
"[",
"]",
"string",... | // UpdateConfiguration is part of the throttlerclient.Client interface. | [
"UpdateConfiguration",
"is",
"part",
"of",
"the",
"throttlerclient",
".",
"Client",
"interface",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/grpcthrottlerclient/grpcthrottlerclient.go#L96-L106 |
136,340 | vitessio/vitess | go/vt/throttler/grpcthrottlerclient/grpcthrottlerclient.go | ResetConfiguration | func (c *client) ResetConfiguration(ctx context.Context, throttlerName string) ([]string, error) {
response, err := c.gRPCClient.ResetConfiguration(ctx, &throttlerdatapb.ResetConfigurationRequest{
ThrottlerName: throttlerName,
})
if err != nil {
return nil, vterrors.FromGRPC(err)
}
return response.Names, nil
} | go | func (c *client) ResetConfiguration(ctx context.Context, throttlerName string) ([]string, error) {
response, err := c.gRPCClient.ResetConfiguration(ctx, &throttlerdatapb.ResetConfigurationRequest{
ThrottlerName: throttlerName,
})
if err != nil {
return nil, vterrors.FromGRPC(err)
}
return response.Names, nil
} | [
"func",
"(",
"c",
"*",
"client",
")",
"ResetConfiguration",
"(",
"ctx",
"context",
".",
"Context",
",",
"throttlerName",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"response",
",",
"err",
":=",
"c",
".",
"gRPCClient",
".",
"ResetCo... | // ResetConfiguration is part of the throttlerclient.Client interface. | [
"ResetConfiguration",
"is",
"part",
"of",
"the",
"throttlerclient",
".",
"Client",
"interface",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/throttler/grpcthrottlerclient/grpcthrottlerclient.go#L109-L117 |
136,341 | vitessio/vitess | go/vt/mysqlctl/reparent.go | PopulateReparentJournal | func PopulateReparentJournal(timeCreatedNS int64, actionName, masterAlias string, pos mysql.Position) string {
posStr := mysql.EncodePosition(pos)
if len(posStr) > mysql.MaximumPositionSize {
posStr = posStr[:mysql.MaximumPositionSize]
}
return fmt.Sprintf("INSERT INTO _vt.reparent_journal "+
"(time_created_ns,... | go | func PopulateReparentJournal(timeCreatedNS int64, actionName, masterAlias string, pos mysql.Position) string {
posStr := mysql.EncodePosition(pos)
if len(posStr) > mysql.MaximumPositionSize {
posStr = posStr[:mysql.MaximumPositionSize]
}
return fmt.Sprintf("INSERT INTO _vt.reparent_journal "+
"(time_created_ns,... | [
"func",
"PopulateReparentJournal",
"(",
"timeCreatedNS",
"int64",
",",
"actionName",
",",
"masterAlias",
"string",
",",
"pos",
"mysql",
".",
"Position",
")",
"string",
"{",
"posStr",
":=",
"mysql",
".",
"EncodePosition",
"(",
"pos",
")",
"\n",
"if",
"len",
"... | // PopulateReparentJournal returns the SQL command to use to populate
// the _vt.reparent_journal table, as well as the time_created_ns
// value used. | [
"PopulateReparentJournal",
"returns",
"the",
"SQL",
"command",
"to",
"use",
"to",
"populate",
"the",
"_vt",
".",
"reparent_journal",
"table",
"as",
"well",
"as",
"the",
"time_created_ns",
"value",
"used",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/reparent.go#L56-L65 |
136,342 | vitessio/vitess | go/vt/mysqlctl/reparent.go | WaitForReparentJournal | func (mysqld *Mysqld) WaitForReparentJournal(ctx context.Context, timeCreatedNS int64) error {
for {
qr, err := mysqld.FetchSuperQuery(ctx, queryReparentJournal(timeCreatedNS))
if err == nil && len(qr.Rows) == 1 {
// we have the row, we're done
return nil
}
// wait a little bit, interrupt if context is ... | go | func (mysqld *Mysqld) WaitForReparentJournal(ctx context.Context, timeCreatedNS int64) error {
for {
qr, err := mysqld.FetchSuperQuery(ctx, queryReparentJournal(timeCreatedNS))
if err == nil && len(qr.Rows) == 1 {
// we have the row, we're done
return nil
}
// wait a little bit, interrupt if context is ... | [
"func",
"(",
"mysqld",
"*",
"Mysqld",
")",
"WaitForReparentJournal",
"(",
"ctx",
"context",
".",
"Context",
",",
"timeCreatedNS",
"int64",
")",
"error",
"{",
"for",
"{",
"qr",
",",
"err",
":=",
"mysqld",
".",
"FetchSuperQuery",
"(",
"ctx",
",",
"queryRepar... | // WaitForReparentJournal will wait until the context is done for
// the row in the reparent_journal table. | [
"WaitForReparentJournal",
"will",
"wait",
"until",
"the",
"context",
"is",
"done",
"for",
"the",
"row",
"in",
"the",
"reparent_journal",
"table",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/reparent.go#L75-L91 |
136,343 | vitessio/vitess | go/vt/mysqlctl/reparent.go | DemoteMaster | func (mysqld *Mysqld) DemoteMaster() (rp mysql.Position, err error) {
cmds := []string{
"FLUSH TABLES WITH READ LOCK",
"UNLOCK TABLES",
}
if err = mysqld.ExecuteSuperQueryList(context.TODO(), cmds); err != nil {
return rp, err
}
return mysqld.MasterPosition()
} | go | func (mysqld *Mysqld) DemoteMaster() (rp mysql.Position, err error) {
cmds := []string{
"FLUSH TABLES WITH READ LOCK",
"UNLOCK TABLES",
}
if err = mysqld.ExecuteSuperQueryList(context.TODO(), cmds); err != nil {
return rp, err
}
return mysqld.MasterPosition()
} | [
"func",
"(",
"mysqld",
"*",
"Mysqld",
")",
"DemoteMaster",
"(",
")",
"(",
"rp",
"mysql",
".",
"Position",
",",
"err",
"error",
")",
"{",
"cmds",
":=",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"}",
"\n",
"if",
"err",
"=",
"mysq... | // DemoteMaster will gracefully demote a master mysql instance to read only.
// If the master is still alive, then we need to demote it gracefully
// make it read-only, flush the writes and get the position | [
"DemoteMaster",
"will",
"gracefully",
"demote",
"a",
"master",
"mysql",
"instance",
"to",
"read",
"only",
".",
"If",
"the",
"master",
"is",
"still",
"alive",
"then",
"we",
"need",
"to",
"demote",
"it",
"gracefully",
"make",
"it",
"read",
"-",
"only",
"flus... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/reparent.go#L96-L105 |
136,344 | vitessio/vitess | go/vt/mysqlctl/reparent.go | PromoteSlave | func (mysqld *Mysqld) PromoteSlave(hookExtraEnv map[string]string) (mysql.Position, error) {
ctx := context.TODO()
conn, err := getPoolReconnect(ctx, mysqld.dbaPool)
if err != nil {
return mysql.Position{}, err
}
defer conn.Recycle()
// Since we handle replication, just stop it.
cmds := []string{
conn.StopS... | go | func (mysqld *Mysqld) PromoteSlave(hookExtraEnv map[string]string) (mysql.Position, error) {
ctx := context.TODO()
conn, err := getPoolReconnect(ctx, mysqld.dbaPool)
if err != nil {
return mysql.Position{}, err
}
defer conn.Recycle()
// Since we handle replication, just stop it.
cmds := []string{
conn.StopS... | [
"func",
"(",
"mysqld",
"*",
"Mysqld",
")",
"PromoteSlave",
"(",
"hookExtraEnv",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"mysql",
".",
"Position",
",",
"error",
")",
"{",
"ctx",
":=",
"context",
".",
"TODO",
"(",
")",
"\n",
"conn",
",",
"err",
... | // PromoteSlave will promote a slave to be the new master. | [
"PromoteSlave",
"will",
"promote",
"a",
"slave",
"to",
"be",
"the",
"new",
"master",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/reparent.go#L108-L132 |
136,345 | vitessio/vitess | go/vt/vtgate/gateway/gateway.go | RegisterCreator | func RegisterCreator(name string, gc Creator) {
if _, ok := creators[name]; ok {
log.Fatalf("Gateway %s already exists", name)
}
creators[name] = gc
} | go | func RegisterCreator(name string, gc Creator) {
if _, ok := creators[name]; ok {
log.Fatalf("Gateway %s already exists", name)
}
creators[name] = gc
} | [
"func",
"RegisterCreator",
"(",
"name",
"string",
",",
"gc",
"Creator",
")",
"{",
"if",
"_",
",",
"ok",
":=",
"creators",
"[",
"name",
"]",
";",
"ok",
"{",
"log",
".",
"Fatalf",
"(",
"\"",
"\"",
",",
"name",
")",
"\n",
"}",
"\n",
"creators",
"[",... | // RegisterCreator registers a Creator with given name. | [
"RegisterCreator",
"registers",
"a",
"Creator",
"with",
"given",
"name",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/gateway/gateway.go#L88-L93 |
136,346 | vitessio/vitess | go/vt/vtgate/gateway/gateway.go | GetCreator | func GetCreator() Creator {
gc, ok := creators[*implementation]
if !ok {
log.Exitf("No gateway registered as %s", *implementation)
}
return gc
} | go | func GetCreator() Creator {
gc, ok := creators[*implementation]
if !ok {
log.Exitf("No gateway registered as %s", *implementation)
}
return gc
} | [
"func",
"GetCreator",
"(",
")",
"Creator",
"{",
"gc",
",",
"ok",
":=",
"creators",
"[",
"*",
"implementation",
"]",
"\n",
"if",
"!",
"ok",
"{",
"log",
".",
"Exitf",
"(",
"\"",
"\"",
",",
"*",
"implementation",
")",
"\n",
"}",
"\n",
"return",
"gc",
... | // GetCreator returns the Creator specified by the gateway_implementation flag. | [
"GetCreator",
"returns",
"the",
"Creator",
"specified",
"by",
"the",
"gateway_implementation",
"flag",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/gateway/gateway.go#L96-L102 |
136,347 | vitessio/vitess | go/stats/histogram.go | Add | func (h *Histogram) Add(value int64) {
for i := range h.labels {
if i == len(h.labels)-1 || value <= h.cutoffs[i] {
h.buckets[i].Add(1)
h.total.Add(value)
break
}
}
if h.hook != nil {
h.hook(value)
}
} | go | func (h *Histogram) Add(value int64) {
for i := range h.labels {
if i == len(h.labels)-1 || value <= h.cutoffs[i] {
h.buckets[i].Add(1)
h.total.Add(value)
break
}
}
if h.hook != nil {
h.hook(value)
}
} | [
"func",
"(",
"h",
"*",
"Histogram",
")",
"Add",
"(",
"value",
"int64",
")",
"{",
"for",
"i",
":=",
"range",
"h",
".",
"labels",
"{",
"if",
"i",
"==",
"len",
"(",
"h",
".",
"labels",
")",
"-",
"1",
"||",
"value",
"<=",
"h",
".",
"cutoffs",
"["... | // Add adds a new measurement to the Histogram. | [
"Add",
"adds",
"a",
"new",
"measurement",
"to",
"the",
"Histogram",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/stats/histogram.go#L77-L88 |
136,348 | vitessio/vitess | go/stats/histogram.go | Counts | func (h *Histogram) Counts() map[string]int64 {
counts := make(map[string]int64, len(h.labels))
for i, label := range h.labels {
counts[label] = h.buckets[i].Get()
}
return counts
} | go | func (h *Histogram) Counts() map[string]int64 {
counts := make(map[string]int64, len(h.labels))
for i, label := range h.labels {
counts[label] = h.buckets[i].Get()
}
return counts
} | [
"func",
"(",
"h",
"*",
"Histogram",
")",
"Counts",
"(",
")",
"map",
"[",
"string",
"]",
"int64",
"{",
"counts",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"int64",
",",
"len",
"(",
"h",
".",
"labels",
")",
")",
"\n",
"for",
"i",
",",
"label"... | // Counts returns a map from labels to the current count in the Histogram for that label. | [
"Counts",
"returns",
"a",
"map",
"from",
"labels",
"to",
"the",
"current",
"count",
"in",
"the",
"Histogram",
"for",
"that",
"label",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/stats/histogram.go#L116-L122 |
136,349 | vitessio/vitess | go/stats/histogram.go | Count | func (h *Histogram) Count() (count int64) {
for i := range h.buckets {
count += h.buckets[i].Get()
}
return
} | go | func (h *Histogram) Count() (count int64) {
for i := range h.buckets {
count += h.buckets[i].Get()
}
return
} | [
"func",
"(",
"h",
"*",
"Histogram",
")",
"Count",
"(",
")",
"(",
"count",
"int64",
")",
"{",
"for",
"i",
":=",
"range",
"h",
".",
"buckets",
"{",
"count",
"+=",
"h",
".",
"buckets",
"[",
"i",
"]",
".",
"Get",
"(",
")",
"\n",
"}",
"\n",
"retur... | // Count returns the number of times Add has been called. | [
"Count",
"returns",
"the",
"number",
"of",
"times",
"Add",
"has",
"been",
"called",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/stats/histogram.go#L130-L135 |
136,350 | vitessio/vitess | go/stats/histogram.go | Buckets | func (h *Histogram) Buckets() []int64 {
buckets := make([]int64, len(h.buckets))
for i := range h.buckets {
buckets[i] = h.buckets[i].Get()
}
return buckets
} | go | func (h *Histogram) Buckets() []int64 {
buckets := make([]int64, len(h.buckets))
for i := range h.buckets {
buckets[i] = h.buckets[i].Get()
}
return buckets
} | [
"func",
"(",
"h",
"*",
"Histogram",
")",
"Buckets",
"(",
")",
"[",
"]",
"int64",
"{",
"buckets",
":=",
"make",
"(",
"[",
"]",
"int64",
",",
"len",
"(",
"h",
".",
"buckets",
")",
")",
"\n",
"for",
"i",
":=",
"range",
"h",
".",
"buckets",
"{",
... | // Buckets returns a snapshot of the current values in all buckets. | [
"Buckets",
"returns",
"a",
"snapshot",
"of",
"the",
"current",
"values",
"in",
"all",
"buckets",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/stats/histogram.go#L158-L164 |
136,351 | vitessio/vitess | go/vt/callinfo/fakecallinfo/fakecallinfo.go | Text | func (fci *FakeCallInfo) Text() string {
return fmt.Sprintf("%s:%s(fakeRPC)", fci.Remote, fci.Method)
} | go | func (fci *FakeCallInfo) Text() string {
return fmt.Sprintf("%s:%s(fakeRPC)", fci.Remote, fci.Method)
} | [
"func",
"(",
"fci",
"*",
"FakeCallInfo",
")",
"Text",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"fci",
".",
"Remote",
",",
"fci",
".",
"Method",
")",
"\n",
"}"
] | // Text returns the text. | [
"Text",
"returns",
"the",
"text",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/callinfo/fakecallinfo/fakecallinfo.go#L43-L45 |
136,352 | vitessio/vitess | go/vt/mysqlctl/gcsbackupstorage/gcs.go | EndBackup | func (bh *GCSBackupHandle) EndBackup(ctx context.Context) error {
if bh.readOnly {
return fmt.Errorf("EndBackup cannot be called on read-only backup")
}
return nil
} | go | func (bh *GCSBackupHandle) EndBackup(ctx context.Context) error {
if bh.readOnly {
return fmt.Errorf("EndBackup cannot be called on read-only backup")
}
return nil
} | [
"func",
"(",
"bh",
"*",
"GCSBackupHandle",
")",
"EndBackup",
"(",
"ctx",
"context",
".",
"Context",
")",
"error",
"{",
"if",
"bh",
".",
"readOnly",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"... | // EndBackup implements BackupHandle. | [
"EndBackup",
"implements",
"BackupHandle",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/gcsbackupstorage/gcs.go#L78-L83 |
136,353 | vitessio/vitess | go/vt/mysqlctl/gcsbackupstorage/gcs.go | client | func (bs *GCSBackupStorage) client(ctx context.Context) (*storage.Client, error) {
bs.mu.Lock()
defer bs.mu.Unlock()
if bs._client == nil {
// The context needs to be valid for longer than just
// the creation context, so we create a new one, but
// keep the span information.
ctx = trace.CopySpan(context.Ba... | go | func (bs *GCSBackupStorage) client(ctx context.Context) (*storage.Client, error) {
bs.mu.Lock()
defer bs.mu.Unlock()
if bs._client == nil {
// The context needs to be valid for longer than just
// the creation context, so we create a new one, but
// keep the span information.
ctx = trace.CopySpan(context.Ba... | [
"func",
"(",
"bs",
"*",
"GCSBackupStorage",
")",
"client",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"*",
"storage",
".",
"Client",
",",
"error",
")",
"{",
"bs",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"bs",
".",
"mu",
".",
"Unloc... | // client returns the GCS Storage client instance.
// If there isn't one yet, it tries to create one. | [
"client",
"returns",
"the",
"GCS",
"Storage",
"client",
"instance",
".",
"If",
"there",
"isn",
"t",
"one",
"yet",
"it",
"tries",
"to",
"create",
"one",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/gcsbackupstorage/gcs.go#L224-L244 |
136,354 | vitessio/vitess | go/vt/mysqlctl/gcsbackupstorage/gcs.go | objName | func objName(parts ...string) string {
if *root != "" {
return *root + "/" + strings.Join(parts, "/")
}
return strings.Join(parts, "/")
} | go | func objName(parts ...string) string {
if *root != "" {
return *root + "/" + strings.Join(parts, "/")
}
return strings.Join(parts, "/")
} | [
"func",
"objName",
"(",
"parts",
"...",
"string",
")",
"string",
"{",
"if",
"*",
"root",
"!=",
"\"",
"\"",
"{",
"return",
"*",
"root",
"+",
"\"",
"\"",
"+",
"strings",
".",
"Join",
"(",
"parts",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
... | // objName joins path parts into an object name.
// Unlike path.Join, it doesn't collapse ".." or strip trailing slashes.
// It also adds the value of the -gcs_backup_storage_root flag if set. | [
"objName",
"joins",
"path",
"parts",
"into",
"an",
"object",
"name",
".",
"Unlike",
"path",
".",
"Join",
"it",
"doesn",
"t",
"collapse",
"..",
"or",
"strip",
"trailing",
"slashes",
".",
"It",
"also",
"adds",
"the",
"value",
"of",
"the",
"-",
"gcs_backup_... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/gcsbackupstorage/gcs.go#L249-L254 |
136,355 | vitessio/vitess | go/vt/automation/vtctlclient_wrapper.go | ExecuteVtctl | func ExecuteVtctl(ctx context.Context, server string, args []string) (string, error) {
var output bytes.Buffer
loggerToBufferFunc := createLoggerEventToBufferFunction(&output)
outputLogger := newOutputLogger(loggerToBufferFunc)
startMsg := fmt.Sprintf("Executing remote vtctl command: %v server: %v", args, server)
... | go | func ExecuteVtctl(ctx context.Context, server string, args []string) (string, error) {
var output bytes.Buffer
loggerToBufferFunc := createLoggerEventToBufferFunction(&output)
outputLogger := newOutputLogger(loggerToBufferFunc)
startMsg := fmt.Sprintf("Executing remote vtctl command: %v server: %v", args, server)
... | [
"func",
"ExecuteVtctl",
"(",
"ctx",
"context",
".",
"Context",
",",
"server",
"string",
",",
"args",
"[",
"]",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"var",
"output",
"bytes",
".",
"Buffer",
"\n",
"loggerToBufferFunc",
":=",
"createLoggerEve... | // ExecuteVtctl runs vtctl using vtctlclient. The stream of Event
// messages is concatenated into one output string.
// Additionally, the start and the end of the command will be logged to make
// it easier to debug which command was executed and how long it took. | [
"ExecuteVtctl",
"runs",
"vtctl",
"using",
"vtctlclient",
".",
"The",
"stream",
"of",
"Event",
"messages",
"is",
"concatenated",
"into",
"one",
"output",
"string",
".",
"Additionally",
"the",
"start",
"and",
"the",
"end",
"of",
"the",
"command",
"will",
"be",
... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/automation/vtctlclient_wrapper.go#L35-L54 |
136,356 | vitessio/vitess | go/vt/automation/vtctlclient_wrapper.go | createLoggerEventToBufferFunction | func createLoggerEventToBufferFunction(output *bytes.Buffer) func(*logutilpb.Event) {
return func(e *logutilpb.Event) {
logutil.EventToBuffer(e, output)
output.WriteRune('\n')
}
} | go | func createLoggerEventToBufferFunction(output *bytes.Buffer) func(*logutilpb.Event) {
return func(e *logutilpb.Event) {
logutil.EventToBuffer(e, output)
output.WriteRune('\n')
}
} | [
"func",
"createLoggerEventToBufferFunction",
"(",
"output",
"*",
"bytes",
".",
"Buffer",
")",
"func",
"(",
"*",
"logutilpb",
".",
"Event",
")",
"{",
"return",
"func",
"(",
"e",
"*",
"logutilpb",
".",
"Event",
")",
"{",
"logutil",
".",
"EventToBuffer",
"(",... | // createLoggerEventToBufferFunction returns a function to add LoggerEvent
// structs to a given buffer, one line per event.
// The buffer can be used to return a multi-line string with all events. | [
"createLoggerEventToBufferFunction",
"returns",
"a",
"function",
"to",
"add",
"LoggerEvent",
"structs",
"to",
"a",
"given",
"buffer",
"one",
"line",
"per",
"event",
".",
"The",
"buffer",
"can",
"be",
"used",
"to",
"return",
"a",
"multi",
"-",
"line",
"string",... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/automation/vtctlclient_wrapper.go#L59-L64 |
136,357 | vitessio/vitess | go/vt/grpcclient/client.go | RegisterGRPCDialOptions | func RegisterGRPCDialOptions(grpcDialOptionsFunc func(opts []grpc.DialOption) ([]grpc.DialOption, error)) {
grpcDialOptions = append(grpcDialOptions, grpcDialOptionsFunc)
} | go | func RegisterGRPCDialOptions(grpcDialOptionsFunc func(opts []grpc.DialOption) ([]grpc.DialOption, error)) {
grpcDialOptions = append(grpcDialOptions, grpcDialOptionsFunc)
} | [
"func",
"RegisterGRPCDialOptions",
"(",
"grpcDialOptionsFunc",
"func",
"(",
"opts",
"[",
"]",
"grpc",
".",
"DialOption",
")",
"(",
"[",
"]",
"grpc",
".",
"DialOption",
",",
"error",
")",
")",
"{",
"grpcDialOptions",
"=",
"append",
"(",
"grpcDialOptions",
","... | // RegisterGRPCDialOptions registers an implementation of AuthServer. | [
"RegisterGRPCDialOptions",
"registers",
"an",
"implementation",
"of",
"AuthServer",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/grpcclient/client.go#L51-L53 |
136,358 | vitessio/vitess | go/vt/grpcclient/client.go | Dial | func Dial(target string, failFast FailFast, opts ...grpc.DialOption) (*grpc.ClientConn, error) {
grpccommon.EnableTracingOpt()
newopts := []grpc.DialOption{
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(*grpccommon.MaxMessageSize),
grpc.MaxCallSendMsgSize(*grpccommon.MaxMessageSize),
grpc.FailFast(b... | go | func Dial(target string, failFast FailFast, opts ...grpc.DialOption) (*grpc.ClientConn, error) {
grpccommon.EnableTracingOpt()
newopts := []grpc.DialOption{
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(*grpccommon.MaxMessageSize),
grpc.MaxCallSendMsgSize(*grpccommon.MaxMessageSize),
grpc.FailFast(b... | [
"func",
"Dial",
"(",
"target",
"string",
",",
"failFast",
"FailFast",
",",
"opts",
"...",
"grpc",
".",
"DialOption",
")",
"(",
"*",
"grpc",
".",
"ClientConn",
",",
"error",
")",
"{",
"grpccommon",
".",
"EnableTracingOpt",
"(",
")",
"\n",
"newopts",
":=",... | // Dial creates a grpc connection to the given target.
// failFast is a non-optional parameter because callers are required to specify
// what that should be. | [
"Dial",
"creates",
"a",
"grpc",
"connection",
"to",
"the",
"given",
"target",
".",
"failFast",
"is",
"a",
"non",
"-",
"optional",
"parameter",
"because",
"callers",
"are",
"required",
"to",
"specify",
"what",
"that",
"should",
"be",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/grpcclient/client.go#L58-L100 |
136,359 | vitessio/vitess | go/vt/grpcclient/client.go | SecureDialOption | func SecureDialOption(cert, key, ca, name string) (grpc.DialOption, error) {
// No security options set, just return.
if (cert == "" || key == "") && ca == "" {
return grpc.WithInsecure(), nil
}
// Load the config.
config, err := vttls.ClientConfig(cert, key, ca, name)
if err != nil {
return nil, err
}
//... | go | func SecureDialOption(cert, key, ca, name string) (grpc.DialOption, error) {
// No security options set, just return.
if (cert == "" || key == "") && ca == "" {
return grpc.WithInsecure(), nil
}
// Load the config.
config, err := vttls.ClientConfig(cert, key, ca, name)
if err != nil {
return nil, err
}
//... | [
"func",
"SecureDialOption",
"(",
"cert",
",",
"key",
",",
"ca",
",",
"name",
"string",
")",
"(",
"grpc",
".",
"DialOption",
",",
"error",
")",
"{",
"// No security options set, just return.",
"if",
"(",
"cert",
"==",
"\"",
"\"",
"||",
"key",
"==",
"\"",
... | // SecureDialOption returns the gRPC dial option to use for the
// given client connection. It is either using TLS, or Insecure if
// nothing is set. | [
"SecureDialOption",
"returns",
"the",
"gRPC",
"dial",
"option",
"to",
"use",
"for",
"the",
"given",
"client",
"connection",
".",
"It",
"is",
"either",
"using",
"TLS",
"or",
"Insecure",
"if",
"nothing",
"is",
"set",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/grpcclient/client.go#L114-L129 |
136,360 | vitessio/vitess | go/vt/grpcclient/client.go | Add | func (collector *clientInterceptorBuilder) Add(s grpc.StreamClientInterceptor, u grpc.UnaryClientInterceptor) {
collector.unaryInterceptors = append(collector.unaryInterceptors, u)
collector.streamInterceptors = append(collector.streamInterceptors, s)
} | go | func (collector *clientInterceptorBuilder) Add(s grpc.StreamClientInterceptor, u grpc.UnaryClientInterceptor) {
collector.unaryInterceptors = append(collector.unaryInterceptors, u)
collector.streamInterceptors = append(collector.streamInterceptors, s)
} | [
"func",
"(",
"collector",
"*",
"clientInterceptorBuilder",
")",
"Add",
"(",
"s",
"grpc",
".",
"StreamClientInterceptor",
",",
"u",
"grpc",
".",
"UnaryClientInterceptor",
")",
"{",
"collector",
".",
"unaryInterceptors",
"=",
"append",
"(",
"collector",
".",
"unar... | // Add adds interceptors to the chain of interceptors | [
"Add",
"adds",
"interceptors",
"to",
"the",
"chain",
"of",
"interceptors"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/grpcclient/client.go#L138-L141 |
136,361 | vitessio/vitess | go/sqltypes/type.go | IsSigned | func IsSigned(t querypb.Type) bool {
return int(t)&(flagIsIntegral|flagIsUnsigned) == flagIsIntegral
} | go | func IsSigned(t querypb.Type) bool {
return int(t)&(flagIsIntegral|flagIsUnsigned) == flagIsIntegral
} | [
"func",
"IsSigned",
"(",
"t",
"querypb",
".",
"Type",
")",
"bool",
"{",
"return",
"int",
"(",
"t",
")",
"&",
"(",
"flagIsIntegral",
"|",
"flagIsUnsigned",
")",
"==",
"flagIsIntegral",
"\n",
"}"
] | // IsSigned returns true if querypb.Type is a signed integral.
// If you have a Value object, use its member function. | [
"IsSigned",
"returns",
"true",
"if",
"querypb",
".",
"Type",
"is",
"a",
"signed",
"integral",
".",
"If",
"you",
"have",
"a",
"Value",
"object",
"use",
"its",
"member",
"function",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqltypes/type.go#L49-L51 |
136,362 | vitessio/vitess | go/sqltypes/type.go | IsQuoted | func IsQuoted(t querypb.Type) bool {
return (int(t)&flagIsQuoted == flagIsQuoted) && t != Bit
} | go | func IsQuoted(t querypb.Type) bool {
return (int(t)&flagIsQuoted == flagIsQuoted) && t != Bit
} | [
"func",
"IsQuoted",
"(",
"t",
"querypb",
".",
"Type",
")",
"bool",
"{",
"return",
"(",
"int",
"(",
"t",
")",
"&",
"flagIsQuoted",
"==",
"flagIsQuoted",
")",
"&&",
"t",
"!=",
"Bit",
"\n",
"}"
] | // IsQuoted returns true if querypb.Type is a quoted text or binary.
// If you have a Value object, use its member function. | [
"IsQuoted",
"returns",
"true",
"if",
"querypb",
".",
"Type",
"is",
"a",
"quoted",
"text",
"or",
"binary",
".",
"If",
"you",
"have",
"a",
"Value",
"object",
"use",
"its",
"member",
"function",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqltypes/type.go#L68-L70 |
136,363 | vitessio/vitess | go/sqltypes/type.go | isNumber | func isNumber(t querypb.Type) bool {
return IsIntegral(t) || IsFloat(t) || t == Decimal
} | go | func isNumber(t querypb.Type) bool {
return IsIntegral(t) || IsFloat(t) || t == Decimal
} | [
"func",
"isNumber",
"(",
"t",
"querypb",
".",
"Type",
")",
"bool",
"{",
"return",
"IsIntegral",
"(",
"t",
")",
"||",
"IsFloat",
"(",
"t",
")",
"||",
"t",
"==",
"Decimal",
"\n",
"}"
] | // isNumber returns true if the type is any type of number. | [
"isNumber",
"returns",
"true",
"if",
"the",
"type",
"is",
"any",
"type",
"of",
"number",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqltypes/type.go#L85-L87 |
136,364 | vitessio/vitess | go/sqltypes/type.go | modifyType | func modifyType(typ querypb.Type, flags int64) querypb.Type {
switch typ {
case Int8:
if flags&mysqlUnsigned != 0 {
return Uint8
}
return Int8
case Int16:
if flags&mysqlUnsigned != 0 {
return Uint16
}
return Int16
case Int32:
if flags&mysqlUnsigned != 0 {
return Uint32
}
return Int32
cas... | go | func modifyType(typ querypb.Type, flags int64) querypb.Type {
switch typ {
case Int8:
if flags&mysqlUnsigned != 0 {
return Uint8
}
return Int8
case Int16:
if flags&mysqlUnsigned != 0 {
return Uint16
}
return Int16
case Int32:
if flags&mysqlUnsigned != 0 {
return Uint32
}
return Int32
cas... | [
"func",
"modifyType",
"(",
"typ",
"querypb",
".",
"Type",
",",
"flags",
"int64",
")",
"querypb",
".",
"Type",
"{",
"switch",
"typ",
"{",
"case",
"Int8",
":",
"if",
"flags",
"&",
"mysqlUnsigned",
"!=",
"0",
"{",
"return",
"Uint8",
"\n",
"}",
"\n",
"re... | // modifyType modifies the vitess type based on the
// mysql flag. The function checks specific flags based
// on the type. This allows us to ignore stray flags
// that MySQL occasionally sets. | [
"modifyType",
"modifies",
"the",
"vitess",
"type",
"based",
"on",
"the",
"mysql",
"flag",
".",
"The",
"function",
"checks",
"specific",
"flags",
"based",
"on",
"the",
"type",
".",
"This",
"allows",
"us",
"to",
"ignore",
"stray",
"flags",
"that",
"MySQL",
"... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqltypes/type.go#L186-L236 |
136,365 | vitessio/vitess | go/sqltypes/type.go | MySQLToType | func MySQLToType(mysqlType, flags int64) (typ querypb.Type, err error) {
result, ok := mysqlToType[mysqlType]
if !ok {
return 0, fmt.Errorf("unsupported type: %d", mysqlType)
}
return modifyType(result, flags), nil
} | go | func MySQLToType(mysqlType, flags int64) (typ querypb.Type, err error) {
result, ok := mysqlToType[mysqlType]
if !ok {
return 0, fmt.Errorf("unsupported type: %d", mysqlType)
}
return modifyType(result, flags), nil
} | [
"func",
"MySQLToType",
"(",
"mysqlType",
",",
"flags",
"int64",
")",
"(",
"typ",
"querypb",
".",
"Type",
",",
"err",
"error",
")",
"{",
"result",
",",
"ok",
":=",
"mysqlToType",
"[",
"mysqlType",
"]",
"\n",
"if",
"!",
"ok",
"{",
"return",
"0",
",",
... | // MySQLToType computes the vitess type from mysql type and flags. | [
"MySQLToType",
"computes",
"the",
"vitess",
"type",
"from",
"mysql",
"type",
"and",
"flags",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqltypes/type.go#L239-L245 |
136,366 | vitessio/vitess | go/sqltypes/type.go | TypeToMySQL | func TypeToMySQL(typ querypb.Type) (mysqlType, flags int64) {
val := typeToMySQL[typ]
return val.typ, val.flags
} | go | func TypeToMySQL(typ querypb.Type) (mysqlType, flags int64) {
val := typeToMySQL[typ]
return val.typ, val.flags
} | [
"func",
"TypeToMySQL",
"(",
"typ",
"querypb",
".",
"Type",
")",
"(",
"mysqlType",
",",
"flags",
"int64",
")",
"{",
"val",
":=",
"typeToMySQL",
"[",
"typ",
"]",
"\n",
"return",
"val",
".",
"typ",
",",
"val",
".",
"flags",
"\n",
"}"
] | // TypeToMySQL returns the equivalent mysql type and flag for a vitess type. | [
"TypeToMySQL",
"returns",
"the",
"equivalent",
"mysql",
"type",
"and",
"flag",
"for",
"a",
"vitess",
"type",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/sqltypes/type.go#L285-L288 |
136,367 | vitessio/vitess | go/vt/tableacl/tableacl.go | Valid | func (tacl *tableACL) Valid() bool {
tacl.RLock()
defer tacl.RUnlock()
return tacl.entries != nil
} | go | func (tacl *tableACL) Valid() bool {
tacl.RLock()
defer tacl.RUnlock()
return tacl.entries != nil
} | [
"func",
"(",
"tacl",
"*",
"tableACL",
")",
"Valid",
"(",
")",
"bool",
"{",
"tacl",
".",
"RLock",
"(",
")",
"\n",
"defer",
"tacl",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"tacl",
".",
"entries",
"!=",
"nil",
"\n",
"}"
] | // Valid returns whether the tableACL is valid.
// Currently it only checks that it has been initialized. | [
"Valid",
"returns",
"whether",
"the",
"tableACL",
"is",
"valid",
".",
"Currently",
"it",
"only",
"checks",
"that",
"it",
"has",
"been",
"initialized",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/tableacl/tableacl.go#L206-L210 |
136,368 | vitessio/vitess | go/vt/tableacl/tableacl.go | ValidateProto | func ValidateProto(config *tableaclpb.Config) (err error) {
t := patricia.NewTrie()
for _, group := range config.TableGroups {
for _, name := range group.TableNamesOrPrefixes {
var prefix patricia.Prefix
if strings.HasSuffix(name, "%") {
prefix = []byte(strings.TrimSuffix(name, "%"))
} else {
prefi... | go | func ValidateProto(config *tableaclpb.Config) (err error) {
t := patricia.NewTrie()
for _, group := range config.TableGroups {
for _, name := range group.TableNamesOrPrefixes {
var prefix patricia.Prefix
if strings.HasSuffix(name, "%") {
prefix = []byte(strings.TrimSuffix(name, "%"))
} else {
prefi... | [
"func",
"ValidateProto",
"(",
"config",
"*",
"tableaclpb",
".",
"Config",
")",
"(",
"err",
"error",
")",
"{",
"t",
":=",
"patricia",
".",
"NewTrie",
"(",
")",
"\n",
"for",
"_",
",",
"group",
":=",
"range",
"config",
".",
"TableGroups",
"{",
"for",
"_... | // ValidateProto returns an error if the given proto has problems
// that would cause InitFromProto to fail. | [
"ValidateProto",
"returns",
"an",
"error",
"if",
"the",
"given",
"proto",
"has",
"problems",
"that",
"would",
"cause",
"InitFromProto",
"to",
"fail",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/tableacl/tableacl.go#L214-L240 |
136,369 | vitessio/vitess | go/vt/tableacl/tableacl.go | Authorized | func Authorized(table string, role Role) *ACLResult {
return currentTableACL.Authorized(table, role)
} | go | func Authorized(table string, role Role) *ACLResult {
return currentTableACL.Authorized(table, role)
} | [
"func",
"Authorized",
"(",
"table",
"string",
",",
"role",
"Role",
")",
"*",
"ACLResult",
"{",
"return",
"currentTableACL",
".",
"Authorized",
"(",
"table",
",",
"role",
")",
"\n",
"}"
] | // Authorized returns the list of entities who have the specified role on a tablel. | [
"Authorized",
"returns",
"the",
"list",
"of",
"entities",
"who",
"have",
"the",
"specified",
"role",
"on",
"a",
"tablel",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/tableacl/tableacl.go#L243-L245 |
136,370 | vitessio/vitess | go/vt/tableacl/tableacl.go | Register | func Register(name string, factory acl.Factory) {
mu.Lock()
defer mu.Unlock()
if _, ok := acls[name]; ok {
panic(fmt.Sprintf("register a registered key: %s", name))
}
acls[name] = factory
} | go | func Register(name string, factory acl.Factory) {
mu.Lock()
defer mu.Unlock()
if _, ok := acls[name]; ok {
panic(fmt.Sprintf("register a registered key: %s", name))
}
acls[name] = factory
} | [
"func",
"Register",
"(",
"name",
"string",
",",
"factory",
"acl",
".",
"Factory",
")",
"{",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"if",
"_",
",",
"ok",
":=",
"acls",
"[",
"name",
"]",
";",
"ok",
"{",
... | // Register registers an AclFactory. | [
"Register",
"registers",
"an",
"AclFactory",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/tableacl/tableacl.go#L288-L295 |
136,371 | vitessio/vitess | go/vt/tableacl/tableacl.go | GetCurrentACLFactory | func GetCurrentACLFactory() (acl.Factory, error) {
mu.Lock()
defer mu.Unlock()
if len(acls) == 0 {
return nil, fmt.Errorf("no AclFactories registered")
}
if defaultACL == "" {
if len(acls) == 1 {
for _, aclFactory := range acls {
return aclFactory, nil
}
}
return nil, errors.New("there are more t... | go | func GetCurrentACLFactory() (acl.Factory, error) {
mu.Lock()
defer mu.Unlock()
if len(acls) == 0 {
return nil, fmt.Errorf("no AclFactories registered")
}
if defaultACL == "" {
if len(acls) == 1 {
for _, aclFactory := range acls {
return aclFactory, nil
}
}
return nil, errors.New("there are more t... | [
"func",
"GetCurrentACLFactory",
"(",
")",
"(",
"acl",
".",
"Factory",
",",
"error",
")",
"{",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"if",
"len",
"(",
"acls",
")",
"==",
"0",
"{",
"return",
"nil",
",",
... | // GetCurrentACLFactory returns current table acl implementation. | [
"GetCurrentACLFactory",
"returns",
"current",
"table",
"acl",
"implementation",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/tableacl/tableacl.go#L305-L323 |
136,372 | vitessio/vitess | go/vt/wrangler/tablet.go | InitTablet | func (wr *Wrangler) InitTablet(ctx context.Context, tablet *topodatapb.Tablet, allowMasterOverride, createShardAndKeyspace, allowUpdate bool) error {
shard, kr, err := topo.ValidateShardName(tablet.Shard)
if err != nil {
return err
}
tablet.Shard = shard
tablet.KeyRange = kr
// get the shard, possibly creating... | go | func (wr *Wrangler) InitTablet(ctx context.Context, tablet *topodatapb.Tablet, allowMasterOverride, createShardAndKeyspace, allowUpdate bool) error {
shard, kr, err := topo.ValidateShardName(tablet.Shard)
if err != nil {
return err
}
tablet.Shard = shard
tablet.KeyRange = kr
// get the shard, possibly creating... | [
"func",
"(",
"wr",
"*",
"Wrangler",
")",
"InitTablet",
"(",
"ctx",
"context",
".",
"Context",
",",
"tablet",
"*",
"topodatapb",
".",
"Tablet",
",",
"allowMasterOverride",
",",
"createShardAndKeyspace",
",",
"allowUpdate",
"bool",
")",
"error",
"{",
"shard",
... | // Tablet related methods for wrangler
// InitTablet creates or updates a tablet. If no parent is specified
// in the tablet, and the tablet has a slave type, we will find the
// appropriate parent. If createShardAndKeyspace is true and the
// parent keyspace or shard don't exist, they will be created. If
// allowUpda... | [
"Tablet",
"related",
"methods",
"for",
"wrangler",
"InitTablet",
"creates",
"or",
"updates",
"a",
"tablet",
".",
"If",
"no",
"parent",
"is",
"specified",
"in",
"the",
"tablet",
"and",
"the",
"tablet",
"has",
"a",
"slave",
"type",
"we",
"will",
"find",
"the... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/wrangler/tablet.go#L41-L99 |
136,373 | vitessio/vitess | go/vt/wrangler/tablet.go | ChangeSlaveType | func (wr *Wrangler) ChangeSlaveType(ctx context.Context, tabletAlias *topodatapb.TabletAlias, tabletType topodatapb.TabletType) error {
// Load tablet to find endpoint, and keyspace and shard assignment.
ti, err := wr.ts.GetTablet(ctx, tabletAlias)
if err != nil {
return err
}
if !topo.IsTrivialTypeChange(ti.Ty... | go | func (wr *Wrangler) ChangeSlaveType(ctx context.Context, tabletAlias *topodatapb.TabletAlias, tabletType topodatapb.TabletType) error {
// Load tablet to find endpoint, and keyspace and shard assignment.
ti, err := wr.ts.GetTablet(ctx, tabletAlias)
if err != nil {
return err
}
if !topo.IsTrivialTypeChange(ti.Ty... | [
"func",
"(",
"wr",
"*",
"Wrangler",
")",
"ChangeSlaveType",
"(",
"ctx",
"context",
".",
"Context",
",",
"tabletAlias",
"*",
"topodatapb",
".",
"TabletAlias",
",",
"tabletType",
"topodatapb",
".",
"TabletType",
")",
"error",
"{",
"// Load tablet to find endpoint, a... | // ChangeSlaveType changes the type of tablet and recomputes all
// necessary derived paths in the serving graph, if necessary.
//
// Note we don't update the master record in the Shard here, as we
// can't ChangeType from and out of master anyway. | [
"ChangeSlaveType",
"changes",
"the",
"type",
"of",
"tablet",
"and",
"recomputes",
"all",
"necessary",
"derived",
"paths",
"in",
"the",
"serving",
"graph",
"if",
"necessary",
".",
"Note",
"we",
"don",
"t",
"update",
"the",
"master",
"record",
"in",
"the",
"Sh... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/wrangler/tablet.go#L149-L162 |
136,374 | vitessio/vitess | go/vt/wrangler/tablet.go | RefreshTabletState | func (wr *Wrangler) RefreshTabletState(ctx context.Context, tabletAlias *topodatapb.TabletAlias) error {
// Load tablet to find endpoint, and keyspace and shard assignment.
ti, err := wr.ts.GetTablet(ctx, tabletAlias)
if err != nil {
return err
}
// and ask the tablet to refresh itself
return wr.tmc.RefreshSta... | go | func (wr *Wrangler) RefreshTabletState(ctx context.Context, tabletAlias *topodatapb.TabletAlias) error {
// Load tablet to find endpoint, and keyspace and shard assignment.
ti, err := wr.ts.GetTablet(ctx, tabletAlias)
if err != nil {
return err
}
// and ask the tablet to refresh itself
return wr.tmc.RefreshSta... | [
"func",
"(",
"wr",
"*",
"Wrangler",
")",
"RefreshTabletState",
"(",
"ctx",
"context",
".",
"Context",
",",
"tabletAlias",
"*",
"topodatapb",
".",
"TabletAlias",
")",
"error",
"{",
"// Load tablet to find endpoint, and keyspace and shard assignment.",
"ti",
",",
"err",... | // RefreshTabletState refreshes tablet state | [
"RefreshTabletState",
"refreshes",
"tablet",
"state"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/wrangler/tablet.go#L165-L174 |
136,375 | vitessio/vitess | go/vt/wrangler/tablet.go | ExecuteFetchAsApp | func (wr *Wrangler) ExecuteFetchAsApp(ctx context.Context, tabletAlias *topodatapb.TabletAlias, usePool bool, query string, maxRows int) (*querypb.QueryResult, error) {
ti, err := wr.ts.GetTablet(ctx, tabletAlias)
if err != nil {
return nil, err
}
return wr.tmc.ExecuteFetchAsApp(ctx, ti.Tablet, usePool, []byte(qu... | go | func (wr *Wrangler) ExecuteFetchAsApp(ctx context.Context, tabletAlias *topodatapb.TabletAlias, usePool bool, query string, maxRows int) (*querypb.QueryResult, error) {
ti, err := wr.ts.GetTablet(ctx, tabletAlias)
if err != nil {
return nil, err
}
return wr.tmc.ExecuteFetchAsApp(ctx, ti.Tablet, usePool, []byte(qu... | [
"func",
"(",
"wr",
"*",
"Wrangler",
")",
"ExecuteFetchAsApp",
"(",
"ctx",
"context",
".",
"Context",
",",
"tabletAlias",
"*",
"topodatapb",
".",
"TabletAlias",
",",
"usePool",
"bool",
",",
"query",
"string",
",",
"maxRows",
"int",
")",
"(",
"*",
"querypb",... | // ExecuteFetchAsApp executes a query remotely using the App pool | [
"ExecuteFetchAsApp",
"executes",
"a",
"query",
"remotely",
"using",
"the",
"App",
"pool"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/wrangler/tablet.go#L177-L183 |
136,376 | vitessio/vitess | go/vt/wrangler/tablet.go | VReplicationExec | func (wr *Wrangler) VReplicationExec(ctx context.Context, tabletAlias *topodatapb.TabletAlias, query string) (*querypb.QueryResult, error) {
ti, err := wr.ts.GetTablet(ctx, tabletAlias)
if err != nil {
return nil, err
}
return wr.tmc.VReplicationExec(ctx, ti.Tablet, query)
} | go | func (wr *Wrangler) VReplicationExec(ctx context.Context, tabletAlias *topodatapb.TabletAlias, query string) (*querypb.QueryResult, error) {
ti, err := wr.ts.GetTablet(ctx, tabletAlias)
if err != nil {
return nil, err
}
return wr.tmc.VReplicationExec(ctx, ti.Tablet, query)
} | [
"func",
"(",
"wr",
"*",
"Wrangler",
")",
"VReplicationExec",
"(",
"ctx",
"context",
".",
"Context",
",",
"tabletAlias",
"*",
"topodatapb",
".",
"TabletAlias",
",",
"query",
"string",
")",
"(",
"*",
"querypb",
".",
"QueryResult",
",",
"error",
")",
"{",
"... | // VReplicationExec executes a query remotely using the DBA pool | [
"VReplicationExec",
"executes",
"a",
"query",
"remotely",
"using",
"the",
"DBA",
"pool"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/wrangler/tablet.go#L195-L201 |
136,377 | vitessio/vitess | go/vt/vttablet/tabletserver/splitquery/splitter.go | NewSplitter | func NewSplitter(splitParams *SplitParams, algorithm SplitAlgorithmInterface) *Splitter {
var splitter Splitter
splitter.splitParams = splitParams
splitter.algorithm = algorithm
splitter.splitParams = splitParams
splitColumns := algorithm.getSplitColumns()
splitter.startBindVariableNames = make([]string, 0, len(... | go | func NewSplitter(splitParams *SplitParams, algorithm SplitAlgorithmInterface) *Splitter {
var splitter Splitter
splitter.splitParams = splitParams
splitter.algorithm = algorithm
splitter.splitParams = splitParams
splitColumns := algorithm.getSplitColumns()
splitter.startBindVariableNames = make([]string, 0, len(... | [
"func",
"NewSplitter",
"(",
"splitParams",
"*",
"SplitParams",
",",
"algorithm",
"SplitAlgorithmInterface",
")",
"*",
"Splitter",
"{",
"var",
"splitter",
"Splitter",
"\n",
"splitter",
".",
"splitParams",
"=",
"splitParams",
"\n",
"splitter",
".",
"algorithm",
"=",... | // NewSplitter creates a new Splitter object. | [
"NewSplitter",
"creates",
"a",
"new",
"Splitter",
"object",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/splitquery/splitter.go#L42-L59 |
136,378 | vitessio/vitess | go/vt/vttablet/tabletserver/splitquery/splitter.go | initQueryPartSQLs | func (splitter *Splitter) initQueryPartSQLs() {
splitColumns := convertColumnsToExpr(splitter.algorithm.getSplitColumns())
startBindVariables := convertBindVariableNamesToExpr(splitter.startBindVariableNames)
endBindVariables := convertBindVariableNamesToExpr(splitter.endBindVariableNames)
splitColsLessThanEnd := c... | go | func (splitter *Splitter) initQueryPartSQLs() {
splitColumns := convertColumnsToExpr(splitter.algorithm.getSplitColumns())
startBindVariables := convertBindVariableNamesToExpr(splitter.startBindVariableNames)
endBindVariables := convertBindVariableNamesToExpr(splitter.endBindVariableNames)
splitColsLessThanEnd := c... | [
"func",
"(",
"splitter",
"*",
"Splitter",
")",
"initQueryPartSQLs",
"(",
")",
"{",
"splitColumns",
":=",
"convertColumnsToExpr",
"(",
"splitter",
".",
"algorithm",
".",
"getSplitColumns",
"(",
")",
")",
"\n",
"startBindVariables",
":=",
"convertBindVariableNamesToEx... | // initQueryPartSQLs initializes the firstQueryPartSQL, middleQueryPartSQL and lastQueryPartSQL
// fields. | [
"initQueryPartSQLs",
"initializes",
"the",
"firstQueryPartSQL",
"middleQueryPartSQL",
"and",
"lastQueryPartSQL",
"fields",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/splitquery/splitter.go#L83-L106 |
136,379 | vitessio/vitess | go/vt/vttablet/tabletserver/splitquery/splitter.go | queryWithAdditionalWhere | func queryWithAdditionalWhere(
selectAST *sqlparser.Select, addedWhere sqlparser.Expr) *sqlparser.Select {
result := *selectAST // Create a shallow-copy of 'selectAST'
addAndTermToWhereClause(&result, addedWhere)
return &result
} | go | func queryWithAdditionalWhere(
selectAST *sqlparser.Select, addedWhere sqlparser.Expr) *sqlparser.Select {
result := *selectAST // Create a shallow-copy of 'selectAST'
addAndTermToWhereClause(&result, addedWhere)
return &result
} | [
"func",
"queryWithAdditionalWhere",
"(",
"selectAST",
"*",
"sqlparser",
".",
"Select",
",",
"addedWhere",
"sqlparser",
".",
"Expr",
")",
"*",
"sqlparser",
".",
"Select",
"{",
"result",
":=",
"*",
"selectAST",
"// Create a shallow-copy of 'selectAST'",
"\n",
"addAndT... | // queryWithAdditionalWhere returns a copy of the given SELECT query with 'addedWhere' ANDed with
// the query's WHERE clause. If the query does not already have a WHERE clause, 'addedWhere'
// becomes the query's WHERE clause. | [
"queryWithAdditionalWhere",
"returns",
"a",
"copy",
"of",
"the",
"given",
"SELECT",
"query",
"with",
"addedWhere",
"ANDed",
"with",
"the",
"query",
"s",
"WHERE",
"clause",
".",
"If",
"the",
"query",
"does",
"not",
"already",
"have",
"a",
"WHERE",
"clause",
"... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/tabletserver/splitquery/splitter.go#L249-L254 |
136,380 | vitessio/vitess | go/vt/vtgate/gateway/shard_error.go | NewShardError | func NewShardError(in error, target *querypb.Target, tablet *topodatapb.Tablet) error {
if in == nil {
return nil
}
if tablet != nil {
return vterrors.Wrapf(in, "target: %s.%s.%s, used tablet: %s", target.Keyspace, target.Shard, topoproto.TabletTypeLString(target.TabletType), topotools.TabletIdent(tablet))
}
i... | go | func NewShardError(in error, target *querypb.Target, tablet *topodatapb.Tablet) error {
if in == nil {
return nil
}
if tablet != nil {
return vterrors.Wrapf(in, "target: %s.%s.%s, used tablet: %s", target.Keyspace, target.Shard, topoproto.TabletTypeLString(target.TabletType), topotools.TabletIdent(tablet))
}
i... | [
"func",
"NewShardError",
"(",
"in",
"error",
",",
"target",
"*",
"querypb",
".",
"Target",
",",
"tablet",
"*",
"topodatapb",
".",
"Tablet",
")",
"error",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"tablet",
"!=",
"nil"... | // NewShardError returns a new error with the shard info amended. | [
"NewShardError",
"returns",
"a",
"new",
"error",
"with",
"the",
"shard",
"info",
"amended",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/gateway/shard_error.go#L29-L40 |
136,381 | vitessio/vitess | go/vt/vtgate/planbuilder/update.go | buildUpdatePlan | func buildUpdatePlan(upd *sqlparser.Update, vschema ContextVSchema) (*engine.Update, error) {
eupd := &engine.Update{
ChangedVindexValues: make(map[string][]sqltypes.PlanValue),
}
pb := newPrimitiveBuilder(vschema, newJointab(sqlparser.GetBindvars(upd)))
ro, err := pb.processDMLTable(upd.TableExprs)
if err != ni... | go | func buildUpdatePlan(upd *sqlparser.Update, vschema ContextVSchema) (*engine.Update, error) {
eupd := &engine.Update{
ChangedVindexValues: make(map[string][]sqltypes.PlanValue),
}
pb := newPrimitiveBuilder(vschema, newJointab(sqlparser.GetBindvars(upd)))
ro, err := pb.processDMLTable(upd.TableExprs)
if err != ni... | [
"func",
"buildUpdatePlan",
"(",
"upd",
"*",
"sqlparser",
".",
"Update",
",",
"vschema",
"ContextVSchema",
")",
"(",
"*",
"engine",
".",
"Update",
",",
"error",
")",
"{",
"eupd",
":=",
"&",
"engine",
".",
"Update",
"{",
"ChangedVindexValues",
":",
"make",
... | // buildUpdatePlan builds the instructions for an UPDATE statement. | [
"buildUpdatePlan",
"builds",
"the",
"instructions",
"for",
"an",
"UPDATE",
"statement",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/update.go#L33-L109 |
136,382 | vitessio/vitess | go/vt/vtgate/planbuilder/update.go | buildChangedVindexesValues | func buildChangedVindexesValues(eupd *engine.Update, update *sqlparser.Update, colVindexes []*vindexes.ColumnVindex) (map[string][]sqltypes.PlanValue, error) {
changedVindexes := make(map[string][]sqltypes.PlanValue)
for i, vindex := range colVindexes {
var vindexValues []sqltypes.PlanValue
for _, vcol := range v... | go | func buildChangedVindexesValues(eupd *engine.Update, update *sqlparser.Update, colVindexes []*vindexes.ColumnVindex) (map[string][]sqltypes.PlanValue, error) {
changedVindexes := make(map[string][]sqltypes.PlanValue)
for i, vindex := range colVindexes {
var vindexValues []sqltypes.PlanValue
for _, vcol := range v... | [
"func",
"buildChangedVindexesValues",
"(",
"eupd",
"*",
"engine",
".",
"Update",
",",
"update",
"*",
"sqlparser",
".",
"Update",
",",
"colVindexes",
"[",
"]",
"*",
"vindexes",
".",
"ColumnVindex",
")",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"sqltypes",
... | // buildChangedVindexesValues adds to the plan all the lookup vindexes that are changing.
// Updates can only be performed to secondary lookup vindexes with no complex expressions
// in the set clause. | [
"buildChangedVindexesValues",
"adds",
"to",
"the",
"plan",
"all",
"the",
"lookup",
"vindexes",
"that",
"are",
"changing",
".",
"Updates",
"can",
"only",
"be",
"performed",
"to",
"secondary",
"lookup",
"vindexes",
"with",
"no",
"complex",
"expressions",
"in",
"th... | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/update.go#L114-L160 |
136,383 | vitessio/vitess | go/vt/vtgate/planbuilder/update.go | dmlFormatter | func dmlFormatter(buf *sqlparser.TrackedBuffer, node sqlparser.SQLNode) {
switch node := node.(type) {
case sqlparser.TableName:
node.Name.Format(buf)
return
}
node.Format(buf)
} | go | func dmlFormatter(buf *sqlparser.TrackedBuffer, node sqlparser.SQLNode) {
switch node := node.(type) {
case sqlparser.TableName:
node.Name.Format(buf)
return
}
node.Format(buf)
} | [
"func",
"dmlFormatter",
"(",
"buf",
"*",
"sqlparser",
".",
"TrackedBuffer",
",",
"node",
"sqlparser",
".",
"SQLNode",
")",
"{",
"switch",
"node",
":=",
"node",
".",
"(",
"type",
")",
"{",
"case",
"sqlparser",
".",
"TableName",
":",
"node",
".",
"Name",
... | // dmlFormatter strips out keyspace name from dmls. | [
"dmlFormatter",
"strips",
"out",
"keyspace",
"name",
"from",
"dmls",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/update.go#L190-L197 |
136,384 | vitessio/vitess | go/vt/vtgate/planbuilder/update.go | getDMLRouting | func getDMLRouting(where *sqlparser.Where, table *vindexes.Table) (vindexes.Vindex, []sqltypes.PlanValue, error) {
if where == nil {
return nil, nil, errors.New("unsupported: multi-shard where clause in DML")
}
for _, index := range table.Ordered {
if !index.Vindex.IsUnique() {
continue
}
if pv, ok := get... | go | func getDMLRouting(where *sqlparser.Where, table *vindexes.Table) (vindexes.Vindex, []sqltypes.PlanValue, error) {
if where == nil {
return nil, nil, errors.New("unsupported: multi-shard where clause in DML")
}
for _, index := range table.Ordered {
if !index.Vindex.IsUnique() {
continue
}
if pv, ok := get... | [
"func",
"getDMLRouting",
"(",
"where",
"*",
"sqlparser",
".",
"Where",
",",
"table",
"*",
"vindexes",
".",
"Table",
")",
"(",
"vindexes",
".",
"Vindex",
",",
"[",
"]",
"sqltypes",
".",
"PlanValue",
",",
"error",
")",
"{",
"if",
"where",
"==",
"nil",
... | // getDMLRouting returns the vindex and values for the DML,
// If it cannot find a unique vindex match, it returns an error. | [
"getDMLRouting",
"returns",
"the",
"vindex",
"and",
"values",
"for",
"the",
"DML",
"If",
"it",
"cannot",
"find",
"a",
"unique",
"vindex",
"match",
"it",
"returns",
"an",
"error",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/update.go#L207-L220 |
136,385 | vitessio/vitess | go/vt/vtgate/planbuilder/update.go | getMatch | func getMatch(node sqlparser.Expr, col sqlparser.ColIdent) (pv sqltypes.PlanValue, ok bool) {
filters := splitAndExpression(nil, node)
for _, filter := range filters {
filter = skipParenthesis(filter)
if parenthesis, ok := node.(*sqlparser.ParenExpr); ok {
if pv, ok := getMatch(parenthesis.Expr, col); ok {
... | go | func getMatch(node sqlparser.Expr, col sqlparser.ColIdent) (pv sqltypes.PlanValue, ok bool) {
filters := splitAndExpression(nil, node)
for _, filter := range filters {
filter = skipParenthesis(filter)
if parenthesis, ok := node.(*sqlparser.ParenExpr); ok {
if pv, ok := getMatch(parenthesis.Expr, col); ok {
... | [
"func",
"getMatch",
"(",
"node",
"sqlparser",
".",
"Expr",
",",
"col",
"sqlparser",
".",
"ColIdent",
")",
"(",
"pv",
"sqltypes",
".",
"PlanValue",
",",
"ok",
"bool",
")",
"{",
"filters",
":=",
"splitAndExpression",
"(",
"nil",
",",
"node",
")",
"\n",
"... | // getMatch returns the matched value if there is an equality
// constraint on the specified column that can be used to
// decide on a route. | [
"getMatch",
"returns",
"the",
"matched",
"value",
"if",
"there",
"is",
"an",
"equality",
"constraint",
"on",
"the",
"specified",
"column",
"that",
"can",
"be",
"used",
"to",
"decide",
"on",
"a",
"route",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/planbuilder/update.go#L225-L255 |
136,386 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | DialTablet | func DialTablet(tablet *topodatapb.Tablet, failFast grpcclient.FailFast) (queryservice.QueryService, error) {
// create the RPC client
addr := ""
if grpcPort, ok := tablet.PortMap["grpc"]; ok {
addr = netutil.JoinHostPort(tablet.Hostname, grpcPort)
} else {
addr = tablet.Hostname
}
opt, err := grpcclient.Secu... | go | func DialTablet(tablet *topodatapb.Tablet, failFast grpcclient.FailFast) (queryservice.QueryService, error) {
// create the RPC client
addr := ""
if grpcPort, ok := tablet.PortMap["grpc"]; ok {
addr = netutil.JoinHostPort(tablet.Hostname, grpcPort)
} else {
addr = tablet.Hostname
}
opt, err := grpcclient.Secu... | [
"func",
"DialTablet",
"(",
"tablet",
"*",
"topodatapb",
".",
"Tablet",
",",
"failFast",
"grpcclient",
".",
"FailFast",
")",
"(",
"queryservice",
".",
"QueryService",
",",
"error",
")",
"{",
"// create the RPC client",
"addr",
":=",
"\"",
"\"",
"\n",
"if",
"g... | // DialTablet creates and initializes gRPCQueryClient. | [
"DialTablet",
"creates",
"and",
"initializes",
"gRPCQueryClient",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L64-L89 |
136,387 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | StreamExecute | func (conn *gRPCQueryClient) StreamExecute(ctx context.Context, target *querypb.Target, query string, bindVars map[string]*querypb.BindVariable, transactionID int64, options *querypb.ExecuteOptions, callback func(*sqltypes.Result) error) error {
// All streaming clients should follow the code pattern below.
// The fi... | go | func (conn *gRPCQueryClient) StreamExecute(ctx context.Context, target *querypb.Target, query string, bindVars map[string]*querypb.BindVariable, transactionID int64, options *querypb.ExecuteOptions, callback func(*sqltypes.Result) error) error {
// All streaming clients should follow the code pattern below.
// The fi... | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"StreamExecute",
"(",
"ctx",
"context",
".",
"Context",
",",
"target",
"*",
"querypb",
".",
"Target",
",",
"query",
"string",
",",
"bindVars",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",... | // StreamExecute executes the query and streams results back through callback. | [
"StreamExecute",
"executes",
"the",
"query",
"and",
"streams",
"results",
"back",
"through",
"callback",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L142-L197 |
136,388 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | Begin | func (conn *gRPCQueryClient) Begin(ctx context.Context, target *querypb.Target, options *querypb.ExecuteOptions) (transactionID int64, err error) {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc == nil {
return 0, tabletconn.ConnClosed
}
req := &querypb.BeginRequest{
Target: target,
Effective... | go | func (conn *gRPCQueryClient) Begin(ctx context.Context, target *querypb.Target, options *querypb.ExecuteOptions) (transactionID int64, err error) {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc == nil {
return 0, tabletconn.ConnClosed
}
req := &querypb.BeginRequest{
Target: target,
Effective... | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"Begin",
"(",
"ctx",
"context",
".",
"Context",
",",
"target",
"*",
"querypb",
".",
"Target",
",",
"options",
"*",
"querypb",
".",
"ExecuteOptions",
")",
"(",
"transactionID",
"int64",
",",
"err",
"error",
... | // Begin starts a transaction. | [
"Begin",
"starts",
"a",
"transaction",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L200-L218 |
136,389 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | Commit | func (conn *gRPCQueryClient) Commit(ctx context.Context, target *querypb.Target, transactionID int64) error {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc == nil {
return tabletconn.ConnClosed
}
req := &querypb.CommitRequest{
Target: target,
EffectiveCallerId: callerid.EffectiveCallerIDFrom... | go | func (conn *gRPCQueryClient) Commit(ctx context.Context, target *querypb.Target, transactionID int64) error {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc == nil {
return tabletconn.ConnClosed
}
req := &querypb.CommitRequest{
Target: target,
EffectiveCallerId: callerid.EffectiveCallerIDFrom... | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"Commit",
"(",
"ctx",
"context",
".",
"Context",
",",
"target",
"*",
"querypb",
".",
"Target",
",",
"transactionID",
"int64",
")",
"error",
"{",
"conn",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",... | // Commit commits the ongoing transaction. | [
"Commit",
"commits",
"the",
"ongoing",
"transaction",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L221-L239 |
136,390 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | BeginExecute | func (conn *gRPCQueryClient) BeginExecute(ctx context.Context, target *querypb.Target, query string, bindVars map[string]*querypb.BindVariable, options *querypb.ExecuteOptions) (result *sqltypes.Result, transactionID int64, err error) {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc == nil {
return nil, 0, tab... | go | func (conn *gRPCQueryClient) BeginExecute(ctx context.Context, target *querypb.Target, query string, bindVars map[string]*querypb.BindVariable, options *querypb.ExecuteOptions) (result *sqltypes.Result, transactionID int64, err error) {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc == nil {
return nil, 0, tab... | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"BeginExecute",
"(",
"ctx",
"context",
".",
"Context",
",",
"target",
"*",
"querypb",
".",
"Target",
",",
"query",
"string",
",",
"bindVars",
"map",
"[",
"string",
"]",
"*",
"querypb",
".",
"BindVariable",
... | // BeginExecute starts a transaction and runs an Execute. | [
"BeginExecute",
"starts",
"a",
"transaction",
"and",
"runs",
"an",
"Execute",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L439-L464 |
136,391 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | BeginExecuteBatch | func (conn *gRPCQueryClient) BeginExecuteBatch(ctx context.Context, target *querypb.Target, queries []*querypb.BoundQuery, asTransaction bool, options *querypb.ExecuteOptions) (results []sqltypes.Result, transactionID int64, err error) {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc == nil {
return nil, 0, ta... | go | func (conn *gRPCQueryClient) BeginExecuteBatch(ctx context.Context, target *querypb.Target, queries []*querypb.BoundQuery, asTransaction bool, options *querypb.ExecuteOptions) (results []sqltypes.Result, transactionID int64, err error) {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc == nil {
return nil, 0, ta... | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"BeginExecuteBatch",
"(",
"ctx",
"context",
".",
"Context",
",",
"target",
"*",
"querypb",
".",
"Target",
",",
"queries",
"[",
"]",
"*",
"querypb",
".",
"BoundQuery",
",",
"asTransaction",
"bool",
",",
"opt... | // BeginExecuteBatch starts a transaction and runs an ExecuteBatch. | [
"BeginExecuteBatch",
"starts",
"a",
"transaction",
"and",
"runs",
"an",
"ExecuteBatch",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L467-L491 |
136,392 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | SplitQuery | func (conn *gRPCQueryClient) SplitQuery(
ctx context.Context,
target *querypb.Target,
query *querypb.BoundQuery,
splitColumns []string,
splitCount int64,
numRowsPerQueryPart int64,
algorithm querypb.SplitQueryRequest_Algorithm) (queries []*querypb.QuerySplit, err error) {
conn.mu.RLock()
defer conn.mu.RUnlock... | go | func (conn *gRPCQueryClient) SplitQuery(
ctx context.Context,
target *querypb.Target,
query *querypb.BoundQuery,
splitColumns []string,
splitCount int64,
numRowsPerQueryPart int64,
algorithm querypb.SplitQueryRequest_Algorithm) (queries []*querypb.QuerySplit, err error) {
conn.mu.RLock()
defer conn.mu.RUnlock... | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"SplitQuery",
"(",
"ctx",
"context",
".",
"Context",
",",
"target",
"*",
"querypb",
".",
"Target",
",",
"query",
"*",
"querypb",
".",
"BoundQuery",
",",
"splitColumns",
"[",
"]",
"string",
",",
"splitCount"... | // SplitQuery is the stub for TabletServer.SplitQuery RPC | [
"SplitQuery",
"is",
"the",
"stub",
"for",
"TabletServer",
".",
"SplitQuery",
"RPC"
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L561-L592 |
136,393 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | StreamHealth | func (conn *gRPCQueryClient) StreamHealth(ctx context.Context, callback func(*querypb.StreamHealthResponse) error) error {
// Please see comments in StreamExecute to see how this works.
ctx, cancel := context.WithCancel(ctx)
defer cancel()
stream, err := func() (queryservicepb.Query_StreamHealthClient, error) {
... | go | func (conn *gRPCQueryClient) StreamHealth(ctx context.Context, callback func(*querypb.StreamHealthResponse) error) error {
// Please see comments in StreamExecute to see how this works.
ctx, cancel := context.WithCancel(ctx)
defer cancel()
stream, err := func() (queryservicepb.Query_StreamHealthClient, error) {
... | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"StreamHealth",
"(",
"ctx",
"context",
".",
"Context",
",",
"callback",
"func",
"(",
"*",
"querypb",
".",
"StreamHealthResponse",
")",
"error",
")",
"error",
"{",
"// Please see comments in StreamExecute to see how t... | // StreamHealth starts a streaming RPC for VTTablet health status updates. | [
"StreamHealth",
"starts",
"a",
"streaming",
"RPC",
"for",
"VTTablet",
"health",
"status",
"updates",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L595-L628 |
136,394 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | UpdateStream | func (conn *gRPCQueryClient) UpdateStream(ctx context.Context, target *querypb.Target, position string, timestamp int64, callback func(*querypb.StreamEvent) error) error {
// Please see comments in StreamExecute to see how this works.
ctx, cancel := context.WithCancel(ctx)
defer cancel()
stream, err := func() (que... | go | func (conn *gRPCQueryClient) UpdateStream(ctx context.Context, target *querypb.Target, position string, timestamp int64, callback func(*querypb.StreamEvent) error) error {
// Please see comments in StreamExecute to see how this works.
ctx, cancel := context.WithCancel(ctx)
defer cancel()
stream, err := func() (que... | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"UpdateStream",
"(",
"ctx",
"context",
".",
"Context",
",",
"target",
"*",
"querypb",
".",
"Target",
",",
"position",
"string",
",",
"timestamp",
"int64",
",",
"callback",
"func",
"(",
"*",
"querypb",
".",
... | // UpdateStream starts a streaming query to VTTablet. | [
"UpdateStream",
"starts",
"a",
"streaming",
"query",
"to",
"VTTablet",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L631-L671 |
136,395 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | VStream | func (conn *gRPCQueryClient) VStream(ctx context.Context, target *querypb.Target, position string, filter *binlogdatapb.Filter, send func([]*binlogdatapb.VEvent) error) error {
stream, err := func() (queryservicepb.Query_VStreamClient, error) {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc == nil {
retur... | go | func (conn *gRPCQueryClient) VStream(ctx context.Context, target *querypb.Target, position string, filter *binlogdatapb.Filter, send func([]*binlogdatapb.VEvent) error) error {
stream, err := func() (queryservicepb.Query_VStreamClient, error) {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc == nil {
retur... | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"VStream",
"(",
"ctx",
"context",
".",
"Context",
",",
"target",
"*",
"querypb",
".",
"Target",
",",
"position",
"string",
",",
"filter",
"*",
"binlogdatapb",
".",
"Filter",
",",
"send",
"func",
"(",
"[",... | // VStream starts a VReplication stream. | [
"VStream",
"starts",
"a",
"VReplication",
"stream",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L674-L715 |
136,396 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | VStreamRows | func (conn *gRPCQueryClient) VStreamRows(ctx context.Context, target *querypb.Target, query string, lastpk *querypb.QueryResult, send func(*binlogdatapb.VStreamRowsResponse) error) error {
stream, err := func() (queryservicepb.Query_VStreamRowsClient, error) {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc =... | go | func (conn *gRPCQueryClient) VStreamRows(ctx context.Context, target *querypb.Target, query string, lastpk *querypb.QueryResult, send func(*binlogdatapb.VStreamRowsResponse) error) error {
stream, err := func() (queryservicepb.Query_VStreamRowsClient, error) {
conn.mu.RLock()
defer conn.mu.RUnlock()
if conn.cc =... | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"VStreamRows",
"(",
"ctx",
"context",
".",
"Context",
",",
"target",
"*",
"querypb",
".",
"Target",
",",
"query",
"string",
",",
"lastpk",
"*",
"querypb",
".",
"QueryResult",
",",
"send",
"func",
"(",
"*"... | // VStreamRows streams rows of a query from the specified starting point. | [
"VStreamRows",
"streams",
"rows",
"of",
"a",
"query",
"from",
"the",
"specified",
"starting",
"point",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L718-L756 |
136,397 | vitessio/vitess | go/vt/vttablet/grpctabletconn/conn.go | Close | func (conn *gRPCQueryClient) Close(ctx context.Context) error {
conn.mu.Lock()
defer conn.mu.Unlock()
if conn.cc == nil {
return nil
}
cc := conn.cc
conn.cc = nil
return cc.Close()
} | go | func (conn *gRPCQueryClient) Close(ctx context.Context) error {
conn.mu.Lock()
defer conn.mu.Unlock()
if conn.cc == nil {
return nil
}
cc := conn.cc
conn.cc = nil
return cc.Close()
} | [
"func",
"(",
"conn",
"*",
"gRPCQueryClient",
")",
"Close",
"(",
"ctx",
"context",
".",
"Context",
")",
"error",
"{",
"conn",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"conn",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"if",
"conn",
".",
"cc... | // Close closes underlying gRPC channel. | [
"Close",
"closes",
"underlying",
"gRPC",
"channel",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vttablet/grpctabletconn/conn.go#L763-L773 |
136,398 | vitessio/vitess | go/mysql/replication_position.go | Equal | func (rp Position) Equal(other Position) bool {
if rp.GTIDSet == nil {
return other.GTIDSet == nil
}
return rp.GTIDSet.Equal(other.GTIDSet)
} | go | func (rp Position) Equal(other Position) bool {
if rp.GTIDSet == nil {
return other.GTIDSet == nil
}
return rp.GTIDSet.Equal(other.GTIDSet)
} | [
"func",
"(",
"rp",
"Position",
")",
"Equal",
"(",
"other",
"Position",
")",
"bool",
"{",
"if",
"rp",
".",
"GTIDSet",
"==",
"nil",
"{",
"return",
"other",
".",
"GTIDSet",
"==",
"nil",
"\n",
"}",
"\n",
"return",
"rp",
".",
"GTIDSet",
".",
"Equal",
"(... | // Equal returns true if this position is equal to another. | [
"Equal",
"returns",
"true",
"if",
"this",
"position",
"is",
"equal",
"to",
"another",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/replication_position.go#L62-L67 |
136,399 | vitessio/vitess | go/mysql/replication_position.go | AtLeast | func (rp Position) AtLeast(other Position) bool {
if rp.GTIDSet == nil {
return other.GTIDSet == nil
}
return rp.GTIDSet.Contains(other.GTIDSet)
} | go | func (rp Position) AtLeast(other Position) bool {
if rp.GTIDSet == nil {
return other.GTIDSet == nil
}
return rp.GTIDSet.Contains(other.GTIDSet)
} | [
"func",
"(",
"rp",
"Position",
")",
"AtLeast",
"(",
"other",
"Position",
")",
"bool",
"{",
"if",
"rp",
".",
"GTIDSet",
"==",
"nil",
"{",
"return",
"other",
".",
"GTIDSet",
"==",
"nil",
"\n",
"}",
"\n",
"return",
"rp",
".",
"GTIDSet",
".",
"Contains",... | // AtLeast returns true if this position is equal to or after another. | [
"AtLeast",
"returns",
"true",
"if",
"this",
"position",
"is",
"equal",
"to",
"or",
"after",
"another",
"."
] | d568817542a413611801aa17a1c213aa95592182 | https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/mysql/replication_position.go#L70-L75 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.