本文整理汇总了Golang中github.com/youtube/vitess/go/vt/proto/vtgateservice.Vitess_StreamExecuteKeyRangesServer类的典型用法代码示例。如果您正苦于以下问题:Golang Vitess_StreamExecuteKeyRangesServer类的具体用法?Golang Vitess_StreamExecuteKeyRangesServer怎么用?Golang Vitess_StreamExecuteKeyRangesServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vitess_StreamExecuteKeyRangesServer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: StreamExecuteKeyRanges
// StreamExecuteKeyRanges is the RPC version of
// vtgateservice.VTGateService method
func (vtg *VTGate) StreamExecuteKeyRanges(request *pb.StreamExecuteKeyRangesRequest, stream pbs.Vitess_StreamExecuteKeyRangesServer) (err error) {
defer vtg.server.HandlePanic(&err)
query := &proto.KeyRangeQuery{
Sql: string(request.Query.Sql),
BindVariables: tproto.Proto3ToBindVariables(request.Query.BindVariables),
Keyspace: request.Keyspace,
KeyRanges: key.ProtoToKeyRanges(request.KeyRanges),
TabletType: topo.ProtoToTabletType(request.TabletType),
}
return vtg.server.StreamExecuteKeyRanges(stream.Context(), query, func(value *proto.QueryResult) error {
return stream.Send(&pb.StreamExecuteKeyRangesResponse{
Result: mproto.QueryResultToProto3(value.Result),
})
})
}
开发者ID:afrolovskiy,项目名称:vitess,代码行数:18,代码来源:server.go
示例2: StreamExecuteKeyRanges
// StreamExecuteKeyRanges is the RPC version of
// vtgateservice.VTGateService method
func (vtg *VTGate) StreamExecuteKeyRanges(request *pb.StreamExecuteKeyRangesRequest, stream pbs.Vitess_StreamExecuteKeyRangesServer) (err error) {
defer vtg.server.HandlePanic(&err)
ctx := callerid.NewContext(callinfo.GRPCCallInfo(stream.Context()),
request.CallerId,
callerid.NewImmediateCallerID("grpc client"))
return vtg.server.StreamExecuteKeyRanges(ctx,
string(request.Query.Sql),
tproto.Proto3ToBindVariables(request.Query.BindVariables),
request.Keyspace,
key.ProtoToKeyRanges(request.KeyRanges),
request.TabletType,
func(value *proto.QueryResult) error {
return stream.Send(&pb.StreamExecuteKeyRangesResponse{
Result: mproto.QueryResultToProto3(value.Result),
})
})
}
开发者ID:payintel,项目名称:vitess,代码行数:19,代码来源:server.go
示例3: StreamExecuteKeyRanges
// StreamExecuteKeyRanges is the RPC version of
// vtgateservice.VTGateService method
func (vtg *VTGate) StreamExecuteKeyRanges(request *vtgatepb.StreamExecuteKeyRangesRequest, stream vtgateservicepb.Vitess_StreamExecuteKeyRangesServer) (err error) {
defer vtg.server.HandlePanic(&err)
ctx := withCallerIDContext(stream.Context(), request.CallerId)
bv, err := querytypes.Proto3ToBindVariables(request.Query.BindVariables)
if err != nil {
return vterrors.ToGRPCError(err)
}
vtgErr := vtg.server.StreamExecuteKeyRanges(ctx,
string(request.Query.Sql),
bv,
request.Keyspace,
request.KeyRanges,
request.TabletType,
func(value *sqltypes.Result) error {
return stream.Send(&vtgatepb.StreamExecuteKeyRangesResponse{
Result: sqltypes.ResultToProto3(value),
})
})
return vterrors.ToGRPCError(vtgErr)
}
开发者ID:CowLeo,项目名称:vitess,代码行数:22,代码来源:server.go
示例4: StreamExecuteKeyRanges
// StreamExecuteKeyRanges is the RPC version of
// vtgateservice.VTGateService method
func (vtg *VTGate) StreamExecuteKeyRanges(request *vtgatepb.StreamExecuteKeyRangesRequest, stream vtgateservicepb.Vitess_StreamExecuteKeyRangesServer) (err error) {
defer vtg.server.HandlePanic(&err)
ctx := callerid.NewContext(callinfo.GRPCCallInfo(stream.Context()),
request.CallerId,
callerid.NewImmediateCallerID("grpc client"))
bv, err := tproto.Proto3ToBindVariables(request.Query.BindVariables)
if err != nil {
return vterrors.ToGRPCError(err)
}
vtgErr := vtg.server.StreamExecuteKeyRanges(ctx,
string(request.Query.Sql),
bv,
request.Keyspace,
request.KeyRanges,
request.TabletType,
func(value *sqltypes.Result) error {
return stream.Send(&vtgatepb.StreamExecuteKeyRangesResponse{
Result: sqltypes.ResultToProto3(value),
})
})
return vterrors.ToGRPCError(vtgErr)
}
开发者ID:BobbWu,项目名称:vitess,代码行数:24,代码来源:server.go
注:本文中的github.com/youtube/vitess/go/vt/proto/vtgateservice.Vitess_StreamExecuteKeyRangesServer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论