MADARA  3.4.1
madara::filters::FragmentsToFilesFilter Class Reference

Receives fragments and saves them to files. More...

#include <FragmentsToFilesFilter.h>

Inheritance diagram for madara::filters::FragmentsToFilesFilter:
madara::filters::AggregateFilter

Public Member Functions

 FragmentsToFilesFilter ()
 Constructor. More...
 
virtual ~FragmentsToFilesFilter ()=default
 Destructor. More...
 
void disable_clear_fragments (void)
 Disables the clear fragments flag. More...
 
void enable_clear_fragments (void)
 Enables the clear fragments flag. More...
 
virtual MADARA_EXPORT void filter (knowledge::KnowledgeMap &records, const transport::TransportContext &, knowledge::Variables &)
 Filters the fragments and converts them to files. More...
 
std::string get_dir_mapping (const std::string &variable_prefix)
 Gets the directory associated with the variable prefix. More...
 
void set_dir_mapping (const std::string &variable_prefix, const std::string &directory)
 Sets a mapping between a variable prefix and a directory. More...
 

Public Attributes

bool clear_fragments_
 if true, clear fragments after sent to file More...
 
std::map< std::string, std::string > map_
 map of variable prefixes to directories More...
 

Detailed Description

Receives fragments and saves them to files.

This filter is intended to be paired with the FileFragmenter class, e.g., with the Madara File Service (mfs)

Definition at line 29 of file FragmentsToFilesFilter.h.

Constructor & Destructor Documentation

◆ FragmentsToFilesFilter()

madara::filters::FragmentsToFilesFilter::FragmentsToFilesFilter ( )
inline

Constructor.

Definition at line 35 of file FragmentsToFilesFilter.h.

◆ ~FragmentsToFilesFilter()

virtual madara::filters::FragmentsToFilesFilter::~FragmentsToFilesFilter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ disable_clear_fragments()

void madara::filters::FragmentsToFilesFilter::disable_clear_fragments ( void  )
inline

Disables the clear fragments flag.

Fragments are saved to disk and saved to the local knowledge base

Definition at line 102 of file FragmentsToFilesFilter.h.

◆ enable_clear_fragments()

void madara::filters::FragmentsToFilesFilter::enable_clear_fragments ( void  )
inline

Enables the clear fragments flag.

Whenever a fragment is saved to disk, it will not also be applied to the local knowledge base

Definition at line 93 of file FragmentsToFilesFilter.h.

◆ filter()

void madara::filters::FragmentsToFilesFilter::filter ( knowledge::KnowledgeMap records,
const transport::TransportContext ,
knowledge::Variables  
)
virtual

Filters the fragments and converts them to files.

Parameters
recordsthe aggregate records vector

Implements madara::filters::AggregateFilter.

Definition at line 18 of file FragmentsToFilesFilter.cpp.

◆ get_dir_mapping()

std::string madara::filters::FragmentsToFilesFilter::get_dir_mapping ( const std::string &  variable_prefix)
inline

Gets the directory associated with the variable prefix.

Parameters
variable_prefixthe prefix that must match in a list of filtered records

Definition at line 75 of file FragmentsToFilesFilter.h.

◆ set_dir_mapping()

void madara::filters::FragmentsToFilesFilter::set_dir_mapping ( const std::string &  variable_prefix,
const std::string &  directory 
)
inline

Sets a mapping between a variable prefix and a directory.

Parameters
variable_prefixthe prefix that must match in a list of filtered records
directorythe directory to save fragments to

Definition at line 55 of file FragmentsToFilesFilter.h.

Member Data Documentation

◆ clear_fragments_

bool madara::filters::FragmentsToFilesFilter::clear_fragments_

if true, clear fragments after sent to file

Definition at line 108 of file FragmentsToFilesFilter.h.

◆ map_

std::map<std::string, std::string> madara::filters::FragmentsToFilesFilter::map_

map of variable prefixes to directories

Definition at line 111 of file FragmentsToFilesFilter.h.


The documentation for this class was generated from the following files: