MySQL 9.1.0
Source Code Documentation
xcom_cache.h File Reference
#include <stddef.h>
#include "xcom/simset.h"
#include "xcom/site_struct.h"
#include "xcom/xcom_profile.h"
#include "xdr_gen/xcom_vp.h"

Go to the source code of this file.

Classes

struct  paxos_fsm_state
 
struct  pax_machine
 

Macros

#define MIN_LENGTH   MIN_CACHE_SIZE /* Also Default value */
 
#define INCREMENT   MIN_LENGTH /* Total number of slots to add/remove */
 
#define is_cached(x)   (hash_get(x) != NULL)
 
#define p_events
 
#define X(a)   a
 
#define SET_PAXOS_FSM_STATE(obj, s)
 
#define DEC_THRESHOLD_LENGTH   500000 /* MIN_LENGTH * 10 */
 
#define MIN_TARGET_OCCUPATION   0.7F
 
#define DEC_THRESHOLD_SIZE   0.95F
 
#define MIN_LENGTH_THRESHOLD   0.9F
 

Typedefs

typedef struct lru_machine lru_machine
 
typedef struct stack_machine stack_machine
 
typedef struct pax_machine pax_machine
 
typedef enum paxos_event paxos_event
 
typedef struct paxos_fsm_state paxos_fsm_state
 
typedef int(* paxos_fsm_fp) (pax_machine *paxos, site_def const *site, paxos_event event, pax_msg *mess)
 

Enumerations

enum  paxos_event { p_events }
 
enum  {
  CACHE_SHRINK_OK = 0 , CACHE_TOO_SMALL = 1 , CACHE_HASH_NOTEMPTY = 2 , CACHE_HIGH_OCCUPATION = 3 ,
  CACHE_RESULT_LOW = 4 , CACHE_INCREASING = 5
}
 

Functions

int paxos_fsm_idle (pax_machine *paxos, site_def const *site, paxos_event event, pax_msg *mess)
 
pax_machineinit_pax_machine (pax_machine *p, lru_machine *lru, synode_no synode)
 
int is_busy_machine (pax_machine *p)
 
int lock_pax_machine (pax_machine *p)
 
pax_machineget_cache_no_touch (synode_no synode, bool_t force)
 
pax_machineget_cache (synode_no synode)
 
pax_machineforce_get_cache (synode_no synode)
 
pax_machinehash_get (synode_no synode)
 
char * dbg_machine_nodeset (pax_machine *p, u_int nodes)
 
char * dbg_pax_machine (pax_machine *p)
 
void init_cache ()
 
void deinit_cache ()
 
void unlock_pax_machine (pax_machine *p)
 
void xcom_cache_var_init ()
 
size_t shrink_cache ()
 
size_t pax_machine_size (pax_machine const *p)
 
synode_no cache_get_last_removed ()
 
void init_cache_size ()
 
uint64_t add_cache_size (pax_machine *p)
 
uint64_t sub_cache_size (pax_machine *p)
 
int above_cache_limit ()
 
uint64_t set_max_cache_size (uint64_t x)
 
int was_removed_from_cache (synode_no x)
 
uint16_t check_decrease ()
 
void do_cache_maintenance ()
 
uint64_t get_xcom_cache_occupation ()
 
uint64_t get_xcom_cache_length ()
 
uint64_t get_xcom_cache_size ()
 
void set_length_increment (size_t increment)
 
void set_size_decrement (size_t decrement)
 
void set_dec_threshold_length (uint64_t threshold)
 
void set_min_target_occupation (float threshold)
 
void set_dec_threshold_size (float threshold)
 
void set_min_length_threshold (float threshold)
 
void paxos_timeout (pax_machine *p)
 
void psi_set_cache_resetting (int is_resetting)
 
void psi_report_cache_shutdown ()
 After the cache is de-initialized 'current_count' must be zero; otherwise we have allocated data that has not been deallocated (or has not been reported as deallocated). More...
 
void psi_report_mem_free (size_t size, int is_instrumented)
 Reports to PSI the deallocation of 'size' bytes of data. More...
 
int psi_report_mem_alloc (size_t size)
 Reports to PSI the allocation of 'size' bytes of data. More...
 

Macro Definition Documentation

◆ DEC_THRESHOLD_LENGTH

#define DEC_THRESHOLD_LENGTH   500000 /* MIN_LENGTH * 10 */

◆ DEC_THRESHOLD_SIZE

#define DEC_THRESHOLD_SIZE   0.95F

◆ INCREMENT

#define INCREMENT   MIN_LENGTH /* Total number of slots to add/remove */

◆ is_cached

#define is_cached (   x)    (hash_get(x) != NULL)

◆ MIN_LENGTH

#define MIN_LENGTH   MIN_CACHE_SIZE /* Also Default value */

◆ MIN_LENGTH_THRESHOLD

#define MIN_LENGTH_THRESHOLD   0.9F

◆ MIN_TARGET_OCCUPATION

#define MIN_TARGET_OCCUPATION   0.7F

