kou commented on code in PR #36009:
URL: https://github.com/apache/arrow/pull/36009#discussion_r1233188564
##########
go/arrow/flight/client.go:
##########
@@ -348,6 +352,92 @@ func (c *client) Authenticate(ctx context.Context, opts
...grpc.CallOption) erro
return c.authHandler.Authenticate(ctx, &clientAuthConn{stream})
}
+func (c *client) CancelFlightInfo(ctx context.Context, info *FlightInfo, opts
...grpc.CallOption) (result CancelFlightInfoResult, err error) {
+ var action flight.Action
+ action.Type = CancelFlightInfoActionType
+ if action.Body, err = proto.Marshal(info); err != nil {
+ return
+ }
+
+ stream, err := c.DoAction(ctx, &action, opts...)
+ if err != nil {
+ return
+ }
+ res, err := stream.Recv()
+ if err != nil {
+ return
+ }
+ if err = proto.Unmarshal(res.Body, &result); err != nil {
+ return
+ }
+ for {
+ _, err = stream.Recv()
+ if errors.Is(err, io.EOF) {
+ break
+ }
+ if err != nil {
+ return
+ }
+ }
+ return
+}
+
+func (c *client) CloseFlightInfo(ctx context.Context, info *FlightInfo, opts
...grpc.CallOption) (err error) {
+ var action flight.Action
+ action.Type = CloseFlightInfoActionType
+ if action.Body, err = proto.Marshal(info); err != nil {
+ return
+ }
+
+ stream, err := c.DoAction(ctx, &action, opts...)
+ if err != nil {
+ return
+ }
+ for {
+ _, err = stream.Recv()
+ if errors.Is(err, io.EOF) {
+ break
+ }
+ if err != nil {
+ return
+ }
+ }
+ return
+}
+
+func (c *client) RefreshFlightEndpoint(ctx context.Context, endpoint
*FlightEndpoint, opts ...grpc.CallOption) (*FlightEndpoint, error) {
+ var err error
+
+ var action flight.Action
+ action.Type = RefreshFlightEndpointActionType
+ if action.Body, err = proto.Marshal(endpoint); err != nil {
+ return nil, err
+ }
+
+ stream, err := c.DoAction(ctx, &action, opts...)
+ if err != nil {
+ return nil, err
+ }
+ res, err := stream.Recv()
+ if err != nil {
+ return nil, err
+ }
+ var refreshedEndpoint FlightEndpoint
+ if err = proto.Unmarshal(res.Body, &refreshedEndpoint); err != nil {
+ return nil, err
+ }
+ for {
+ _, err = stream.Recv()
+ if errors.Is(err, io.EOF) {
+ break
+ }
+ if err != nil {
+ return nil, err
+ }
+ }
+ return &refreshedEndpoint, nil
+}
Review Comment:
You're right.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]