结构体buf_block_t
/** Buffer block for which an uncompressed page exists */
typedef struct buf_block_struct buf_block_t;
/** The buffer control block structure */
struct buf_block_struct{
/** @name General fields */
/* @{ */
buf_page_t page; //详见/*!< page information; this must
be the first field, so that
buf_pool->page_hash can point
to buf_page_t or buf_block_t */
byte* frame; /*!< pointer to buffer frame which
is of size UNIV_PAGE_SIZE, and
aligned to an address divisible by
UNIV_PAGE_SIZE */
#ifndef UNIV_HOTBACKUP
UT_LIST_NODE_T(buf_block_t) unzip_LRU;
/*!< node of the decompressed LRU list;
a block is in the unzip_LRU list
if page.state == BUF_BLOCK_FILE_PAGE
and page.zip.data != NULL */
#ifdef UNIV_DEBUG
ibool in_unzip_LRU_list;/*!< TRUE if the page is in the
decompressed LRU list;
used in debugging */
#endif /* UNIV_DEBUG */
mutex_t mutex; /*!< mutex protecting this block:
state (also protected by the buffer
pool mutex), io_fix, buf_fix_count,
and accessed; we introduce this new
mutex in InnoDB-5.1 to relieve
contention on the buffer pool mutex */
rw_lock_t lock; /*!< read-write lock of the buffer
frame */
unsigned lock_hash_val:;/*!< hashed value of the page address
in the record lock hash table;
protected by buf_block_t::lock
(or buf_block_t::mutex, buf_pool->mutex
in buf_page_get_gen(),
buf_page_init_for_read()
and buf_page_create()) */
ibool check_index_page_at_flush;
/*!< TRUE if we know that this is
an index page, and want the database
to check its consistency before flush;
note that there may be pages in the
buffer pool which are index pages,
but this flag is not set because
we do not keep track of all pages;
NOT protected by any mutex */
/* @} */
/** @name Optimistic search field */
/* @{ */
ib_uint64_t modify_clock; /*!< this clock is incremented every
time a pointer to a record on the
page may become obsolete; this is
used in the optimistic cursor
positioning: if the modify clock has
not changed, we know that the pointer
is still valid; this field may be
changed if the thread (1) owns the
pool mutex and the page is not
bufferfixed, or (2) the thread has an
x-latch on the block */
/* @} */
/** @name Hash search fields (unprotected)
NOTE that these fields are NOT protected by any semaphore! */
/* @{ */
ulint n_hash_helps; /*!< counter which controls building
of a new hash index for the page */
ulint n_fields; /*!< recommended prefix length for hash
search: number of full fields */
ulint n_bytes; /*!< recommended prefix: number of bytes
in an incomplete field */
ibool left_side; /*!< TRUE or FALSE, depending on
whether the leftmost record of several
records with the same prefix should be
indexed in the hash index */
/* @} */
/** @name Hash search fields
These 5 fields may only be modified when we have
an x-latch on btr_search_latch AND
- we are holding an s-latch or x-latch on buf_block_struct::lock or
- we know that buf_block_struct::buf_fix_count == 0.
An exception to this is when we init or create a page
in the buffer pool in buf0buf.c.
Another exception is that assigning block->index = NULL
is allowed whenever holding an x-latch on btr_search_latch. */
/* @{ */
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
ulint n_pointers; /*!< used in debugging: the number of
pointers in the adaptive hash index
pointing to this frame */
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
unsigned curr_n_fields:;/*!< prefix length for hash indexing:
number of full fields */
unsigned curr_n_bytes:;/*!< number of bytes in hash
indexing */
unsigned curr_left_side:;/*!< TRUE or FALSE in hash indexing */
dict_index_t* index; /*!< Index for which the
adaptive hash index has been
created, or NULL if the page
does not exist in the
index. Note that it does not
guarantee that the index is
complete, though: there may
have been hash collisions,
record deletions, etc. */
/* @} */
# ifdef UNIV_SYNC_DEBUG
/** @name Debug fields */
/* @{ */
rw_lock_t debug_latch; /*!< in the debug version, each thread
which bufferfixes the block acquires
an s-latch here; so we can use the
debug utilities in sync0rw */
/* @} */
# endif
#endif /* !UNIV_HOTBACKUP */
};
结构体buf_block_t的更多相关文章
- Go结构体实现类似成员函数机制
Go语言结构体成员能否是函数,从而实现类似类的成员函数的机制呢?答案是肯定的. package main import "fmt" type stru struct { testf ...
- C#基础回顾(二)—页面值传递、重载与重写、类与结构体、装箱与拆箱
一.前言 -孤独的路上有梦想作伴,乘风破浪- 二.页面值传递 (1)C#各页面之间可以进行数据的交换和传递,页面之间可根据获取的数据,进行各自的操作(跳转.计算等操作).为了实现多种方式的数据传递,C ...
- go语言结构体
定义: 是一种聚合的数据类型,是由零个或多个任意类型的值聚合成的实体. 成员: 每个值称为结构体的成员. 示例: 用结构体的经典案例处理公司的员工信息,每个员工信息包含一个唯一的员工编号.员工的名字. ...
- C语言中的结构体
用户自己建立自己的结构体类型 1. 定义和使用结构体变量 (1).结构体的定义 C语言允许用户自己建立由不同类型数据组成的组合型的数据结构,它称为结构体. (2).声明一个结构体类型的一般形式为: ...
- C++_系列自学课程_第_12_课_结构体
#include <iostream> #include <string> using namespace std; struct CDAccount { double bal ...
- java socket传送一个结构体给用C++编写的服务器解析的问题
另一端是Java写客户端程序,两者之间需要通信.c++/c接收和发送的都是结构体,而Java是直接发送的字节流或者byte 数组.解决方法:c++/c socket 在发送结构体的时候其实发送的也是字 ...
- swift学习笔记3——类、结构体、枚举
之前学习swift时的个人笔记,根据github:the-swift-programming-language-in-chinese学习.总结,将重要的内容提取,加以理解后整理为学习笔记,方便以后查询 ...
- HDOJ 1009. Fat Mouse' Trade 贪心 结构体排序
FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- C语言结构体对齐
1.结构体变量中的元素如何访问? (1)数组中元素的访问方式:表面上有2种方式(数组下标方式和指针方式):实质上都是指针方式访问.(2)结构体变量中的元素访问方式:只有一种,用.或者->的方式来 ...
随机推荐
- Sublime字体设置
{"font_face": "Courier New","font_options":["subpixel_antialias&q ...
- shopnc 商城源码阅读笔记--开篇概述
关于shopnc 以下是摘抄自百度百科的关于shopnc的介绍: ShopNC商城系统,是天津市网城天创科技有限责任公司开发的一套多店模式的商城系统. 本系统具有商城系统非常完整和专业的功能与流程,系 ...
- Python入门二:函数
一.函数的定义和使用 1.基本结构: def 函数名(参数): """ 文档字符串 """ 函数体 返回值 2.函数名: 和变量名命名规则一 ...
- python 对象持久化 pickle模块
用到python 序列化 比如我们可以把一些配置的信息放到数组,字典或者做为类的属性,然后对数据进行 序列化,再把序列化好的数据放到文件里或者直接放到数据库里,这样可以方便下次要用数据的时候 对数据进 ...
- 宝马-中国官方网站服务站点信息爬去记录(解析json中数据)
具体步骤: 1.进入宝马官网,查找经销商查询界面 http://www.bmw.com.cn/cn/zh/general/dealer_locator/content/dealer_locator.h ...
- WPF中让TextBlock每一个字符显示不同的颜色
XAML代码: <TextBlock x:Name="tb"> <Run Foreground="Red">R</Run> ...
- Oracle中NULL值与索引
NULL值是关系数据库系统布尔型(true,false,unknown)中比较特殊类型的一种值,通常称为UNKNOWN或空值,即是未知的,不确定的.由于NULL存在着无数的可能,因此NULL值也不等于 ...
- Qt智能指针简明说明
下面的智能指针分别对应boost库,Qt库,c++11的智能指针 boost::scoped_ptr QScopedPointer unique_ptr 在其生命期结束后会自动删除它所指的对象(确定 ...
- iOS runtime 与 runloop
runtime是运行时机制,就是运行到的时候才会执行的机制(类似于栏加载)属于时间先后性质的 runloop 是主线程的运行的意思 属于 (loop) 循环性质的 以下是 具体点的 解释: run ...
- JAVA CAS单点登录(SSO) 教程
一.教程前言 教程目的:从头到尾细细道来单点登录服务器及客户端应用的每个步骤 单点登录(SSO):请看百科解释猛击这里打开 本教程使用的SSO服务器是Yelu大学研发的CAS(Central Auth ...