Esempio n. 1
0
func (s *server) StopBlp(ctx context.Context, request *pb.StopBlpRequest) (*pb.StopBlpResponse, error) {
	ctx = callinfo.GRPCCallInfo(ctx)
	response := &pb.StopBlpResponse{}
	return response, s.agent.RPCWrapLock(ctx, actionnode.TabletActionStopBLP, request, response, true, func() error {
		positions, err := s.agent.StopBlp(ctx)
		if err == nil {
			response.BlpPositions = blproto.BlpPositionListToProto(positions)
		}
		return err
	})
}
Esempio n. 2
0
// RunBlpUntil is part of the tmclient.TabletManagerClient interface
func (client *Client) RunBlpUntil(ctx context.Context, tablet *topo.TabletInfo, positions *blproto.BlpPositionList, waitTime time.Duration) (myproto.ReplicationPosition, error) {
	cc, c, err := client.dial(ctx, tablet)
	if err != nil {
		return myproto.ReplicationPosition{}, err
	}
	defer cc.Close()
	response, err := c.RunBlpUntil(ctx, &pb.RunBlpUntilRequest{
		BlpPositions: blproto.BlpPositionListToProto(positions),
		WaitTimeout:  int64(waitTime),
	})
	if err != nil {
		return myproto.ReplicationPosition{}, err
	}
	return myproto.ProtoToReplicationPosition(response.Position), nil
}