结构体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)结构体变量中的元素访问方式:只有一种,用.或者->的方式来 ...
随机推荐
- 转发 PHP 资料(一)
WebShell隐藏思路.webshell磁盘读写动态检测.webshell沙箱动态检测(2) 作为WebShell检测.CMS修复.WebShell攻防研究学习的第二篇文章 本文旨在研究Webs ...
- PHPCMS v9栏目添加字段及描述编辑器修改方法
为PHPCMS v9栏目添加字段和把描述的textarea编辑器变成fceditor编辑器的方法.如下: 1. 添加数据库字段:description1,添加位置:v9_catetory表 2. 在c ...
- Python urllib2 模块学习笔记
2015.3.6 urllib2的使用方法大致如下 # 定制Handler处理函数 opener = urllib2.build_opener(ProxyHandler, HTTPHandler) ...
- PHP的$_SERVER['HTTP_HOST']获取服务器地址功能详解,$_SERVER['HTTP_X_FORWARDED_HOST']
uchome的index文件中的二级域名功能判断,使用了php的$_SERVER['HTTP_HOST'],开始对这个不是很了解,所以百度了一下,发现一篇帖子有点意思,转发过来做个记录. 在php中, ...
- 字符设备驱动中cdev与inode、file_operations的关系
一.cdev与inode 二.cdev与file_operations
- Kinetic使用注意点--lable
new Lable(config) 参数: config:包含所有配置项的对象. { x: "横坐标", y: "纵坐标", width: "宽度&q ...
- iOS CoCoa编程中视图控制器与视图类(转)
分类: iPhone2012-05-28 11:19 837人阅读 评论(0) 收藏 举报 cocoa编程iosuinavigationcontrolleruiviewiphone iPhone编程规 ...
- cocos2dx游戏资源加密之XXTEA
在手机游戏当中,游戏的资源加密保护是一件很重要的事情. 我花了两天的时间整理了自己在游戏当中的资源加密问题,实现了跨平台的资源流加密,这个都是巨人的肩膀之上的. 大概的思路是这样的,游戏资源通过XXT ...
- TF/IDF计算方法
FROM:http://blog.csdn.net/pennyliang/article/details/1231028 我们已经谈过了如何自动下载网页.如何建立索引.如何衡量网页的质量(Page R ...
- swift基础--运算符
(1)加减乘除 (2)三目运算,切记后面的空格如果不加会报错的.估计是苹果的bug. (3)聚合运算符,省却了一个判断,很人性化 (4)区间运算符 //加减乘除等等 let a = 2 let b = ...