From 10bacb7fd0bc9da8381067b7ce56ae03da1aafbd Mon Sep 17 00:00:00 2001 From: Nabil Salah Date: Wed, 29 Jan 2025 21:07:04 +0200 Subject: [PATCH] Alias samping.thrift and clean thrift files (#6630) ## Which problem is this PR solving? - https://github.com/jaegertracing/jaeger/issues/6617 ## Description of the changes - remove unused Thrift files - remove thrift makefile - edit makefile - alias samping.thrift ## How was this change tested? - `make test lint` ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [ ] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: nabil salah Signed-off-by: Nabil Salah --- .github/workflows/ci-lint-checks.yaml | 3 - Makefile | 4 +- Makefile.Thrift.mk | 22 - proto-gen/api_v2/collector.go | 3 + proto-gen/api_v2/query.go | 3 + proto-gen/api_v2/sampling.go | 3 + thrift-gen/agent/agent.go | 19 +- thrift-gen/baggage/GoUnusedProtection__.go | 6 - thrift-gen/baggage/baggage-consts.go | 30 - thrift-gen/baggage/baggage.go | 591 -------- thrift-gen/jaeger/jaeger.go | 45 +- thrift-gen/sampling/GoUnusedProtection__.go | 6 - thrift-gen/sampling/sampling-consts.go | 30 - thrift-gen/sampling/sampling.go | 1360 +------------------ thrift-gen/zipkincore/zipkincore.go | 74 +- 15 files changed, 128 insertions(+), 2071 deletions(-) delete mode 100644 Makefile.Thrift.mk delete mode 100644 thrift-gen/baggage/GoUnusedProtection__.go delete mode 100644 thrift-gen/baggage/baggage-consts.go delete mode 100644 thrift-gen/baggage/baggage.go delete mode 100644 thrift-gen/sampling/GoUnusedProtection__.go delete mode 100644 thrift-gen/sampling/sampling-consts.go diff --git a/.github/workflows/ci-lint-checks.yaml b/.github/workflows/ci-lint-checks.yaml index f9cd7c1804e..bb8786248cf 100644 --- a/.github/workflows/ci-lint-checks.yaml +++ b/.github/workflows/ci-lint-checks.yaml @@ -88,9 +88,6 @@ jobs: - name: Verify Protobuf types are up to date run: make proto && { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi } - - name: Verify Thrift types are up to date - run: make thrift && { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi } - - name: Verify Mockery types are up to date run: make generate-mocks && { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi } diff --git a/Makefile b/Makefile index 4337ead083e..65ab6ae5b52 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,6 @@ ALL_SRC = $(shell find . -name '*.go' \ -not -path './internal/tools/*' \ -not -path './docker/debug/*' \ -not -path '*/mocks/*' \ - -not -path '*/*-gen/*' \ -not -path '*/thrift-0.9.2/*' \ -type f | \ sort) @@ -47,7 +46,7 @@ SCRIPTS_SRC = $(shell find . \( -name '*.sh' -o -name '*.py' -o -name '*.mk' -o sort) # ALL_PKGS is used with 'nocover' and 'goleak' -ALL_PKGS = $(shell echo $(dir $(ALL_SRC)) | tr ' ' '\n' | sort -u) +ALL_PKGS = $(shell echo $(dir $(ALL_SRC)) | tr ' ' '\n' | grep -v '/.*-gen/' | sort -u) GO=go GOOS ?= $(shell $(GO) env GOOS) @@ -82,7 +81,6 @@ include Makefile.Crossdock.mk include Makefile.Docker.mk include Makefile.IntegrationTests.mk include Makefile.Protobuf.mk -include Makefile.Thrift.mk include Makefile.Tools.mk include Makefile.Windows.mk diff --git a/Makefile.Thrift.mk b/Makefile.Thrift.mk deleted file mode 100644 index 85f938ab42b..00000000000 --- a/Makefile.Thrift.mk +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2023 The Jaeger Authors. -# SPDX-License-Identifier: Apache-2.0 - -THRIFT_VER=0.19 -THRIFT_IMG=jaegertracing/thrift:$(THRIFT_VER) -THRIFT=docker run --rm -u ${shell id -u} -v "${PWD}:/data" $(THRIFT_IMG) thrift -THRIFT_GO_ARGS=thrift_import="github.com/apache/thrift/lib/go/thrift" -THRIFT_GEN_DIR=thrift-gen - -.PHONY: thrift-image -thrift-image: - $(THRIFT) -version - -.PHONY: thrift -thrift: idl/thrift/jaeger.thrift thrift-image - [ -d $(THRIFT_GEN_DIR) ] || mkdir $(THRIFT_GEN_DIR) - $(THRIFT) -o /data --gen go:$(THRIFT_GO_ARGS) --out /data/$(THRIFT_GEN_DIR) /data/idl/thrift/sampling.thrift - $(THRIFT) -o /data --gen go:$(THRIFT_GO_ARGS) --out /data/$(THRIFT_GEN_DIR) /data/idl/thrift/baggage.thrift - rm -rf thrift-gen/*/*-remote thrift-gen/*/*.bak - -idl/thrift/jaeger.thrift: - $(MAKE) init-submodules diff --git a/proto-gen/api_v2/collector.go b/proto-gen/api_v2/collector.go index 41c4242700b..617edc23a78 100644 --- a/proto-gen/api_v2/collector.go +++ b/proto-gen/api_v2/collector.go @@ -1,3 +1,6 @@ +// Copyright (c) 2025 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 + package api_v2 import ( diff --git a/proto-gen/api_v2/query.go b/proto-gen/api_v2/query.go index b60a194fb66..77c257bd26d 100644 --- a/proto-gen/api_v2/query.go +++ b/proto-gen/api_v2/query.go @@ -1,3 +1,6 @@ +// Copyright (c) 2025 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 + package api_v2 import ( diff --git a/proto-gen/api_v2/sampling.go b/proto-gen/api_v2/sampling.go index 33c1004acc1..2797a331ba4 100644 --- a/proto-gen/api_v2/sampling.go +++ b/proto-gen/api_v2/sampling.go @@ -1,3 +1,6 @@ +// Copyright (c) 2025 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 + package api_v2 import ( diff --git a/thrift-gen/agent/agent.go b/thrift-gen/agent/agent.go index b8356b7be83..794dc888cc9 100644 --- a/thrift-gen/agent/agent.go +++ b/thrift-gen/agent/agent.go @@ -1,21 +1,30 @@ +// Copyright (c) 2025 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 + package agent import ( - modelv1 "github.com/jaegertracing/jaeger-idl/thrift-gen/agent" + modelv1 "github.com/jaegertracing/jaeger-idl/thrift-gen/agent" ) type Agent = modelv1.Agent type AgentClient = modelv1.AgentClient -var NewAgentClientFactory = modelv1.NewAgentClientFactory -var NewAgentClientProtocol = modelv1.NewAgentClientProtocol -var NewAgentClient = modelv1.NewAgentClient + +var ( + NewAgentClientFactory = modelv1.NewAgentClientFactory + NewAgentClientProtocol = modelv1.NewAgentClientProtocol + NewAgentClient = modelv1.NewAgentClient +) type AgentProcessor = modelv1.AgentProcessor + var NewAgentProcessor = modelv1.NewAgentProcessor type AgentEmitZipkinBatchArgs = modelv1.AgentEmitZipkinBatchArgs + var NewAgentEmitZipkinBatchArgs = modelv1.NewAgentEmitZipkinBatchArgs type AgentEmitBatchArgs = modelv1.AgentEmitBatchArgs -var NewAgentEmitBatchArgs = modelv1.NewAgentEmitBatchArgs \ No newline at end of file + +var NewAgentEmitBatchArgs = modelv1.NewAgentEmitBatchArgs diff --git a/thrift-gen/baggage/GoUnusedProtection__.go b/thrift-gen/baggage/GoUnusedProtection__.go deleted file mode 100644 index 2a12aadf771..00000000000 --- a/thrift-gen/baggage/GoUnusedProtection__.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. - -package baggage - -var GoUnusedProtection__ int; - diff --git a/thrift-gen/baggage/baggage-consts.go b/thrift-gen/baggage/baggage-consts.go deleted file mode 100644 index ddc1c2702d2..00000000000 --- a/thrift-gen/baggage/baggage-consts.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. - -package baggage - -import ( - "bytes" - "context" - "errors" - "fmt" - "time" - thrift "github.com/apache/thrift/lib/go/thrift" - "strings" - "regexp" -) - -// (needed to ensure safety because of naive import list construction.) -var _ = thrift.ZERO -var _ = fmt.Printf -var _ = errors.New -var _ = context.Background -var _ = time.Now -var _ = bytes.Equal -// (needed by validator.) -var _ = strings.Contains -var _ = regexp.MatchString - - -func init() { -} - diff --git a/thrift-gen/baggage/baggage.go b/thrift-gen/baggage/baggage.go deleted file mode 100644 index 3d5db071478..00000000000 --- a/thrift-gen/baggage/baggage.go +++ /dev/null @@ -1,591 +0,0 @@ -// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. - -package baggage - -import ( - "bytes" - "context" - "errors" - "fmt" - "time" - thrift "github.com/apache/thrift/lib/go/thrift" - "strings" - "regexp" -) - -// (needed to ensure safety because of naive import list construction.) -var _ = thrift.ZERO -var _ = fmt.Printf -var _ = errors.New -var _ = context.Background -var _ = time.Now -var _ = bytes.Equal -// (needed by validator.) -var _ = strings.Contains -var _ = regexp.MatchString - -// Attributes: -// - BaggageKey -// - MaxValueLength -type BaggageRestriction struct { - BaggageKey string `thrift:"baggageKey,1,required" db:"baggageKey" json:"baggageKey"` - MaxValueLength int32 `thrift:"maxValueLength,2,required" db:"maxValueLength" json:"maxValueLength"` -} - -func NewBaggageRestriction() *BaggageRestriction { - return &BaggageRestriction{} -} - - -func (p *BaggageRestriction) GetBaggageKey() string { - return p.BaggageKey -} - -func (p *BaggageRestriction) GetMaxValueLength() int32 { - return p.MaxValueLength -} -func (p *BaggageRestriction) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetBaggageKey bool = false; - var issetMaxValueLength bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetBaggageKey = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetMaxValueLength = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetBaggageKey{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field BaggageKey is not set")); - } - if !issetMaxValueLength{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxValueLength is not set")); - } - return nil -} - -func (p *BaggageRestriction) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.BaggageKey = v -} - return nil -} - -func (p *BaggageRestriction) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.MaxValueLength = v -} - return nil -} - -func (p *BaggageRestriction) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "BaggageRestriction"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *BaggageRestriction) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "baggageKey", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:baggageKey: ", p), err) } - if err := oprot.WriteString(ctx, string(p.BaggageKey)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.baggageKey (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:baggageKey: ", p), err) } - return err -} - -func (p *BaggageRestriction) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "maxValueLength", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:maxValueLength: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.MaxValueLength)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxValueLength (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:maxValueLength: ", p), err) } - return err -} - -func (p *BaggageRestriction) Equals(other *BaggageRestriction) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.BaggageKey != other.BaggageKey { return false } - if p.MaxValueLength != other.MaxValueLength { return false } - return true -} - -func (p *BaggageRestriction) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BaggageRestriction(%+v)", *p) -} - -func (p *BaggageRestriction) Validate() error { - return nil -} -type BaggageRestrictionManager interface { - // getBaggageRestrictions retrieves the baggage restrictions for a specific service. - // Usually, baggageRestrictions apply to all services however there may be situations - // where a baggageKey might only be allowed to be set by a specific service. - // - // Parameters: - // - ServiceName - GetBaggageRestrictions(ctx context.Context, serviceName string) (_r []*BaggageRestriction, _err error) -} - -type BaggageRestrictionManagerClient struct { - c thrift.TClient - meta thrift.ResponseMeta -} - -func NewBaggageRestrictionManagerClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *BaggageRestrictionManagerClient { - return &BaggageRestrictionManagerClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } -} - -func NewBaggageRestrictionManagerClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *BaggageRestrictionManagerClient { - return &BaggageRestrictionManagerClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} - -func NewBaggageRestrictionManagerClient(c thrift.TClient) *BaggageRestrictionManagerClient { - return &BaggageRestrictionManagerClient{ - c: c, - } -} - -func (p *BaggageRestrictionManagerClient) Client_() thrift.TClient { - return p.c -} - -func (p *BaggageRestrictionManagerClient) LastResponseMeta_() thrift.ResponseMeta { - return p.meta -} - -func (p *BaggageRestrictionManagerClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { - p.meta = meta -} - -// getBaggageRestrictions retrieves the baggage restrictions for a specific service. -// Usually, baggageRestrictions apply to all services however there may be situations -// where a baggageKey might only be allowed to be set by a specific service. -// -// Parameters: -// - ServiceName -func (p *BaggageRestrictionManagerClient) GetBaggageRestrictions(ctx context.Context, serviceName string) (_r []*BaggageRestriction, _err error) { - var _args0 BaggageRestrictionManagerGetBaggageRestrictionsArgs - _args0.ServiceName = serviceName - var _result2 BaggageRestrictionManagerGetBaggageRestrictionsResult - var _meta1 thrift.ResponseMeta - _meta1, _err = p.Client_().Call(ctx, "getBaggageRestrictions", &_args0, &_result2) - p.SetLastResponseMeta_(_meta1) - if _err != nil { - return - } - return _result2.GetSuccess(), nil -} - -type BaggageRestrictionManagerProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler BaggageRestrictionManager -} - -func (p *BaggageRestrictionManagerProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *BaggageRestrictionManagerProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *BaggageRestrictionManagerProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} - -func NewBaggageRestrictionManagerProcessor(handler BaggageRestrictionManager) *BaggageRestrictionManagerProcessor { - - self3 := &BaggageRestrictionManagerProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self3.processorMap["getBaggageRestrictions"] = &baggageRestrictionManagerProcessorGetBaggageRestrictions{handler:handler} -return self3 -} - -func (p *BaggageRestrictionManagerProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) - if err2 != nil { return false, thrift.WrapTException(err2) } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(ctx, thrift.STRUCT) - iprot.ReadMessageEnd(ctx) - x4 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) - x4.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, x4 - -} - -type baggageRestrictionManagerProcessorGetBaggageRestrictions struct { - handler BaggageRestrictionManager -} - -func (p *baggageRestrictionManagerProcessorGetBaggageRestrictions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err5 error - args := BaggageRestrictionManagerGetBaggageRestrictionsArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "getBaggageRestrictions", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := BaggageRestrictionManagerGetBaggageRestrictionsResult{} - if retval, err2 := p.handler.GetBaggageRestrictions(ctx, args.ServiceName); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc6 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getBaggageRestrictions: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "getBaggageRestrictions", thrift.EXCEPTION, seqId); err2 != nil { - _write_err5 = thrift.WrapTException(err2) - } - if err2 := _exc6.Write(ctx, oprot); _write_err5 == nil && err2 != nil { - _write_err5 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err5 == nil && err2 != nil { - _write_err5 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err5 == nil && err2 != nil { - _write_err5 = thrift.WrapTException(err2) - } - if _write_err5 != nil { - return false, thrift.WrapTException(_write_err5) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "getBaggageRestrictions", thrift.REPLY, seqId); err2 != nil { - _write_err5 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err5 == nil && err2 != nil { - _write_err5 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err5 == nil && err2 != nil { - _write_err5 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err5 == nil && err2 != nil { - _write_err5 = thrift.WrapTException(err2) - } - if _write_err5 != nil { - return false, thrift.WrapTException(_write_err5) - } - return true, err -} - - -// HELPER FUNCTIONS AND STRUCTURES - -// Attributes: -// - ServiceName -type BaggageRestrictionManagerGetBaggageRestrictionsArgs struct { - ServiceName string `thrift:"serviceName,1" db:"serviceName" json:"serviceName"` -} - -func NewBaggageRestrictionManagerGetBaggageRestrictionsArgs() *BaggageRestrictionManagerGetBaggageRestrictionsArgs { - return &BaggageRestrictionManagerGetBaggageRestrictionsArgs{} -} - - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) GetServiceName() string { - return p.ServiceName -} -func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.ServiceName = v -} - return nil -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "getBaggageRestrictions_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "serviceName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.ServiceName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.serviceName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceName: ", p), err) } - return err -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BaggageRestrictionManagerGetBaggageRestrictionsArgs(%+v)", *p) -} - -// Attributes: -// - Success -type BaggageRestrictionManagerGetBaggageRestrictionsResult struct { - Success []*BaggageRestriction `thrift:"success,0" db:"success" json:"success,omitempty"` -} - -func NewBaggageRestrictionManagerGetBaggageRestrictionsResult() *BaggageRestrictionManagerGetBaggageRestrictionsResult { - return &BaggageRestrictionManagerGetBaggageRestrictionsResult{} -} - -var BaggageRestrictionManagerGetBaggageRestrictionsResult_Success_DEFAULT []*BaggageRestriction - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) GetSuccess() []*BaggageRestriction { - return p.Success -} -func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.LIST { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*BaggageRestriction, 0, size) - p.Success = tSlice - for i := 0; i < size; i ++ { - _elem7 := &BaggageRestriction{} - if err := _elem7.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) - } - p.Success = append(p.Success, _elem7) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "getBaggageRestrictions_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Success { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BaggageRestrictionManagerGetBaggageRestrictionsResult(%+v)", *p) -} - - diff --git a/thrift-gen/jaeger/jaeger.go b/thrift-gen/jaeger/jaeger.go index 4aab1f0100c..322d25e5083 100644 --- a/thrift-gen/jaeger/jaeger.go +++ b/thrift-gen/jaeger/jaeger.go @@ -1,55 +1,72 @@ +// Copyright (c) 2025 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 + package jaeger import ( - modelv1 "github.com/jaegertracing/jaeger-idl/thrift-gen/jaeger" + modelv1 "github.com/jaegertracing/jaeger-idl/thrift-gen/jaeger" ) type TagType = modelv1.TagType const ( - TagType_STRING = modelv1.TagType_STRING - TagType_DOUBLE = modelv1.TagType_DOUBLE - TagType_BOOL = modelv1.TagType_BOOL - TagType_LONG = modelv1.TagType_LONG - TagType_BINARY = modelv1.TagType_BINARY + TagType_STRING = modelv1.TagType_STRING + TagType_DOUBLE = modelv1.TagType_DOUBLE + TagType_BOOL = modelv1.TagType_BOOL + TagType_LONG = modelv1.TagType_LONG + TagType_BINARY = modelv1.TagType_BINARY ) type SpanRefType = modelv1.SpanRefType const ( - SpanRefType_CHILD_OF = modelv1.SpanRefType_CHILD_OF - SpanRefType_FOLLOWS_FROM = modelv1.SpanRefType_FOLLOWS_FROM + SpanRefType_CHILD_OF = modelv1.SpanRefType_CHILD_OF + SpanRefType_FOLLOWS_FROM = modelv1.SpanRefType_FOLLOWS_FROM ) type Tag = modelv1.Tag + var NewTag = modelv1.NewTag type Log = modelv1.Log + var NewLog = modelv1.NewLog type SpanRef = modelv1.SpanRef + var NewSpanRef = modelv1.NewSpanRef type Span = modelv1.Span + var NewSpan = modelv1.NewSpan type Process = modelv1.Process + var NewProcess = modelv1.NewProcess type Batch = modelv1.Batch + var NewBatch = modelv1.NewBatch type BatchSubmitResponse = modelv1.BatchSubmitResponse + var NewBatchSubmitResponse = modelv1.NewBatchSubmitResponse type ClientStats = modelv1.ClientStats + var NewClientStats = modelv1.NewClientStats -type Collector = modelv1.Collector -type CollectorClient = modelv1.CollectorClient -var NewCollectorClientFactory = modelv1.NewCollectorClientFactory -var NewCollectorClientProtocol = modelv1.NewCollectorClientProtocol -var NewCollectorClient = modelv1.NewCollectorClient +type ( + Collector = modelv1.Collector + CollectorClient = modelv1.CollectorClient +) + +var ( + NewCollectorClientFactory = modelv1.NewCollectorClientFactory + NewCollectorClientProtocol = modelv1.NewCollectorClientProtocol + NewCollectorClient = modelv1.NewCollectorClient +) type CollectorProcessor = modelv1.CollectorProcessor -var NewCollectorProcessor = modelv1.NewCollectorProcessor \ No newline at end of file + +var NewCollectorProcessor = modelv1.NewCollectorProcessor diff --git a/thrift-gen/sampling/GoUnusedProtection__.go b/thrift-gen/sampling/GoUnusedProtection__.go deleted file mode 100644 index 662b3694a71..00000000000 --- a/thrift-gen/sampling/GoUnusedProtection__.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. - -package sampling - -var GoUnusedProtection__ int; - diff --git a/thrift-gen/sampling/sampling-consts.go b/thrift-gen/sampling/sampling-consts.go deleted file mode 100644 index decd5c32bb6..00000000000 --- a/thrift-gen/sampling/sampling-consts.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. - -package sampling - -import ( - "bytes" - "context" - "errors" - "fmt" - "time" - thrift "github.com/apache/thrift/lib/go/thrift" - "strings" - "regexp" -) - -// (needed to ensure safety because of naive import list construction.) -var _ = thrift.ZERO -var _ = fmt.Printf -var _ = errors.New -var _ = context.Background -var _ = time.Now -var _ = bytes.Equal -// (needed by validator.) -var _ = strings.Contains -var _ = regexp.MatchString - - -func init() { -} - diff --git a/thrift-gen/sampling/sampling.go b/thrift-gen/sampling/sampling.go index c28891055e6..2a55bd5552a 100644 --- a/thrift-gen/sampling/sampling.go +++ b/thrift-gen/sampling/sampling.go @@ -1,1363 +1,61 @@ -// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. +// Copyright (c) 2025 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 package sampling import ( - "bytes" - "context" - "database/sql/driver" - "errors" - "fmt" - "time" - thrift "github.com/apache/thrift/lib/go/thrift" - "strings" - "regexp" + modelv1 "github.com/jaegertracing/jaeger-idl/thrift-gen/sampling" ) -// (needed to ensure safety because of naive import list construction.) -var _ = thrift.ZERO -var _ = fmt.Printf -var _ = errors.New -var _ = context.Background -var _ = time.Now -var _ = bytes.Equal -// (needed by validator.) -var _ = strings.Contains -var _ = regexp.MatchString +type SamplingStrategyType = modelv1.SamplingStrategyType -type SamplingStrategyType int64 const ( - SamplingStrategyType_PROBABILISTIC SamplingStrategyType = 0 - SamplingStrategyType_RATE_LIMITING SamplingStrategyType = 1 + SamplingStrategyType_PROBABILISTIC SamplingStrategyType = modelv1.SamplingStrategyType_PROBABILISTIC + SamplingStrategyType_RATE_LIMITING SamplingStrategyType = modelv1.SamplingStrategyType_RATE_LIMITING ) -func (p SamplingStrategyType) String() string { - switch p { - case SamplingStrategyType_PROBABILISTIC: return "PROBABILISTIC" - case SamplingStrategyType_RATE_LIMITING: return "RATE_LIMITING" - } - return "" -} +var SamplingStrategyTypeFromString = modelv1.SamplingStrategyTypeFromString -func SamplingStrategyTypeFromString(s string) (SamplingStrategyType, error) { - switch s { - case "PROBABILISTIC": return SamplingStrategyType_PROBABILISTIC, nil - case "RATE_LIMITING": return SamplingStrategyType_RATE_LIMITING, nil - } - return SamplingStrategyType(0), fmt.Errorf("not a valid SamplingStrategyType string") -} +var SamplingStrategyTypePtr = modelv1.SamplingStrategyTypePtr +type ProbabilisticSamplingStrategy = modelv1.ProbabilisticSamplingStrategy -func SamplingStrategyTypePtr(v SamplingStrategyType) *SamplingStrategyType { return &v } +var NewProbabilisticSamplingStrategy = modelv1.NewProbabilisticSamplingStrategy -func (p SamplingStrategyType) MarshalText() ([]byte, error) { -return []byte(p.String()), nil -} +type RateLimitingSamplingStrategy = modelv1.RateLimitingSamplingStrategy -func (p *SamplingStrategyType) UnmarshalText(text []byte) error { -q, err := SamplingStrategyTypeFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil -} +var NewRateLimitingSamplingStrategy = modelv1.NewRateLimitingSamplingStrategy -func (p *SamplingStrategyType) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = SamplingStrategyType(v) -return nil -} +type OperationSamplingStrategy = modelv1.OperationSamplingStrategy -func (p * SamplingStrategyType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil -} -// Attributes: -// - SamplingRate -type ProbabilisticSamplingStrategy struct { - SamplingRate float64 `thrift:"samplingRate,1,required" db:"samplingRate" json:"samplingRate"` -} +var NewOperationSamplingStrategy = modelv1.NewOperationSamplingStrategy -func NewProbabilisticSamplingStrategy() *ProbabilisticSamplingStrategy { - return &ProbabilisticSamplingStrategy{} -} +type PerOperationSamplingStrategies = modelv1.PerOperationSamplingStrategies +var NewPerOperationSamplingStrategies = modelv1.NewPerOperationSamplingStrategies -func (p *ProbabilisticSamplingStrategy) GetSamplingRate() float64 { - return p.SamplingRate -} -func (p *ProbabilisticSamplingStrategy) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } +type SamplingStrategyResponse = modelv1.SamplingStrategyResponse - var issetSamplingRate bool = false; +var NewSamplingStrategyResponse = modelv1.NewSamplingStrategyResponse - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSamplingRate = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSamplingRate{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SamplingRate is not set")); - } - return nil -} +type SamplingManager = modelv1.SamplingManager -func (p *ProbabilisticSamplingStrategy) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.SamplingRate = v -} - return nil -} +type SamplingManagerClient = modelv1.SamplingManagerClient -func (p *ProbabilisticSamplingStrategy) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "ProbabilisticSamplingStrategy"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} +var NewSamplingManagerClientFactory = modelv1.NewSamplingManagerClientFactory -func (p *ProbabilisticSamplingStrategy) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "samplingRate", thrift.DOUBLE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:samplingRate: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(p.SamplingRate)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.samplingRate (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:samplingRate: ", p), err) } - return err -} +var NewSamplingManagerClientProtocol = modelv1.NewSamplingManagerClientProtocol -func (p *ProbabilisticSamplingStrategy) Equals(other *ProbabilisticSamplingStrategy) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.SamplingRate != other.SamplingRate { return false } - return true -} +var NewSamplingManagerClient = modelv1.NewSamplingManagerClient -func (p *ProbabilisticSamplingStrategy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ProbabilisticSamplingStrategy(%+v)", *p) -} +type SamplingManagerProcessor = modelv1.SamplingManagerProcessor -func (p *ProbabilisticSamplingStrategy) Validate() error { - return nil -} -// Attributes: -// - MaxTracesPerSecond -type RateLimitingSamplingStrategy struct { - MaxTracesPerSecond int16 `thrift:"maxTracesPerSecond,1,required" db:"maxTracesPerSecond" json:"maxTracesPerSecond"` -} +var NewSamplingManagerProcessor = modelv1.NewSamplingManagerProcessor -func NewRateLimitingSamplingStrategy() *RateLimitingSamplingStrategy { - return &RateLimitingSamplingStrategy{} -} +type SamplingManagerGetSamplingStrategyArgs = modelv1.SamplingManagerGetSamplingStrategyArgs +var NewSamplingManagerGetSamplingStrategyArgs = modelv1.NewSamplingManagerGetSamplingStrategyArgs -func (p *RateLimitingSamplingStrategy) GetMaxTracesPerSecond() int16 { - return p.MaxTracesPerSecond -} -func (p *RateLimitingSamplingStrategy) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetMaxTracesPerSecond bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I16 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetMaxTracesPerSecond = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetMaxTracesPerSecond{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxTracesPerSecond is not set")); - } - return nil -} - -func (p *RateLimitingSamplingStrategy) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.MaxTracesPerSecond = v -} - return nil -} - -func (p *RateLimitingSamplingStrategy) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "RateLimitingSamplingStrategy"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *RateLimitingSamplingStrategy) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "maxTracesPerSecond", thrift.I16, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:maxTracesPerSecond: ", p), err) } - if err := oprot.WriteI16(ctx, int16(p.MaxTracesPerSecond)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxTracesPerSecond (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:maxTracesPerSecond: ", p), err) } - return err -} - -func (p *RateLimitingSamplingStrategy) Equals(other *RateLimitingSamplingStrategy) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.MaxTracesPerSecond != other.MaxTracesPerSecond { return false } - return true -} - -func (p *RateLimitingSamplingStrategy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("RateLimitingSamplingStrategy(%+v)", *p) -} - -func (p *RateLimitingSamplingStrategy) Validate() error { - return nil -} -// Attributes: -// - Operation -// - ProbabilisticSampling -type OperationSamplingStrategy struct { - Operation string `thrift:"operation,1,required" db:"operation" json:"operation"` - ProbabilisticSampling *ProbabilisticSamplingStrategy `thrift:"probabilisticSampling,2,required" db:"probabilisticSampling" json:"probabilisticSampling"` -} - -func NewOperationSamplingStrategy() *OperationSamplingStrategy { - return &OperationSamplingStrategy{} -} - - -func (p *OperationSamplingStrategy) GetOperation() string { - return p.Operation -} -var OperationSamplingStrategy_ProbabilisticSampling_DEFAULT *ProbabilisticSamplingStrategy -func (p *OperationSamplingStrategy) GetProbabilisticSampling() *ProbabilisticSamplingStrategy { - if !p.IsSetProbabilisticSampling() { - return OperationSamplingStrategy_ProbabilisticSampling_DEFAULT - } -return p.ProbabilisticSampling -} -func (p *OperationSamplingStrategy) IsSetProbabilisticSampling() bool { - return p.ProbabilisticSampling != nil -} - -func (p *OperationSamplingStrategy) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperation bool = false; - var issetProbabilisticSampling bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperation = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetProbabilisticSampling = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperation{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Operation is not set")); - } - if !issetProbabilisticSampling{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ProbabilisticSampling is not set")); - } - return nil -} - -func (p *OperationSamplingStrategy) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Operation = v -} - return nil -} - -func (p *OperationSamplingStrategy) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ProbabilisticSampling = &ProbabilisticSamplingStrategy{} - if err := p.ProbabilisticSampling.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProbabilisticSampling), err) - } - return nil -} - -func (p *OperationSamplingStrategy) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "OperationSamplingStrategy"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *OperationSamplingStrategy) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operation", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operation: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Operation)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operation (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operation: ", p), err) } - return err -} - -func (p *OperationSamplingStrategy) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "probabilisticSampling", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:probabilisticSampling: ", p), err) } - if err := p.ProbabilisticSampling.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProbabilisticSampling), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:probabilisticSampling: ", p), err) } - return err -} - -func (p *OperationSamplingStrategy) Equals(other *OperationSamplingStrategy) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Operation != other.Operation { return false } - if !p.ProbabilisticSampling.Equals(other.ProbabilisticSampling) { return false } - return true -} - -func (p *OperationSamplingStrategy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("OperationSamplingStrategy(%+v)", *p) -} - -func (p *OperationSamplingStrategy) Validate() error { - return nil -} -// Attributes: -// - DefaultSamplingProbability -// - DefaultLowerBoundTracesPerSecond -// - PerOperationStrategies -// - DefaultUpperBoundTracesPerSecond -type PerOperationSamplingStrategies struct { - DefaultSamplingProbability float64 `thrift:"defaultSamplingProbability,1,required" db:"defaultSamplingProbability" json:"defaultSamplingProbability"` - DefaultLowerBoundTracesPerSecond float64 `thrift:"defaultLowerBoundTracesPerSecond,2,required" db:"defaultLowerBoundTracesPerSecond" json:"defaultLowerBoundTracesPerSecond"` - PerOperationStrategies []*OperationSamplingStrategy `thrift:"perOperationStrategies,3,required" db:"perOperationStrategies" json:"perOperationStrategies"` - DefaultUpperBoundTracesPerSecond *float64 `thrift:"defaultUpperBoundTracesPerSecond,4" db:"defaultUpperBoundTracesPerSecond" json:"defaultUpperBoundTracesPerSecond,omitempty"` -} - -func NewPerOperationSamplingStrategies() *PerOperationSamplingStrategies { - return &PerOperationSamplingStrategies{} -} - - -func (p *PerOperationSamplingStrategies) GetDefaultSamplingProbability() float64 { - return p.DefaultSamplingProbability -} - -func (p *PerOperationSamplingStrategies) GetDefaultLowerBoundTracesPerSecond() float64 { - return p.DefaultLowerBoundTracesPerSecond -} - -func (p *PerOperationSamplingStrategies) GetPerOperationStrategies() []*OperationSamplingStrategy { - return p.PerOperationStrategies -} -var PerOperationSamplingStrategies_DefaultUpperBoundTracesPerSecond_DEFAULT float64 -func (p *PerOperationSamplingStrategies) GetDefaultUpperBoundTracesPerSecond() float64 { - if !p.IsSetDefaultUpperBoundTracesPerSecond() { - return PerOperationSamplingStrategies_DefaultUpperBoundTracesPerSecond_DEFAULT - } -return *p.DefaultUpperBoundTracesPerSecond -} -func (p *PerOperationSamplingStrategies) IsSetDefaultUpperBoundTracesPerSecond() bool { - return p.DefaultUpperBoundTracesPerSecond != nil -} - -func (p *PerOperationSamplingStrategies) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetDefaultSamplingProbability bool = false; - var issetDefaultLowerBoundTracesPerSecond bool = false; - var issetPerOperationStrategies bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetDefaultSamplingProbability = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetDefaultLowerBoundTracesPerSecond = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.LIST { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetPerOperationStrategies = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetDefaultSamplingProbability{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DefaultSamplingProbability is not set")); - } - if !issetDefaultLowerBoundTracesPerSecond{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DefaultLowerBoundTracesPerSecond is not set")); - } - if !issetPerOperationStrategies{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PerOperationStrategies is not set")); - } - return nil -} - -func (p *PerOperationSamplingStrategies) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.DefaultSamplingProbability = v -} - return nil -} - -func (p *PerOperationSamplingStrategies) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DefaultLowerBoundTracesPerSecond = v -} - return nil -} - -func (p *PerOperationSamplingStrategies) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*OperationSamplingStrategy, 0, size) - p.PerOperationStrategies = tSlice - for i := 0; i < size; i ++ { - _elem0 := &OperationSamplingStrategy{} - if err := _elem0.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) - } - p.PerOperationStrategies = append(p.PerOperationStrategies, _elem0) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *PerOperationSamplingStrategies) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.DefaultUpperBoundTracesPerSecond = &v -} - return nil -} - -func (p *PerOperationSamplingStrategies) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "PerOperationSamplingStrategies"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *PerOperationSamplingStrategies) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "defaultSamplingProbability", thrift.DOUBLE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:defaultSamplingProbability: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(p.DefaultSamplingProbability)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.defaultSamplingProbability (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:defaultSamplingProbability: ", p), err) } - return err -} - -func (p *PerOperationSamplingStrategies) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "defaultLowerBoundTracesPerSecond", thrift.DOUBLE, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:defaultLowerBoundTracesPerSecond: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(p.DefaultLowerBoundTracesPerSecond)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.defaultLowerBoundTracesPerSecond (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:defaultLowerBoundTracesPerSecond: ", p), err) } - return err -} - -func (p *PerOperationSamplingStrategies) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "perOperationStrategies", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:perOperationStrategies: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.PerOperationStrategies)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.PerOperationStrategies { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:perOperationStrategies: ", p), err) } - return err -} - -func (p *PerOperationSamplingStrategies) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDefaultUpperBoundTracesPerSecond() { - if err := oprot.WriteFieldBegin(ctx, "defaultUpperBoundTracesPerSecond", thrift.DOUBLE, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:defaultUpperBoundTracesPerSecond: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(*p.DefaultUpperBoundTracesPerSecond)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.defaultUpperBoundTracesPerSecond (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:defaultUpperBoundTracesPerSecond: ", p), err) } - } - return err -} - -func (p *PerOperationSamplingStrategies) Equals(other *PerOperationSamplingStrategies) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.DefaultSamplingProbability != other.DefaultSamplingProbability { return false } - if p.DefaultLowerBoundTracesPerSecond != other.DefaultLowerBoundTracesPerSecond { return false } - if len(p.PerOperationStrategies) != len(other.PerOperationStrategies) { return false } - for i, _tgt := range p.PerOperationStrategies { - _src1 := other.PerOperationStrategies[i] - if !_tgt.Equals(_src1) { return false } - } - if p.DefaultUpperBoundTracesPerSecond != other.DefaultUpperBoundTracesPerSecond { - if p.DefaultUpperBoundTracesPerSecond == nil || other.DefaultUpperBoundTracesPerSecond == nil { - return false - } - if (*p.DefaultUpperBoundTracesPerSecond) != (*other.DefaultUpperBoundTracesPerSecond) { return false } - } - return true -} - -func (p *PerOperationSamplingStrategies) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PerOperationSamplingStrategies(%+v)", *p) -} - -func (p *PerOperationSamplingStrategies) Validate() error { - return nil -} -// Attributes: -// - StrategyType -// - ProbabilisticSampling -// - RateLimitingSampling -// - OperationSampling -type SamplingStrategyResponse struct { - StrategyType SamplingStrategyType `thrift:"strategyType,1,required" db:"strategyType" json:"strategyType"` - ProbabilisticSampling *ProbabilisticSamplingStrategy `thrift:"probabilisticSampling,2" db:"probabilisticSampling" json:"probabilisticSampling,omitempty"` - RateLimitingSampling *RateLimitingSamplingStrategy `thrift:"rateLimitingSampling,3" db:"rateLimitingSampling" json:"rateLimitingSampling,omitempty"` - OperationSampling *PerOperationSamplingStrategies `thrift:"operationSampling,4" db:"operationSampling" json:"operationSampling,omitempty"` -} - -func NewSamplingStrategyResponse() *SamplingStrategyResponse { - return &SamplingStrategyResponse{} -} - - -func (p *SamplingStrategyResponse) GetStrategyType() SamplingStrategyType { - return p.StrategyType -} -var SamplingStrategyResponse_ProbabilisticSampling_DEFAULT *ProbabilisticSamplingStrategy -func (p *SamplingStrategyResponse) GetProbabilisticSampling() *ProbabilisticSamplingStrategy { - if !p.IsSetProbabilisticSampling() { - return SamplingStrategyResponse_ProbabilisticSampling_DEFAULT - } -return p.ProbabilisticSampling -} -var SamplingStrategyResponse_RateLimitingSampling_DEFAULT *RateLimitingSamplingStrategy -func (p *SamplingStrategyResponse) GetRateLimitingSampling() *RateLimitingSamplingStrategy { - if !p.IsSetRateLimitingSampling() { - return SamplingStrategyResponse_RateLimitingSampling_DEFAULT - } -return p.RateLimitingSampling -} -var SamplingStrategyResponse_OperationSampling_DEFAULT *PerOperationSamplingStrategies -func (p *SamplingStrategyResponse) GetOperationSampling() *PerOperationSamplingStrategies { - if !p.IsSetOperationSampling() { - return SamplingStrategyResponse_OperationSampling_DEFAULT - } -return p.OperationSampling -} -func (p *SamplingStrategyResponse) IsSetProbabilisticSampling() bool { - return p.ProbabilisticSampling != nil -} - -func (p *SamplingStrategyResponse) IsSetRateLimitingSampling() bool { - return p.RateLimitingSampling != nil -} - -func (p *SamplingStrategyResponse) IsSetOperationSampling() bool { - return p.OperationSampling != nil -} - -func (p *SamplingStrategyResponse) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStrategyType bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStrategyType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStrategyType{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StrategyType is not set")); - } - return nil -} - -func (p *SamplingStrategyResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := SamplingStrategyType(v) - p.StrategyType = temp -} - return nil -} - -func (p *SamplingStrategyResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ProbabilisticSampling = &ProbabilisticSamplingStrategy{} - if err := p.ProbabilisticSampling.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProbabilisticSampling), err) - } - return nil -} - -func (p *SamplingStrategyResponse) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.RateLimitingSampling = &RateLimitingSamplingStrategy{} - if err := p.RateLimitingSampling.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RateLimitingSampling), err) - } - return nil -} - -func (p *SamplingStrategyResponse) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationSampling = &PerOperationSamplingStrategies{} - if err := p.OperationSampling.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationSampling), err) - } - return nil -} - -func (p *SamplingStrategyResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "SamplingStrategyResponse"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *SamplingStrategyResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "strategyType", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:strategyType: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.StrategyType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.strategyType (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:strategyType: ", p), err) } - return err -} - -func (p *SamplingStrategyResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetProbabilisticSampling() { - if err := oprot.WriteFieldBegin(ctx, "probabilisticSampling", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:probabilisticSampling: ", p), err) } - if err := p.ProbabilisticSampling.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProbabilisticSampling), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:probabilisticSampling: ", p), err) } - } - return err -} - -func (p *SamplingStrategyResponse) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRateLimitingSampling() { - if err := oprot.WriteFieldBegin(ctx, "rateLimitingSampling", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:rateLimitingSampling: ", p), err) } - if err := p.RateLimitingSampling.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RateLimitingSampling), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:rateLimitingSampling: ", p), err) } - } - return err -} - -func (p *SamplingStrategyResponse) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationSampling() { - if err := oprot.WriteFieldBegin(ctx, "operationSampling", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:operationSampling: ", p), err) } - if err := p.OperationSampling.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationSampling), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:operationSampling: ", p), err) } - } - return err -} - -func (p *SamplingStrategyResponse) Equals(other *SamplingStrategyResponse) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StrategyType != other.StrategyType { return false } - if !p.ProbabilisticSampling.Equals(other.ProbabilisticSampling) { return false } - if !p.RateLimitingSampling.Equals(other.RateLimitingSampling) { return false } - if !p.OperationSampling.Equals(other.OperationSampling) { return false } - return true -} - -func (p *SamplingStrategyResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SamplingStrategyResponse(%+v)", *p) -} - -func (p *SamplingStrategyResponse) Validate() error { - return nil -} -type SamplingManager interface { - // Parameters: - // - ServiceName - GetSamplingStrategy(ctx context.Context, serviceName string) (_r *SamplingStrategyResponse, _err error) -} - -type SamplingManagerClient struct { - c thrift.TClient - meta thrift.ResponseMeta -} - -func NewSamplingManagerClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *SamplingManagerClient { - return &SamplingManagerClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } -} - -func NewSamplingManagerClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *SamplingManagerClient { - return &SamplingManagerClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} - -func NewSamplingManagerClient(c thrift.TClient) *SamplingManagerClient { - return &SamplingManagerClient{ - c: c, - } -} - -func (p *SamplingManagerClient) Client_() thrift.TClient { - return p.c -} - -func (p *SamplingManagerClient) LastResponseMeta_() thrift.ResponseMeta { - return p.meta -} - -func (p *SamplingManagerClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { - p.meta = meta -} - -// Parameters: -// - ServiceName -func (p *SamplingManagerClient) GetSamplingStrategy(ctx context.Context, serviceName string) (_r *SamplingStrategyResponse, _err error) { - var _args2 SamplingManagerGetSamplingStrategyArgs - _args2.ServiceName = serviceName - var _result4 SamplingManagerGetSamplingStrategyResult - var _meta3 thrift.ResponseMeta - _meta3, _err = p.Client_().Call(ctx, "getSamplingStrategy", &_args2, &_result4) - p.SetLastResponseMeta_(_meta3) - if _err != nil { - return - } - if _ret5 := _result4.GetSuccess(); _ret5 != nil { - return _ret5, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getSamplingStrategy failed: unknown result") -} - -type SamplingManagerProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler SamplingManager -} - -func (p *SamplingManagerProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *SamplingManagerProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *SamplingManagerProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} - -func NewSamplingManagerProcessor(handler SamplingManager) *SamplingManagerProcessor { - - self6 := &SamplingManagerProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self6.processorMap["getSamplingStrategy"] = &samplingManagerProcessorGetSamplingStrategy{handler:handler} -return self6 -} - -func (p *SamplingManagerProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) - if err2 != nil { return false, thrift.WrapTException(err2) } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(ctx, thrift.STRUCT) - iprot.ReadMessageEnd(ctx) - x7 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) - x7.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, x7 - -} - -type samplingManagerProcessorGetSamplingStrategy struct { - handler SamplingManager -} - -func (p *samplingManagerProcessorGetSamplingStrategy) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err8 error - args := SamplingManagerGetSamplingStrategyArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "getSamplingStrategy", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := SamplingManagerGetSamplingStrategyResult{} - if retval, err2 := p.handler.GetSamplingStrategy(ctx, args.ServiceName); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc9 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSamplingStrategy: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "getSamplingStrategy", thrift.EXCEPTION, seqId); err2 != nil { - _write_err8 = thrift.WrapTException(err2) - } - if err2 := _exc9.Write(ctx, oprot); _write_err8 == nil && err2 != nil { - _write_err8 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err8 == nil && err2 != nil { - _write_err8 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err8 == nil && err2 != nil { - _write_err8 = thrift.WrapTException(err2) - } - if _write_err8 != nil { - return false, thrift.WrapTException(_write_err8) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "getSamplingStrategy", thrift.REPLY, seqId); err2 != nil { - _write_err8 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err8 == nil && err2 != nil { - _write_err8 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err8 == nil && err2 != nil { - _write_err8 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err8 == nil && err2 != nil { - _write_err8 = thrift.WrapTException(err2) - } - if _write_err8 != nil { - return false, thrift.WrapTException(_write_err8) - } - return true, err -} - - -// HELPER FUNCTIONS AND STRUCTURES - -// Attributes: -// - ServiceName -type SamplingManagerGetSamplingStrategyArgs struct { - ServiceName string `thrift:"serviceName,1" db:"serviceName" json:"serviceName"` -} - -func NewSamplingManagerGetSamplingStrategyArgs() *SamplingManagerGetSamplingStrategyArgs { - return &SamplingManagerGetSamplingStrategyArgs{} -} - - -func (p *SamplingManagerGetSamplingStrategyArgs) GetServiceName() string { - return p.ServiceName -} -func (p *SamplingManagerGetSamplingStrategyArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *SamplingManagerGetSamplingStrategyArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.ServiceName = v -} - return nil -} - -func (p *SamplingManagerGetSamplingStrategyArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "getSamplingStrategy_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *SamplingManagerGetSamplingStrategyArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "serviceName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.ServiceName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.serviceName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceName: ", p), err) } - return err -} - -func (p *SamplingManagerGetSamplingStrategyArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SamplingManagerGetSamplingStrategyArgs(%+v)", *p) -} - -// Attributes: -// - Success -type SamplingManagerGetSamplingStrategyResult struct { - Success *SamplingStrategyResponse `thrift:"success,0" db:"success" json:"success,omitempty"` -} - -func NewSamplingManagerGetSamplingStrategyResult() *SamplingManagerGetSamplingStrategyResult { - return &SamplingManagerGetSamplingStrategyResult{} -} - -var SamplingManagerGetSamplingStrategyResult_Success_DEFAULT *SamplingStrategyResponse -func (p *SamplingManagerGetSamplingStrategyResult) GetSuccess() *SamplingStrategyResponse { - if !p.IsSetSuccess() { - return SamplingManagerGetSamplingStrategyResult_Success_DEFAULT - } -return p.Success -} -func (p *SamplingManagerGetSamplingStrategyResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *SamplingManagerGetSamplingStrategyResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *SamplingManagerGetSamplingStrategyResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &SamplingStrategyResponse{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *SamplingManagerGetSamplingStrategyResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "getSamplingStrategy_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *SamplingManagerGetSamplingStrategyResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *SamplingManagerGetSamplingStrategyResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SamplingManagerGetSamplingStrategyResult(%+v)", *p) -} - +type SamplingManagerGetSamplingStrategyResult = modelv1.SamplingManagerGetSamplingStrategyResult +var NewSamplingManagerGetSamplingStrategyResult = modelv1.NewSamplingManagerGetSamplingStrategyResult diff --git a/thrift-gen/zipkincore/zipkincore.go b/thrift-gen/zipkincore/zipkincore.go index 10ae4f21a12..dd844fe2154 100644 --- a/thrift-gen/zipkincore/zipkincore.go +++ b/thrift-gen/zipkincore/zipkincore.go @@ -1,60 +1,74 @@ +// Copyright (c) 2025 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 + package zipkincore import ( - modelv1 "github.com/jaegertracing/jaeger-idl/thrift-gen/zipkincore" + modelv1 "github.com/jaegertracing/jaeger-idl/thrift-gen/zipkincore" ) type AnnotationType = modelv1.AnnotationType const ( - AnnotationType_BOOL = modelv1.AnnotationType_BOOL - AnnotationType_BYTES = modelv1.AnnotationType_BYTES - AnnotationType_I16 = modelv1.AnnotationType_I16 - AnnotationType_I32 = modelv1.AnnotationType_I32 - AnnotationType_I64 = modelv1.AnnotationType_I64 - AnnotationType_DOUBLE = modelv1.AnnotationType_DOUBLE - AnnotationType_STRING = modelv1.AnnotationType_STRING + AnnotationType_BOOL = modelv1.AnnotationType_BOOL + AnnotationType_BYTES = modelv1.AnnotationType_BYTES + AnnotationType_I16 = modelv1.AnnotationType_I16 + AnnotationType_I32 = modelv1.AnnotationType_I32 + AnnotationType_I64 = modelv1.AnnotationType_I64 + AnnotationType_DOUBLE = modelv1.AnnotationType_DOUBLE + AnnotationType_STRING = modelv1.AnnotationType_STRING ) type Endpoint = modelv1.Endpoint + var NewEndpoint = modelv1.NewEndpoint type Annotation = modelv1.Annotation + var NewAnnotation = modelv1.NewAnnotation type BinaryAnnotation = modelv1.BinaryAnnotation + var NewBinaryAnnotation = modelv1.NewBinaryAnnotation type Span = modelv1.Span + var NewSpan = modelv1.NewSpan type Response = modelv1.Response + var NewResponse = modelv1.NewResponse -type ZipkinCollector = modelv1.ZipkinCollector -type ZipkinCollectorClient = modelv1.ZipkinCollectorClient -var NewZipkinCollectorClientFactory = modelv1.NewZipkinCollectorClientFactory -var NewZipkinCollectorClientProtocol = modelv1.NewZipkinCollectorClientProtocol -var NewZipkinCollectorClient = modelv1.NewZipkinCollectorClient +type ( + ZipkinCollector = modelv1.ZipkinCollector + ZipkinCollectorClient = modelv1.ZipkinCollectorClient +) + +var ( + NewZipkinCollectorClientFactory = modelv1.NewZipkinCollectorClientFactory + NewZipkinCollectorClientProtocol = modelv1.NewZipkinCollectorClientProtocol + NewZipkinCollectorClient = modelv1.NewZipkinCollectorClient +) type ZipkinCollectorProcessor = modelv1.ZipkinCollectorProcessor + var NewZipkinCollectorProcessor = modelv1.NewZipkinCollectorProcessor const ( - CLIENT_SEND = modelv1.CLIENT_SEND - CLIENT_RECV = modelv1.CLIENT_RECV - SERVER_SEND = modelv1.SERVER_SEND - SERVER_RECV = modelv1.SERVER_RECV - MESSAGE_SEND = modelv1.MESSAGE_SEND - MESSAGE_RECV = modelv1.MESSAGE_RECV - WIRE_SEND = modelv1.WIRE_SEND - WIRE_RECV = modelv1.WIRE_RECV - CLIENT_SEND_FRAGMENT = modelv1.CLIENT_SEND_FRAGMENT - CLIENT_RECV_FRAGMENT = modelv1.CLIENT_RECV_FRAGMENT - SERVER_SEND_FRAGMENT = modelv1.SERVER_SEND_FRAGMENT - SERVER_RECV_FRAGMENT = modelv1.SERVER_RECV_FRAGMENT - LOCAL_COMPONENT = modelv1.LOCAL_COMPONENT - CLIENT_ADDR = modelv1.CLIENT_ADDR - SERVER_ADDR = modelv1.SERVER_ADDR - MESSAGE_ADDR = modelv1.MESSAGE_ADDR -) \ No newline at end of file + CLIENT_SEND = modelv1.CLIENT_SEND + CLIENT_RECV = modelv1.CLIENT_RECV + SERVER_SEND = modelv1.SERVER_SEND + SERVER_RECV = modelv1.SERVER_RECV + MESSAGE_SEND = modelv1.MESSAGE_SEND + MESSAGE_RECV = modelv1.MESSAGE_RECV + WIRE_SEND = modelv1.WIRE_SEND + WIRE_RECV = modelv1.WIRE_RECV + CLIENT_SEND_FRAGMENT = modelv1.CLIENT_SEND_FRAGMENT + CLIENT_RECV_FRAGMENT = modelv1.CLIENT_RECV_FRAGMENT + SERVER_SEND_FRAGMENT = modelv1.SERVER_SEND_FRAGMENT + SERVER_RECV_FRAGMENT = modelv1.SERVER_RECV_FRAGMENT + LOCAL_COMPONENT = modelv1.LOCAL_COMPONENT + CLIENT_ADDR = modelv1.CLIENT_ADDR + SERVER_ADDR = modelv1.SERVER_ADDR + MESSAGE_ADDR = modelv1.MESSAGE_ADDR +)