◆ p_events

#define p_events
Value:
X(paxos_prepare), X(paxos_ack_prepare), X(paxos_accept), \
X(paxos_ack_accept), X(paxos_learn), X(paxos_start), X(paxos_tout), \
X(last_p_event)
#define X(a)
Definition: xcom_cache.h:65

◆ SET_PAXOS_FSM_STATE

#define SET_PAXOS_FSM_STATE (   obj,
 
)
Value:
do { \
(obj)->state.state_fp = s; \
(obj)->state.state_name = #s; \
} while (0)

◆ X

#define X (   a)    a

Typedef Documentation

◆ lru_machine

typedef struct lru_machine lru_machine

◆ pax_machine

typedef struct pax_machine pax_machine

◆ paxos_event

typedef enum paxos_event paxos_event

◆ paxos_fsm_fp

typedef int(* paxos_fsm_fp) (pax_machine *paxos, site_def const *site, paxos_event event, pax_msg *mess)

◆ paxos_fsm_state

◆ stack_machine

typedef struct stack_machine stack_machine

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CACHE_SHRINK_OK 
CACHE_TOO_SMALL 
CACHE_HASH_NOTEMPTY 
CACHE_HIGH_OCCUPATION 
CACHE_RESULT_LOW 
CACHE_INCREASING 

◆ paxos_event

Enumerator
p_events 

Function Documentation

◆ above_cache_limit()

int above_cache_limit ( )

◆ add_cache_size()

uint64_t add_cache_size ( pax_machine p)

◆ cache_get_last_removed()

synode_no cache_get_last_removed ( )

◆ check_decrease()

uint16_t check_decrease ( )

◆ dbg_machine_nodeset()

char * dbg_machine_nodeset ( pax_machine p,
u_int  nodes 
)

◆ dbg_pax_machine()

char * dbg_pax_machine ( pax_machine p)

◆ deinit_cache()

void deinit_cache ( )

◆ do_cache_maintenance()

void do_cache_maintenance ( )

◆ force_get_cache()

pax_machine * force_get_cache ( synode_no  synode)

◆ get_cache()

pax_machine * get_cache ( synode_no  synode)

◆ get_cache_no_touch()

pax_machine * get_cache_no_touch ( synode_no  synode,
bool_t  force 
)

◆ get_xcom_cache_length()

uint64_t get_xcom_cache_length ( )

◆ get_xcom_cache_occupation()

uint64_t get_xcom_cache_occupation ( )

◆ get_xcom_cache_size()

uint64_t get_xcom_cache_size ( )

◆ hash_get()

pax_machine * hash_get ( synode_no  synode)

◆ init_cache()

void init_cache ( )

◆ init_cache_size()

void init_cache_size ( )

◆ init_pax_machine()

pax_machine * init_pax_machine ( pax_machine p,
lru_machine lru,
synode_no  synode 
)

◆ is_busy_machine()

int is_busy_machine ( pax_machine p)

◆ lock_pax_machine()

int lock_pax_machine ( pax_machine p)

◆ pax_machine_size()

size_t pax_machine_size ( pax_machine const *  p)

◆ paxos_fsm_idle()

int paxos_fsm_idle ( pax_machine paxos,
site_def const *  site,
paxos_event  event,
pax_msg mess 
)

◆ paxos_timeout()

void paxos_timeout ( pax_machine p)

◆ psi_report_cache_shutdown()

void psi_report_cache_shutdown ( )

After the cache is de-initialized 'current_count' must be zero; otherwise we have allocated data that has not been deallocated (or has not been reported as deallocated).

◆ psi_report_mem_alloc()

int psi_report_mem_alloc ( size_t  size)

Reports to PSI the allocation of 'size' bytes of data.

◆ psi_report_mem_free()

void psi_report_mem_free ( size_t  size,
int  is_instrumented 
)

Reports to PSI the deallocation of 'size' bytes of data.

◆ psi_set_cache_resetting()

void psi_set_cache_resetting ( int  is_resetting)

◆ set_dec_threshold_length()

void set_dec_threshold_length ( uint64_t  threshold)

◆ set_dec_threshold_size()

void set_dec_threshold_size ( float  threshold)

◆ set_length_increment()

void set_length_increment ( size_t  increment)

◆ set_max_cache_size()

uint64_t set_max_cache_size ( uint64_t  x)

◆ set_min_length_threshold()

void set_min_length_threshold ( float  threshold)

◆ set_min_target_occupation()

void set_min_target_occupation ( float  threshold)

◆ set_size_decrement()

void set_size_decrement ( size_t  decrement)

◆ shrink_cache()

size_t shrink_cache ( )

◆ sub_cache_size()

uint64_t sub_cache_size ( pax_machine p)

◆ unlock_pax_machine()

void unlock_pax_machine ( pax_machine p)

◆ was_removed_from_cache()

int was_removed_from_cache ( synode_no  x)

◆ xcom_cache_var_init()

void xcom_cache_var_init ( )