@@ -19,39 +19,39 @@ import (
1919 "github.com/rudderlabs/rudder-server/utils/tracing"
2020)
2121
22- type partitionWorker struct {
22+ type gwPartitionWorker struct {
2323 partition string
24- pipelines []* pipelineWorker
24+ pipelines []* gwPipelineWorker
2525 logger logger.Logger
2626 stats * processorStats
2727 tracer * tracing.Tracer
2828 handle workerHandle
2929 statsFactory stats.Stats
3030}
3131
32- // newPartitionWorker creates a new worker for the specified partition
33- func newPartitionWorker (partition string , h workerHandle , t stats.Tracer , statsFactory stats.Stats ) * partitionWorker {
34- w := & partitionWorker {
32+ // newGwPartitionWorker creates a new worker for the specified partition
33+ func newGwPartitionWorker (partition string , h workerHandle , t stats.Tracer , statsFactory stats.Stats ) * gwPartitionWorker {
34+ w := & gwPartitionWorker {
3535 partition : partition ,
3636 logger : h .logger ().Child (partition ),
3737 stats : h .stats (),
38- tracer : tracing .New (t , tracing .WithNamePrefix ("partitionWorker " )),
38+ tracer : tracing .New (t , tracing .WithNamePrefix ("gwPartitionWorker " )),
3939 handle : h ,
4040 statsFactory : statsFactory ,
4141 }
4242 // Create workers for each pipeline
4343 pipelinesPerPartition := h .config ().pipelinesPerPartition
44- w .pipelines = make ([]* pipelineWorker , pipelinesPerPartition )
44+ w .pipelines = make ([]* gwPipelineWorker , pipelinesPerPartition )
4545 for i := range pipelinesPerPartition {
46- w .pipelines [i ] = newPipelineWorker (i , partition , h , tracing .New (t , tracing .WithNamePrefix ("pipelineWorker " )))
46+ w .pipelines [i ] = newGwPipelineWorker (i , partition , h , tracing .New (t , tracing .WithNamePrefix ("gwPipelineWorker " )))
4747 }
4848
4949 return w
5050}
5151
5252// Work processes jobs for the specified partition
5353// Returns true if work was done, false otherwise
54- func (w * partitionWorker ) Work () bool {
54+ func (w * gwPartitionWorker ) Work () bool {
5555 // If pipelining is disabled, use the legacy job handling path
5656 if ! w .handle .config ().enablePipelining {
5757 return w .handle .handlePendingGatewayJobs (w .partition )
@@ -106,24 +106,24 @@ func (w *partitionWorker) Work() bool {
106106}
107107
108108// SleepDurations returns the min and max sleep durations for the worker
109- func (w * partitionWorker ) SleepDurations () (min , max time.Duration ) {
109+ func (w * gwPartitionWorker ) SleepDurations () (min , max time.Duration ) {
110110 return w .handle .config ().readLoopSleep .Load (), w .handle .config ().maxLoopSleep .Load ()
111111}
112112
113113// Stop stops the worker and waits until all its goroutines have stopped
114- func (w * partitionWorker ) Stop () {
114+ func (w * gwPartitionWorker ) Stop () {
115115 var wg sync.WaitGroup
116116 for _ , pipeline := range w .pipelines {
117117 wg .Add (1 )
118- go func (p * pipelineWorker ) {
118+ go func (p * gwPipelineWorker ) {
119119 defer wg .Done ()
120120 p .Stop ()
121121 }(pipeline )
122122 }
123123 wg .Wait () // Wait for all stop operations to complete
124124}
125125
126- func (w * partitionWorker ) sendToPreProcess (ctx context.Context , jobsByPipeline map [int ][]* jobsdb.JobT ) error {
126+ func (w * gwPartitionWorker ) sendToPreProcess (ctx context.Context , jobsByPipeline map [int ][]* jobsdb.JobT ) error {
127127 spanTags := stats.Tags {"partition" : w .partition }
128128 _ , span := w .tracer .Trace (ctx , "Work.sendToPreProcess" , tracing .WithTraceTags (spanTags ))
129129 defer span .End ()
0 commit comments