Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aws-s3
input: Split S3 poller and SQS reader into explicit input ob…
…jects (#39353) A large cleanup in the `aws-s3` input, reorganizing the file structure and splitting internal APIs into additional helpers. This change is meant to have no functional effect, it is strictly a cleanup and reorganization in preparation for future changes. The hope is that the new layout makes initialization steps and logical dependencies clearer. The main changes are: - Make `s3Poller` and `sqsReader` into standalone input objects, `s3PollerInput` and `sqsReaderInput`, that implement the `v2.Input` interface, instead of interleaving the two implementations within the same object. * Choose the appropriate input in `(*s3InputManager).Create` based on configuration * Move associated internal API out of the shared `input.go` into the new `s3_input.go` and `sqs_input.go`, while leaving `s3.go` and `sqs.go` for auxiliary helpers. * Give each input a copy of `config` and `awsConfig`, and remove redundant struct fields that simply shadowed fields already in those configs. - In `sqsReaderInput`, use a fixed set of worker goroutines and track task allocation via channel-based work requests instead of creating ephemeral workers via the previous custom semaphore implementation (similar to the [recent cloudwatch cleanup](#38953)). * Delete `aws.Sem`, since this was its last remaining caller - Collect the helpers related to approximate message count polling into a helper object, `messageCountMonitor`, so their role in the input is clearer. - Generally, break larger steps up into smaller helper functions - Generally, collect initialization dependencies in the same place so the sequencing is clearer.
- Loading branch information