Skip to content

Log errors if datasets end up empty

Daniel Cacabelos requested to merge ECDC-3389_log_error_on_empty_dataset into main

Issue

ECDC-3389 We want error logs if datasets from Kafka end up empty.

Description of work

We have implemented a write counter in the WriteModule base class, such that all successful writes get automatically counted. When the module is destroyed, we report an error if the count is still zero. The feature applies to both NXlog and NXevent_data.

Integration tests have been manually verified to pass.

Implementation details

We choose to maintain the public write() interface of the base class, but instead of overriding this method in the subclasses like we used to do, we now give write() the responsibility to increment the counter and call a module-specific writeImpl() method.

We then refactored all writer modules to override writeImpl() instead of write().

This design keeps the common logic encapsulated in the base class, and does not require the subclasses to remember to update the count or check for empty datasets.

Checklist

  • Changes have been documented in changes.md
  • Documentation has been updated in documentation directory
Edited by Daniel Cacabelos

Merge request reports