typedef    struct buf_pool_struct        buf_pool_t;

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
    /* @} */
};

最新文章

  1. Webform Application传值 ViewState
  2. OC中的字典NSDictionary
  3. bootstrap 双层模态框的实现
  4. Storm自带测试案例的运行
  5. Java基础小总结
  6. js函数的调用问题
  7. Android实现贪吃蛇游戏
  8. 使用ArrayList对大小写字母的随机打印
  9. C# - 使用 OLEDB读取 excel(不用Excel对象).
  10. Activiti工作流学习-----基于5.19.0版本(6)
  11. (一)Harbor安装 -- 企业级Registry仓库
  12. python 标准库 -- unittest
  13. python第三方库------jieba库(中文分词)
  14. C# 面向对象零碎知识点
  15. centos中文字符集,中文日志
  16. gcd,lcm
  17. C# 方法中的this参数
  18. Golang两种执行流程以及区别
  19. Spring Cloud Hystrix
  20. iosxcode7以后免证书真机测试方法如下

热门文章

  1. nodejs小问题:express不是内部或外部命令(转载)
  2. Ubuntu实用快捷键
  3. javaScript基础之闭包
  4. MVC3中在同一解决方案的不同项目中实现Area功能
  5. 【Asp.Net MVC-视频】
  6. vc6命令行编译工程方法
  7. jQuery1.9.1源码分析--Animation模块
  8. Follow Path -》 Unity3d通用脚本
  9. Unity3D开发之“获取IOS设备所在的国家代码&quot;
  10. poj 2253 Frogger (最短路变种,连通图的最长边)