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

Method Process

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

Source from the content-addressed store, hash-verified

23553}
23554
23555func (p *iClientRPCServiceProcessorDeleteTimeseries) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
23556 args := IClientRPCServiceDeleteTimeseriesArgs{}
23557 var err2 error
23558 if err2 = args.Read(ctx, iprot); err2 != nil {
23559 iprot.ReadMessageEnd(ctx)
23560 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
23561 oprot.WriteMessageBegin(ctx, "deleteTimeseries", thrift.EXCEPTION, seqId)
23562 x.Write(ctx, oprot)
23563 oprot.WriteMessageEnd(ctx)
23564 oprot.Flush(ctx)
23565 return false, thrift.WrapTException(err2)
23566 }
23567 iprot.ReadMessageEnd(ctx)
23568
23569 tickerCancel := func() {}
23570 // Start a goroutine to do server side connectivity check.
23571 if thrift.ServerConnectivityCheckInterval > 0 {
23572 var cancel context.CancelFunc
23573 ctx, cancel = context.WithCancel(ctx)
23574 defer cancel()
23575 var tickerCtx context.Context
23576 tickerCtx, tickerCancel = context.WithCancel(context.Background())
23577 defer tickerCancel()
23578 go func(ctx context.Context, cancel context.CancelFunc) {
23579 ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
23580 defer ticker.Stop()
23581 for {
23582 select {
23583 case <-ctx.Done():
23584 return
23585 case <-ticker.C:
23586 if !iprot.Transport().IsOpen() {
23587 cancel()
23588 return
23589 }
23590 }
23591 }
23592 }(tickerCtx, cancel)
23593 }
23594
23595 result := IClientRPCServiceDeleteTimeseriesResult{}
23596 var retval *common.TSStatus
23597 if retval, err2 = p.handler.DeleteTimeseries(ctx, args.SessionId, args.Path); err2 != nil {
23598 tickerCancel()
23599 if err2 == thrift.ErrAbandonRequest {
23600 return false, thrift.WrapTException(err2)
23601 }
23602 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteTimeseries: " + err2.Error())
23603 oprot.WriteMessageBegin(ctx, "deleteTimeseries", thrift.EXCEPTION, seqId)
23604 x.Write(ctx, oprot)
23605 oprot.WriteMessageEnd(ctx)
23606 oprot.Flush(ctx)
23607 return true, thrift.WrapTException(err2)
23608 } else {
23609 result.Success = retval
23610 }
23611 tickerCancel()
23612 if err2 = oprot.WriteMessageBegin(ctx, "deleteTimeseries", thrift.REPLY, seqId); err2 != nil {

Callers

nothing calls this directly

Calls 5

ReadMethod · 0.95
WriteMethod · 0.95
DeleteTimeseriesMethod · 0.65
ErrorMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected