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

Method Process

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

Source from the content-addressed store, hash-verified

24896}
24897
24898func (p *iClientRPCServiceProcessorDeleteData) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
24899 args := IClientRPCServiceDeleteDataArgs{}
24900 var err2 error
24901 if err2 = args.Read(ctx, iprot); err2 != nil {
24902 iprot.ReadMessageEnd(ctx)
24903 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
24904 oprot.WriteMessageBegin(ctx, "deleteData", thrift.EXCEPTION, seqId)
24905 x.Write(ctx, oprot)
24906 oprot.WriteMessageEnd(ctx)
24907 oprot.Flush(ctx)
24908 return false, thrift.WrapTException(err2)
24909 }
24910 iprot.ReadMessageEnd(ctx)
24911
24912 tickerCancel := func() {}
24913 // Start a goroutine to do server side connectivity check.
24914 if thrift.ServerConnectivityCheckInterval > 0 {
24915 var cancel context.CancelFunc
24916 ctx, cancel = context.WithCancel(ctx)
24917 defer cancel()
24918 var tickerCtx context.Context
24919 tickerCtx, tickerCancel = context.WithCancel(context.Background())
24920 defer tickerCancel()
24921 go func(ctx context.Context, cancel context.CancelFunc) {
24922 ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
24923 defer ticker.Stop()
24924 for {
24925 select {
24926 case <-ctx.Done():
24927 return
24928 case <-ticker.C:
24929 if !iprot.Transport().IsOpen() {
24930 cancel()
24931 return
24932 }
24933 }
24934 }
24935 }(tickerCtx, cancel)
24936 }
24937
24938 result := IClientRPCServiceDeleteDataResult{}
24939 var retval *common.TSStatus
24940 if retval, err2 = p.handler.DeleteData(ctx, args.Req); err2 != nil {
24941 tickerCancel()
24942 if err2 == thrift.ErrAbandonRequest {
24943 return false, thrift.WrapTException(err2)
24944 }
24945 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteData: " + err2.Error())
24946 oprot.WriteMessageBegin(ctx, "deleteData", thrift.EXCEPTION, seqId)
24947 x.Write(ctx, oprot)
24948 oprot.WriteMessageEnd(ctx)
24949 oprot.Flush(ctx)
24950 return true, thrift.WrapTException(err2)
24951 } else {
24952 result.Success = retval
24953 }
24954 tickerCancel()
24955 if err2 = oprot.WriteMessageBegin(ctx, "deleteData", thrift.REPLY, seqId); err2 != nil {

Callers

nothing calls this directly

Calls 5

ReadMethod · 0.95
WriteMethod · 0.95
DeleteDataMethod · 0.65
ErrorMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected