Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused code #6064

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions go/vt/vtgate/engine/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"strconv"
"time"

"vitess.io/vitess/go/jsonutil"
"vitess.io/vitess/go/mysql"
"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/stats"
Expand Down Expand Up @@ -128,41 +127,6 @@ func (obp OrderbyParams) String() string {
return val
}

// MarshalJSON serializes the Route into a JSON representation.
// It's used for testing and diagnostics.
func (route *Route) MarshalJSON() ([]byte, error) {
var vindexName string
if route.Vindex != nil {
vindexName = route.Vindex.String()
}
marshalRoute := struct {
Opcode RouteOpcode
Keyspace *vindexes.Keyspace `json:",omitempty"`
Query string `json:",omitempty"`
FieldQuery string `json:",omitempty"`
Vindex string `json:",omitempty"`
Values []sqltypes.PlanValue `json:",omitempty"`
OrderBy []OrderbyParams `json:",omitempty"`
TruncateColumnCount int `json:",omitempty"`
QueryTimeout int `json:",omitempty"`
ScatterErrorsAsWarnings bool `json:",omitempty"`
Table string `json:",omitempty"`
}{
Opcode: route.Opcode,
Keyspace: route.Keyspace,
Query: route.Query,
FieldQuery: route.FieldQuery,
Vindex: vindexName,
Values: route.Values,
OrderBy: route.OrderBy,
TruncateColumnCount: route.TruncateColumnCount,
QueryTimeout: route.QueryTimeout,
ScatterErrorsAsWarnings: route.ScatterErrorsAsWarnings,
Table: route.TableName,
}
return jsonutil.MarshalNoEscape(marshalRoute)
}

// RouteOpcode is a number representing the opcode
// for the Route primitve. Adding new opcodes here
// will require review of the join code and
Expand Down
22 changes: 0 additions & 22 deletions go/vt/vtgate/engine/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ limitations under the License.
package engine

import (
"encoding/json"

"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/vt/key"
"vitess.io/vitess/go/vt/proto/query"
Expand Down Expand Up @@ -53,26 +51,6 @@ func (s *Send) NeedsTransaction() bool {
return s.IsDML
}

// MarshalJSON serializes the Send into a JSON representation.
// It's used for testing and diagnostics.
func (s *Send) MarshalJSON() ([]byte, error) {
marshalSend := struct {
Opcode string
Keyspace *vindexes.Keyspace
TargetDestination key.Destination
Query string
IsDML bool
}{
Opcode: "Send",
Keyspace: s.Keyspace,
TargetDestination: s.TargetDestination,
IsDML: s.IsDML,
Query: s.Query,
}

return json.Marshal(marshalSend)
}

// RouteType implements Primitive interface
func (s *Send) RouteType() string {
if s.IsDML {
Expand Down
15 changes: 0 additions & 15 deletions go/vt/vtgate/engine/update_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ limitations under the License.
package engine

import (
"encoding/json"

vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc"
"vitess.io/vitess/go/vt/vterrors"

Expand All @@ -45,19 +43,6 @@ func (updTarget *UpdateTarget) description() PrimitiveDescription {
}
}

// MarshalJSON serializes the UpdateTarget into a JSON representation.
// It's used for testing and diagnostics.
func (updTarget *UpdateTarget) MarshalJSON() ([]byte, error) {
marshalUpdateTarget := struct {
Opcode string
Target string
}{
Opcode: "UpdateTarget",
Target: updTarget.Target,
}
return json.Marshal(marshalUpdateTarget)
}

// RouteType implements the Primitive interface
func (updTarget UpdateTarget) RouteType() string {
return "UpdateTarget"
Expand Down
19 changes: 0 additions & 19 deletions go/vt/vtgate/engine/vindex_func.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,6 @@ type VindexFunc struct {
noTxNeeded
}

// MarshalJSON serializes the VindexFunc into a JSON representation.
// It's used for testing and diagnostics.
func (vf *VindexFunc) MarshalJSON() ([]byte, error) {
v := struct {
Opcode VindexOpcode
Fields []*querypb.Field
Cols []int
Vindex string
Value sqltypes.PlanValue
}{
Opcode: vf.Opcode,
Fields: vf.Fields,
Cols: vf.Cols,
Vindex: vf.Vindex.String(),
Value: vf.Value,
}
return json.Marshal(v)
}

// VindexOpcode is the opcode for a VindexFunc.
type VindexOpcode int

Expand Down