Skip to content

Commit 8dd29c3

Browse files
authored
[chore] Extract queue logic into a separate internal package (#13175)
Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 6b705f9 commit 8dd29c3

25 files changed

+363
-332
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ genpdata:
250250
pushd pdata/ && $(GOCMD) run ./internal/cmd/pdatagen/main.go && popd
251251
$(MAKE) fmt
252252

253-
INTERNAL_PROTO_SRC_DIRS := exporter/exporterhelper/internal/queuebatch/internal/persistentqueue
253+
INTERNAL_PROTO_SRC_DIRS := exporter/exporterhelper/internal/queue
254254
# INTERNAL_PROTO_SRC_DIRS += path/to/other/proto/dirs
255255
INTERNAL_PROTO_FILES := $(foreach dir,$(INTERNAL_PROTO_SRC_DIRS),$(wildcard $(dir)/*.proto))
256256
INTERNAL_PROTOC := $(DOCKERCMD) run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${DOCKER_PROTOBUF} --proto_path=${PWD} --go_out=${PWD}

exporter/exporterhelper/internal/queuebatch/async_queue.go renamed to exporter/exporterhelper/internal/queue/async_queue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch"
4+
package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue"
55

66
import (
77
"context"

exporter/exporterhelper/internal/queuebatch/async_queue_test.go renamed to exporter/exporterhelper/internal/queue/async_queue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package queuebatch
4+
package queue
55

66
import (
77
"context"

exporter/exporterhelper/internal/queuebatch/cond.go renamed to exporter/exporterhelper/internal/queue/cond.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch"
4+
package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue"
55

66
import (
77
"context"

exporter/exporterhelper/internal/queuebatch/memory_queue.go renamed to exporter/exporterhelper/internal/queue/memory_queue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch"
4+
package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue"
55

66
import (
77
"context"

exporter/exporterhelper/internal/queuebatch/memory_queue_test.go renamed to exporter/exporterhelper/internal/queue/memory_queue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package queuebatch
4+
package queue
55

66
import (
77
"context"

exporter/exporterhelper/internal/queue/meta.pb.go

Lines changed: 262 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
syntax = "proto3";
22

3-
package opentelemetry.collector.exporter.exporterhelper.internal.queuebatch.internal.persistentqueue;
3+
package opentelemetry.collector.exporter.exporterhelper.internal.queue;
44

5-
option go_package = "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue";
5+
option go_package = "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue";
66

77
// Sizer type configuration
88
enum SizerType {

exporter/exporterhelper/internal/queuebatch/persistent_queue.go renamed to exporter/exporterhelper/internal/queue/persistent_queue.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch"
4+
package queue // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue"
55

66
import (
77
"context"
@@ -15,7 +15,6 @@ import (
1515

1616
"go.opentelemetry.io/collector/component"
1717
"go.opentelemetry.io/collector/exporter/exporterhelper/internal/experr"
18-
"go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch/internal/persistentqueue"
1918
"go.opentelemetry.io/collector/exporter/exporterhelper/internal/request"
2019
"go.opentelemetry.io/collector/extension/xextension/storage"
2120
"go.opentelemetry.io/collector/pipeline"
@@ -96,7 +95,7 @@ type persistentQueue[T any] struct {
9695
mu sync.Mutex
9796
hasMoreElements *sync.Cond
9897
hasMoreSpace *cond
99-
metadata persistentqueue.QueueMetadata
98+
metadata QueueMetadata
10099
refClient int64
101100
stopped bool
102101
}

exporter/exporterhelper/internal/queuebatch/persistent_queue_test.go renamed to exporter/exporterhelper/internal/queue/persistent_queue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package queuebatch
4+
package queue
55

66
import (
77
"context"

0 commit comments

Comments
 (0)