本文整理汇总了Golang中github.com/youtube/vitess/go/vt/proto/tabletmanagerservice.TabletManager_BackupServer类的典型用法代码示例。如果您正苦于以下问题:Golang TabletManager_BackupServer类的具体用法?Golang TabletManager_BackupServer怎么用?Golang TabletManager_BackupServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TabletManager_BackupServer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Backup
func (s *server) Backup(request *tabletmanagerdatapb.BackupRequest, stream tabletmanagerservicepb.TabletManager_BackupServer) error {
ctx := callinfo.GRPCCallInfo(stream.Context())
return s.agent.RPCWrapLockAction(ctx, actionnode.TabletActionBackup, request, nil, true, func() error {
// create a logger, send the result back to the caller
logger := logutil.NewChannelLogger(10)
wg := sync.WaitGroup{}
wg.Add(1)
go func() {
for e := range logger {
// Note we don't interrupt the loop here, as
// we still need to flush and finish the
// command, even if the channel to the client
// has been broken. We'll just keep trying
// to send.
stream.Send(&tabletmanagerdatapb.BackupResponse{
Event: logutil.LoggerEventToProto(&e),
})
}
wg.Done()
}()
err := s.agent.Backup(ctx, int(request.Concurrency), logger)
close(logger)
wg.Wait()
return err
})
}
开发者ID:tjyang,项目名称:vitess,代码行数:28,代码来源:server.go
示例2: Backup
func (s *server) Backup(request *tabletmanagerdatapb.BackupRequest, stream tabletmanagerservicepb.TabletManager_BackupServer) error {
ctx := callinfo.GRPCCallInfo(stream.Context())
return s.agent.RPCWrapLockAction(ctx, tabletmanager.TabletActionBackup, request, nil, true, func() error {
// create a logger, send the result back to the caller
logger := logutil.NewCallbackLogger(func(e *logutilpb.Event) {
// If the client disconnects, we will just fail
// to send the log events, but won't interrupt
// the backup.
stream.Send(&tabletmanagerdatapb.BackupResponse{
Event: e,
})
})
return s.agent.Backup(ctx, int(request.Concurrency), logger)
})
}
开发者ID:jmptrader,项目名称:vitess,代码行数:16,代码来源:server.go
示例3: Backup
func (s *server) Backup(request *tabletmanagerdatapb.BackupRequest, stream tabletmanagerservicepb.TabletManager_BackupServer) (err error) {
ctx := stream.Context()
defer s.agent.HandleRPCPanic(ctx, "Backup", request, nil, true /*verbose*/, &err)
ctx = callinfo.GRPCCallInfo(ctx)
// create a logger, send the result back to the caller
logger := logutil.NewCallbackLogger(func(e *logutilpb.Event) {
// If the client disconnects, we will just fail
// to send the log events, but won't interrupt
// the backup.
stream.Send(&tabletmanagerdatapb.BackupResponse{
Event: e,
})
})
return s.agent.Backup(ctx, int(request.Concurrency), logger)
}
开发者ID:erzel,项目名称:vitess,代码行数:17,代码来源:server.go
注:本文中的github.com/youtube/vitess/go/vt/proto/tabletmanagerservice.TabletManager_BackupServer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论