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

Method Process

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

Source from the content-addressed store, hash-verified

23632}
23633
23634func (p *iClientRPCServiceProcessorDeleteStorageGroups) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
23635 args := IClientRPCServiceDeleteStorageGroupsArgs{}
23636 var err2 error
23637 if err2 = args.Read(ctx, iprot); err2 != nil {
23638 iprot.ReadMessageEnd(ctx)
23639 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
23640 oprot.WriteMessageBegin(ctx, "deleteStorageGroups", thrift.EXCEPTION, seqId)
23641 x.Write(ctx, oprot)
23642 oprot.WriteMessageEnd(ctx)
23643 oprot.Flush(ctx)
23644 return false, thrift.WrapTException(err2)
23645 }
23646 iprot.ReadMessageEnd(ctx)
23647
23648 tickerCancel := func() {}
23649 // Start a goroutine to do server side connectivity check.
23650 if thrift.ServerConnectivityCheckInterval > 0 {
23651 var cancel context.CancelFunc
23652 ctx, cancel = context.WithCancel(ctx)
23653 defer cancel()
23654 var tickerCtx context.Context
23655 tickerCtx, tickerCancel = context.WithCancel(context.Background())
23656 defer tickerCancel()
23657 go func(ctx context.Context, cancel context.CancelFunc) {
23658 ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
23659 defer ticker.Stop()
23660 for {
23661 select {
23662 case <-ctx.Done():
23663 return
23664 case <-ticker.C:
23665 if !iprot.Transport().IsOpen() {
23666 cancel()
23667 return
23668 }
23669 }
23670 }
23671 }(tickerCtx, cancel)
23672 }
23673
23674 result := IClientRPCServiceDeleteStorageGroupsResult{}
23675 var retval *common.TSStatus
23676 if retval, err2 = p.handler.DeleteStorageGroups(ctx, args.SessionId, args.StorageGroup); err2 != nil {
23677 tickerCancel()
23678 if err2 == thrift.ErrAbandonRequest {
23679 return false, thrift.WrapTException(err2)
23680 }
23681 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteStorageGroups: " + err2.Error())
23682 oprot.WriteMessageBegin(ctx, "deleteStorageGroups", thrift.EXCEPTION, seqId)
23683 x.Write(ctx, oprot)
23684 oprot.WriteMessageEnd(ctx)
23685 oprot.Flush(ctx)
23686 return true, thrift.WrapTException(err2)
23687 } else {
23688 result.Success = retval
23689 }
23690 tickerCancel()
23691 if err2 = oprot.WriteMessageBegin(ctx, "deleteStorageGroups", thrift.REPLY, seqId); err2 != nil {

Callers

nothing calls this directly

Calls 5

ReadMethod · 0.95
WriteMethod · 0.95
DeleteStorageGroupsMethod · 0.65
ErrorMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected