typedef struct buf_pool_struct buf_pool_t;

/** @brief The buffer pool structure.

NOTE! The definition appears here only for other modules of this
directory (buf) to see it. Do not use from outside! */

struct buf_pool_struct{

    /** @name General fields */
    /* @{ */
    mutex_t        mutex;        /*!< Buffer pool mutex of this
                    instance */
    mutex_t        zip_mutex;    /*!< Zip mutex of this buffer
                    pool instance, protects compressed
                    only pages (of type buf_page_t, not
                    buf_block_t */
    ulint        instance_no;    /*!< Array index of this buffer
                    pool instance */
    ulint        old_pool_size;  /*!< Old pool size in bytes */
    ulint        curr_pool_size;    /*!< Current pool size in bytes */
    ulint        LRU_old_ratio;  /*!< Reserve this much of the buffer
                    pool for "old" blocks */
#ifdef UNIV_DEBUG
    ulint        buddy_n_frames; /*!< Number of frames allocated from
                    the buffer pool to the buddy system */
#endif
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
    ulint        mutex_exit_forbidden; /*!< Forbid release mutex */
#endif
    ulint        n_chunks;    /*!< number of buffer pool chunks */
    buf_chunk_t*    chunks;        /*!< buffer pool chunks */
    ulint        curr_size;    /*!< current pool size in pages */
    hash_table_t*    page_hash;    /*!< hash table of buf_page_t or
                    buf_block_t file pages,
                    buf_page_in_file() == TRUE,
                    indexed by (space_id, offset) */
    hash_table_t*    zip_hash;    /*!< hash table of buf_block_t blocks
                    whose frames are allocated to the
                    zip buddy system,
                    indexed by block->frame */
    ulint        n_pend_reads;    /*!< number of pending read
                    operations */
    ulint        n_pend_unzip;    /*!< number of pending decompressions */

    time_t        last_printout_time;
                    /*!< when buf_print_io was last time
                    called */
    buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES + ];
                    /*!< Statistics of buddy system,
                    indexed by block size */
    buf_pool_stat_t    stat;        /*!< current statistics */
    buf_pool_stat_t    old_stat;    /*!< old statistics */

    /* @} */

    /** @name Page flushing algorithm fields */

    /* @{ */

    mutex_t        flush_list_mutex;/*!< mutex protecting the
                    flush list access. This mutex
                    protects flush_list, flush_rbt
                    and bpage::list pointers when
                    the bpage is on flush_list. It
                    also protects writes to
                    bpage::oldest_modification */
    UT_LIST_BASE_NODE_T(buf_page_t) flush_list;
                    /*!< base node of the modified block
                    list */
    ibool        init_flush[BUF_FLUSH_N_TYPES];
                    /*!< this is TRUE when a flush of the
                    given type is being initialized */
    ulint        n_flush[BUF_FLUSH_N_TYPES];
                    /*!< this is the number of pending
                    writes in the given flush type */
    os_event_t    no_flush[BUF_FLUSH_N_TYPES];
                    /*!< this is in the set state
                    when there is no flush batch
                    of the given type running */
    ib_rbt_t*    flush_rbt;    /*!< a red-black tree is used
                    exclusively during recovery to
                    speed up insertions in the
                    flush_list. This tree contains
                    blocks in order of
                    oldest_modification LSN and is
                    kept in sync with the
                    flush_list.
                    Each member of the tree MUST
                    also be on the flush_list.
                    This tree is relevant only in
                    recovery and is set to NULL
                    once the recovery is over.
                    Protected by flush_list_mutex */
    ulint        freed_page_clock;/*!< a sequence number used
                    to count the number of buffer
                    blocks removed from the end of
                    the LRU list; NOTE that this
                    counter may wrap around at 4
                    billion! A thread is allowed
                    to read this for heuristic
                    purposes without holding any
                    mutex or latch */
    ulint        LRU_flush_ended;/*!< when an LRU flush ends for a page,
                    this is incremented by one; this is
                    set to zero when a buffer block is
                    allocated */
    /* @} */

    /** @name LRU replacement algorithm fields */
    /* @{ */

    UT_LIST_BASE_NODE_T(buf_page_t) free;
                    /*!< base node of the free
                    block list */
    UT_LIST_BASE_NODE_T(buf_page_t) LRU;
                    /*!< base node of the LRU list */
    buf_page_t*    LRU_old;    /*!< pointer to the about
                    LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV
                    oldest blocks in the LRU list;
                    NULL if LRU length less than
                    BUF_LRU_OLD_MIN_LEN;
                    NOTE: when LRU_old != NULL, its length
                    should always equal LRU_old_len */
    ulint        LRU_old_len;    /*!< length of the LRU list from
                    the block to which LRU_old points
                    onward, including that block;
                    see buf0lru.c for the restrictions
                    on this value; 0 if LRU_old == NULL;
                    NOTE: LRU_old_len must be adjusted
                    whenever LRU_old shrinks or grows! */

    UT_LIST_BASE_NODE_T(buf_block_t) unzip_LRU;
                    /*!< base node of the
                    unzip_LRU list */

    /* @} */
    /** @name Buddy allocator fields
    The buddy allocator is used for allocating compressed page
    frames and buf_page_t descriptors of blocks that exist
    in the buffer pool only in compressed form. */
    /* @{ */
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
    UT_LIST_BASE_NODE_T(buf_page_t)    zip_clean;
                    /*!< unmodified compressed pages */
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
    UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES];
                    /*!< buddy free lists */

    buf_page_t            watch[BUF_POOL_WATCH_SIZE];
                    /*!< Sentinel records for buffer
                    pool watches. Protected by
                           buf_pool->mutex. */

