MCPcopy Create free account
hub / github.com/apache/iotdb-client-go / Process

Method Process

rpc/client.go:21896–21969  ·  view source on GitHub ↗
(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol)

Source from the content-addressed store, hash-verified

21894}
21895
21896func (p *iClientRPCServiceProcessorFetchResultsV2) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
21897 args := IClientRPCServiceFetchResultsV2Args{}
21898 var err2 error
21899 if err2 = args.Read(ctx, iprot); err2 != nil {
21900 iprot.ReadMessageEnd(ctx)
21901 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
21902 oprot.WriteMessageBegin(ctx, "fetchResultsV2", thrift.EXCEPTION, seqId)
21903 x.Write(ctx, oprot)
21904 oprot.WriteMessageEnd(ctx)
21905 oprot.Flush(ctx)
21906 return false, thrift.WrapTException(err2)
21907 }
21908 iprot.ReadMessageEnd(ctx)
21909
21910 tickerCancel := func() {}
21911 // Start a goroutine to do server side connectivity check.
21912 if thrift.ServerConnectivityCheckInterval > 0 {
21913 var cancel context.CancelFunc
21914 ctx, cancel = context.WithCancel(ctx)
21915 defer cancel()
21916 var tickerCtx context.Context
21917 tickerCtx, tickerCancel = context.WithCancel(context.Background())
21918 defer tickerCancel()
21919 go func(ctx context.Context, cancel context.CancelFunc) {
21920 ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
21921 defer ticker.Stop()
21922 for {
21923 select {
21924 case <-ctx.Done():
21925 return
21926 case <-ticker.C:
21927 if !iprot.Transport().IsOpen() {
21928 cancel()
21929 return
21930 }
21931 }
21932 }
21933 }(tickerCtx, cancel)
21934 }
21935
21936 result := IClientRPCServiceFetchResultsV2Result{}
21937 var retval *TSFetchResultsResp
21938 if retval, err2 = p.handler.FetchResultsV2(ctx, args.Req); err2 != nil {
21939 tickerCancel()
21940 if err2 == thrift.ErrAbandonRequest {
21941 return false, thrift.WrapTException(err2)
21942 }
21943 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing fetchResultsV2: " + err2.Error())
21944 oprot.WriteMessageBegin(ctx, "fetchResultsV2", thrift.EXCEPTION, seqId)
21945 x.Write(ctx, oprot)
21946 oprot.WriteMessageEnd(ctx)
21947 oprot.Flush(ctx)
21948 return true, thrift.WrapTException(err2)
21949 } else {
21950 result.Success = retval
21951 }
21952 tickerCancel()
21953 if err2 = oprot.WriteMessageBegin(ctx, "fetchResultsV2", thrift.REPLY, seqId); err2 != nil {

Callers

nothing calls this directly

Calls 5

ReadMethod · 0.95
WriteMethod · 0.95
FetchResultsV2Method · 0.65
ErrorMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected