logging/Manager: Extract another CreateWriter() helper

For other cluster backends, CreateWriter() will use a logger's filter
configuration rather than receiving all configuration through CreateLog.
Extract a helper out from WriteToFilters() for reuse.
This commit is contained in:
Arne Welzel 2024-09-19 13:14:14 +02:00
parent 16cca62292
commit 78999d147d
2 changed files with 66 additions and 46 deletions

View file

@ -378,6 +378,23 @@ private:
struct Stream;
struct WriterInfo;
/**
* Helper enum for CreateWriterForFilter to avoid bool params.
*/
enum class WriterOrigin {
REMOTE,
LOCAL,
};
/**
* Helper to create a new writer for a filter with the given path.
*
* @param filter the filter for which to create the writer.
* @param path the path for the new writer
* @param from whether instantiated for a remote log, or locally created.
*/
WriterFrontend* CreateWriterForFilter(Filter* filter, const std::string& path, WriterOrigin origin);
bool TraverseRecord(Stream* stream, Filter* filter, RecordType* rt, TableVal* include, TableVal* exclude,
const std::string& path, const std::list<int>& indices);