Refactor ElasticsearchClient, splitting into separate concerns for easier testing #9320
Labels
area/test
Marks an issue as improving or extending the test coverage of the project
kind/toil
Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc.
version:8.1.0-alpha2
version:8.1.0
Marks an issue as being completely or in parts released in 8.1.0
Description
The
ElasticsearchClient
is the one class in the exporter which communicates with the actual Elastic instance. Currently, it's responsibilities are:I would propose to do the following:
The client will now only deal with network communication and in memory buffering of the documents. I would recommend moving the flushing/buffering out into its own component as well later, but the above is what provides the biggest win, I think, in terms of maintainability and test-ability.
The last two steps will be blocked by the first three, I think, but the first three can be done in parallel. Finally, refactoring the tests may include adding new testing utilities, but these will later be reused in #9321.
The text was updated successfully, but these errors were encountered: