MySQL 8.0.32
Source Code Documentation
s_mysql_log_builtins_filter Struct Reference

#include <log_builtins_filter.h>

Public Attributes

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

Member Data Documentation

◆ filter_rule_init

void *(* s_mysql_log_builtins_filter::filter_rule_init) (log_filter_ruleset *ruleset)

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(* s_mysql_log_builtins_filter::filter_ruleset_drop) (log_filter_ruleset *ruleset)

Drop an entire filter rule-set.

Must hold lock.

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

◆ filter_ruleset_free

void(* s_mysql_log_builtins_filter::filter_ruleset_free) (log_filter_ruleset **ruleset)

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(* s_mysql_log_builtins_filter::filter_ruleset_lock) (log_filter_ruleset *ruleset, log_builtins_filter_lock locktype)

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
Return values
0lock acquired
!0failed to acquire lock

◆ filter_ruleset_move

int(* s_mysql_log_builtins_filter::filter_ruleset_move) (log_filter_ruleset *from, log_filter_ruleset *to)

Move rules from one ruleset to another.

Origin will be empty afterwards.

Parameters
fromsource ruleset
todestination ruleset

◆ filter_ruleset_new

log_filter_ruleset *(* s_mysql_log_builtins_filter::filter_ruleset_new) (log_filter_tag *tag, size_t count)

Create a new set of filter rules.

Parameters
tagtag for this ruleset
countnumber of rules to allocate
Return values
apointer to a ruleset structure, or nullptr on failure

◆ filter_ruleset_unlock

void(* s_mysql_log_builtins_filter::filter_ruleset_unlock) (log_filter_ruleset *ruleset)

Release lock on filter rules.

Parameters
ruleseta ruleset (usually allocated with filter_ruleset_new())

◆ filter_run

int(* s_mysql_log_builtins_filter::filter_run) (log_filter_ruleset *ruleset, log_line *ll)

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

Parameters
llthe current log line
Return values
intnumber of matched rules

The documentation for this struct was generated from the following file: