MySQL 8.0.40
Source Code Documentation
log_builtins_filter_imp Class Reference

#include <log_builtins_filter_imp.h>

Static Public Member Functions

static void init ()
 Initialize built-in log filter. More...
 
static void deinit ()
 De-initialize built-in log filter. More...
 
static log_filter_rulesetfilter_ruleset_new (log_filter_tag *tag, size_t count) noexcept
 Create a new set of filter rules. More...
 
static int filter_ruleset_lock (log_filter_ruleset *ruleset, log_builtins_filter_lock locktype) noexcept
 Lock and get the filter rules. More...
 
static void filter_ruleset_unlock (log_filter_ruleset *ruleset) noexcept
 Release lock on filter rules. More...
 
static void filter_ruleset_drop (log_filter_ruleset *ruleset) noexcept
 Drop an entire filter rule-set. More...
 
static void filter_ruleset_free (log_filter_ruleset **ruleset) noexcept
 Free an entire filter rule-set. More...
 
static int filter_ruleset_move (log_filter_ruleset *from, log_filter_ruleset *to) noexcept
 Move rules from one ruleset to another. More...
 
static void * filter_rule_init (log_filter_ruleset *ruleset) noexcept
 Initialize a new rule. More...
 
static int filter_run (log_filter_ruleset *ruleset, log_line *ll) noexcept
 Apply all matching rules from a filter rule set to a given log line. More...
 

Member Function Documentation

◆ deinit()

static void log_builtins_filter_imp::deinit ( )
static

De-initialize built-in log filter.

◆ filter_rule_init()

void * log_builtins_filter_imp::filter_rule_init ( log_filter_ruleset ruleset)
staticnoexcept

Initialize a new rule.

This clears the first unused rule. It does not update the rules count; this is for the caller to do if it succeeds in setting up the rule to its satisfaction. If the caller fails, it should log_builtins_filter_rule_free() the incomplete rule.

Parameters
ruleseta ruleset (usually allocated with filter_ruleset_new())
Returns
nullptr could not initialize rule. Do not call rule_free.
!nullptr the address of the rule. fill in. on success, caller must increase rule count. on failure, it must call rule_free.

◆ filter_ruleset_drop()

void log_builtins_filter_imp::filter_ruleset_drop ( log_filter_ruleset ruleset)
staticnoexcept

Drop an entire filter rule-set.

Must hold lock.

Parameters
ruleseta ruleset * (usually allocated with filter_ruleset_new())

◆ filter_ruleset_free()

void log_builtins_filter_imp::filter_ruleset_free ( log_filter_ruleset **  ruleset)
staticnoexcept

Free an entire filter rule-set.

Must hold lock. Lock will be destroyed.

Parameters
ruleseta ruleset * (usually allocated with filter_ruleset_new()) the pointer pointed to will be a nullptr on return.

◆ filter_ruleset_lock()

int log_builtins_filter_imp::filter_ruleset_lock ( log_filter_ruleset ruleset,
log_builtins_filter_lock  locktype 
)
staticnoexcept

Lock and get the filter rules.

Parameters
ruleseta ruleset (usually allocated with filter_ruleset_new())
locktypeLOG_BUILTINS_LOCK_SHARED lock for reading LOG_BUILTINS_LOCK_EXCLUSIVE lock for writing
Returns
0 lock acquired
!0 failed to acquire lock

◆ filter_ruleset_move()

int log_builtins_filter_imp::filter_ruleset_move ( log_filter_ruleset from,
log_filter_ruleset to 
)
staticnoexcept

Move rules from one ruleset to another.

Origin will be empty afterwards.

Parameters
fromsource ruleset
todestination ruleset

◆ filter_ruleset_new()

log_filter_ruleset * log_builtins_filter_imp::filter_ruleset_new ( log_filter_tag tag,
size_t  count 
)
staticnoexcept

Create a new set of filter rules.

Parameters
tagidentifying tag of the rule-set creator
countnumber of rules to allocate
Returns
a pointer to a ruleset structure, or nullptr on failure

◆ filter_ruleset_unlock()

void log_builtins_filter_imp::filter_ruleset_unlock ( log_filter_ruleset ruleset)
staticnoexcept

Release lock on filter rules.

Parameters
ruleseta ruleset (usually allocated with filter_ruleset_new())

◆ filter_run()

int log_builtins_filter_imp::filter_run ( log_filter_ruleset ruleset,
log_line ll 
)
staticnoexcept

Apply all matching rules from a filter rule set to a given log line.

Parameters
ruleseta ruleset (usually allocated with filter_ruleset_new())
llthe current log line
Returns
int number of matched rules

◆ init()

static void log_builtins_filter_imp::init ( )
static

Initialize built-in log filter.


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