Skip to content

Commit

Permalink
Merge pull request vitessio#1467 from alainjobart/resharding
Browse files Browse the repository at this point in the history
Renaming xid_{type,value} to {type,value} in the proto3
  • Loading branch information
alainjobart committed Jan 29, 2016
2 parents 86a1644 + 963e0f7 commit 014ff36
Show file tree
Hide file tree
Showing 16 changed files with 218 additions and 222 deletions.
14 changes: 7 additions & 7 deletions go/cmd/vtgateclienttest/goclienttest/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ var (
entityKeyspaceIDs = []*vtgatepb.ExecuteEntityIdsRequest_EntityId{
{
KeyspaceId: []byte{1, 2, 3},
XidType: sqltypes.Int64,
XidValue: []byte("123"),
Type: sqltypes.Int64,
Value: []byte("123"),
},
{
KeyspaceId: []byte{4, 5, 6},
XidType: sqltypes.Float64,
XidValue: []byte("2"),
Type: sqltypes.Float64,
Value: []byte("2"),
},
{
KeyspaceId: []byte{7, 8, 9},
XidType: sqltypes.VarBinary,
XidValue: []byte{1, 2, 3},
Type: sqltypes.VarBinary,
Value: []byte{1, 2, 3},
},
}
entityKeyspaceIDsEcho = "[xid_type:INT64 xid_value:\"123\" keyspace_id:\"\\001\\002\\003\" xid_type:FLOAT64 xid_value:\"2\" keyspace_id:\"\\004\\005\\006\" xid_type:VARBINARY xid_value:\"\\001\\002\\003\" keyspace_id:\"\\007\\010\\t\" ]"
entityKeyspaceIDsEcho = "[type:INT64 value:\"123\" keyspace_id:\"\\001\\002\\003\" type:FLOAT64 value:\"2\" keyspace_id:\"\\004\\005\\006\" type:VARBINARY value:\"\\001\\002\\003\" keyspace_id:\"\\007\\010\\t\" ]"

tabletType = topodatapb.TabletType_REPLICA
tabletTypeEcho = topodatapb.TabletType_name[int32(tabletType)]
Expand Down
144 changes: 72 additions & 72 deletions go/vt/proto/vtgate/vtgate.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions go/vt/vtgate/gorpcvtgatecommon/proto3.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func EntityIdsToProto(l []EntityId) []*vtgatepb.ExecuteEntityIdsRequest_EntityId
if err != nil {
panic(err)
}
result[i].XidType = v.Type
result[i].XidValue = v.Value
result[i].Type = v.Type
result[i].Value = v.Value
}
return result
}
Expand All @@ -41,7 +41,7 @@ func ProtoToEntityIds(l []*vtgatepb.ExecuteEntityIdsRequest_EntityId) []EntityId
}
result := make([]EntityId, len(l))
for i, e := range l {
v, err := sqltypes.ValueFromBytes(e.XidType, e.XidValue)
v, err := sqltypes.ValueFromBytes(e.Type, e.Value)
if err != nil {
panic(err)
}
Expand Down
8 changes: 4 additions & 4 deletions go/vt/vtgate/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ func TestResolverExecuteEntityIds(t *testing.T) {
"col",
[]*vtgatepb.ExecuteEntityIdsRequest_EntityId{
{
XidType: sqltypes.Int64,
XidValue: []byte("0"),
Type: sqltypes.Int64,
Value: []byte("0"),
KeyspaceId: []byte{0x10},
},
{
XidType: sqltypes.VarBinary,
XidValue: []byte("1"),
Type: sqltypes.VarBinary,
Value: []byte("1"),
KeyspaceId: []byte{0x25},
},
},
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vtgate/topo_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func mapEntityIdsToShards(ctx context.Context, topoServ topo.SrvTopoServer, cell
if err != nil {
return "", nil, err
}
v, err := sqltypes.ValueFromBytes(eid.XidType, eid.XidValue)
v, err := sqltypes.ValueFromBytes(eid.Type, eid.Value)
if err != nil {
return "", nil, err
}
Expand Down
24 changes: 12 additions & 12 deletions go/vt/vtgate/vtgate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ func TestVTGateExecuteEntityIds(t *testing.T) {
"kid",
[]*vtgatepb.ExecuteEntityIdsRequest_EntityId{
{
XidType: sqltypes.VarBinary,
XidValue: []byte("id1"),
Type: sqltypes.VarBinary,
Value: []byte("id1"),
KeyspaceId: []byte{0x10},
},
},
Expand Down Expand Up @@ -352,8 +352,8 @@ func TestVTGateExecuteEntityIds(t *testing.T) {
"kid",
[]*vtgatepb.ExecuteEntityIdsRequest_EntityId{
{
XidType: sqltypes.VarBinary,
XidValue: []byte("id1"),
Type: sqltypes.VarBinary,
Value: []byte("id1"),
KeyspaceId: []byte{0x10},
},
},
Expand Down Expand Up @@ -386,13 +386,13 @@ func TestVTGateExecuteEntityIds(t *testing.T) {
"kid",
[]*vtgatepb.ExecuteEntityIdsRequest_EntityId{
{
XidType: sqltypes.VarBinary,
XidValue: []byte("id1"),
Type: sqltypes.VarBinary,
Value: []byte("id1"),
KeyspaceId: []byte{0x10},
},
{
XidType: sqltypes.VarBinary,
XidValue: []byte("id2"),
Type: sqltypes.VarBinary,
Value: []byte("id2"),
KeyspaceId: []byte{0x30},
},
},
Expand Down Expand Up @@ -845,13 +845,13 @@ func TestAnnotatingExecuteEntityIds(t *testing.T) {
"entity_column_name",
[]*vtgatepb.ExecuteEntityIdsRequest_EntityId{
{
XidType: sqltypes.Int64,
XidValue: []byte("0"),
Type: sqltypes.Int64,
Value: []byte("0"),
KeyspaceId: []byte{0x10}, // First shard.
},
{
XidType: sqltypes.Int64,
XidValue: []byte("1"),
Type: sqltypes.Int64,
Value: []byte("1"),
KeyspaceId: []byte{0x25}, // Second shard.
},
},
Expand Down
Loading

0 comments on commit 014ff36

Please sign in to comment.