Skip to content

Commit ea0a4c6

Browse files
authored
[chore] Use int64 for queue_size in the queuebatch.Config, simplifies conversions (#12745)
Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 450a4ce commit ea0a4c6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

exporter/exporterhelper/internal/queue_sender.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type QueueConfig struct {
5858
Sizer request.SizerType `mapstructure:"sizer"`
5959

6060
// QueueSize represents the maximum data size allowed for concurrent storage and processing.
61-
QueueSize int `mapstructure:"queue_size"`
61+
QueueSize int64 `mapstructure:"queue_size"`
6262

6363
// NumConsumers is the number of consumers from the queue.
6464
NumConsumers int `mapstructure:"num_consumers"`

exporter/exporterhelper/internal/queuebatch/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type Config struct {
2525
Sizer request.SizerType `mapstructure:"sizer"`
2626

2727
// QueueSize represents the maximum data size allowed for concurrent storage and processing.
28-
QueueSize int `mapstructure:"queue_size"`
28+
QueueSize int64 `mapstructure:"queue_size"`
2929

3030
// BlockOnOverflow determines the behavior when the component's TotalSize limit is reached.
3131
// If true, the component will wait for space; otherwise, operations will immediately return a retryable error.

exporter/exporterhelper/internal/queuebatch/queue_batch.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ func NewQueueBatch(
5858
if cfg.StorageID == nil {
5959
q = newAsyncQueue(newMemoryQueue[request.Request](memoryQueueSettings[request.Request]{
6060
sizer: sizer,
61-
capacity: int64(cfg.QueueSize),
61+
capacity: cfg.QueueSize,
6262
waitForResult: cfg.WaitForResult,
6363
blockOnOverflow: cfg.BlockOnOverflow,
6464
}), cfg.NumConsumers, b.Consume)
6565
} else {
6666
q = newAsyncQueue(newPersistentQueue[request.Request](persistentQueueSettings[request.Request]{
6767
sizer: sizer,
68-
capacity: int64(cfg.QueueSize),
68+
capacity: cfg.QueueSize,
6969
blockOnOverflow: cfg.BlockOnOverflow,
7070
signal: qSet.Signal,
7171
storageID: *cfg.StorageID,

0 commit comments

Comments
 (0)