#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
#endif
#if BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE
# error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE"
#endif
    /* @} */
};

宏buf_pool_struct的更多相关文章

  1. Visual Studio 宏的高级用法

    因为自 Visual Studio 2012 开始,微软已经取消了对宏的支持,所以本篇文章所述内容只适用于 Visual Studio 2010 或更早期版本的 VS. 在上一篇中,我已经介绍了如何编 ...

  2. VC 中与字符串相关的宏 _T、TEXT,_TEXT、L 的作用

    CSDN原博文:http://blog.csdn.net/houkai363/article/details/8134787 遇到了:不能将参数 1 从“const char [5]”转换为“LPCT ...

  3. 【转】linux内核中writesb(), writesw(), writesl() 宏函数

    writesb(), writesw(), writesl() 宏函数 功能 : writesb()    I/O 上写入 8 位数据流数据 (1字节) writesw()   I/O  上写入 16 ...

  4. c++宏定义命令

    在程序开始以#开头的命令,他们是预编译命令.有三类预编译命令:宏定义命令.文件包含命令.条件编译命令:今天聊聊宏定义: 宏定义命令将一个标识符定义为一个字符串,源程序中的该标识符均以指定的字符串来代替 ...

  5. dll导入导出宏定义,出现“不允许 dllimport 函数 的定义”的问题分析

    建立dll项目后,在头文件中,定义API宏 #ifndef API_S_H #define API_S_H ...... #ifndef DLL_S_20160424 #define API _dec ...

  6. VC++/MFC 最常用宏和指令

    1.#include指令  包含指定的文件,最基本的最熟悉的指令,编程中不得不用,包含库文件用双尖括号,包含自定义头文件用双引号. 2.#define指令   预定义,通常用它来定义常量(包括无参量与 ...

  7. [Sass]混合宏的参数

    [Sass]混合宏的参数--传一个不带值的参数 Sass 的混合宏有一个强大的功能,可以传参,那么在 Sass 中传参主要有以下几种情形: A) 传一个不带值的参数 在混合宏中,可以传一个不带任何值的 ...

  8. [Sass]混合宏

    [Sass]混合宏-声明混合宏 如果整个网站中有几处小样式类似,比如颜色,字体等,在 Sass 可以使用变量来统一处理,那么这种选择还是不错的.但当你的样式变得越来越复杂,需要重复使用大段的样式时,使 ...

  9. BOOST_AUTO宏

    在boost中,有个非常不错的宏BOOST_AUTO(),它的作用是自动给var定义类型,适合function()函数返回的值的类型. int function() { ; } main() { BO ...

随机推荐

  1. 团队项目之Sprint计划会议

    一.我们团队在4月15日进行了冲刺计划会议,会议过程大致如下: 1.总结目前的工作进展,再一次确定所做项目的方向: 2.将之前的调查问卷的结果进行统计,做了需求分析,大致了解了用户的想法: 3.根据初 ...

  2. bndtools教程

    使用工具编程的确能给人们带来很多便利,但是在不会用之前,且缺乏相应的中文资料让你去了解时,真是一种折磨,同时也是一种挑战. bndTools其实就是用来开发OSGi的一个工具,它为开发提供了便利,具体 ...

  3. Jquery datatables 重载数据方法

    参考这里 { RefreshTable('#table-example', '/BlogManage/GetLabelData'); } function RefreshTable(tableId, ...

  4. python SendMail 发送邮件

    最近在学习python 时,用到了发送邮件的操作,通过整理总结如下: 1.普通文本邮件 普通文本邮件发送的实现,关键是要将MIMEText中_subtype设置为plain,首先导入smtplib和m ...

  5. 1072: [SCOI2007]排列perm - BZOJ

    Description 给一个数字串s和正整数d, 统计s有多少种不同的排列能被d整除(可以有前导0).例如123434有90种排列能被2整除,其中末位为2的有30种,末位为4的有60种.Input ...

  6. angular入门系列教程3

    主题: 本篇主要目的就是继续完善home页,增加tab导航的三个页index index1 index2 效果图: 细节: 初始化的JS就是咱们的home.js,仔细来看. angular的route ...

  7. Matlab与微积分计算

    一.极限问题的解析解 1.1 单变量函数的极限 格式1: L= limit( fun, x, x0) 格式2: L= limit( fun, x, x0, ‘left’ 或 ‘right’) > ...

  8. java 伪静态的方法

    1.jar包支持urlrewritefilter-4.0.3.jar  http://files.cnblogs.com/simpledev/urlrewritefilter-4.0.3.rar 2. ...

  9. 【c++基础】const、const指针、const引用

    一.const常量 声明时必须同时初始化(和“引用”一样) 二.const指针 三.const引用 引用本身和引用的对象都是const对象,可以用字面值来赋给const引用(普通引用则不行) ; co ...

  10. java基础知识回顾之---java String final类普通方法的应用之“按照字节截取字符串”

    /*需求:在java中,字符串“abcd”与字符串“ab你好”的长度是一样,都是四个字符.但对应的字节数不同,一个汉字占两个字节.定义一个方法,按照最大的字节数来取子串.如:对于“ab你好”,如果取三 ...