Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f45d1853
提交
f45d1853
authored
3月 30, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improved performance.
上级
014c8a16
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
15 行删除
+15
-15
PageStore.java
h2/src/main/org/h2/store/PageStore.java
+15
-15
没有找到文件。
h2/src/main/org/h2/store/PageStore.java
浏览文件 @
f45d1853
...
...
@@ -258,7 +258,7 @@ public class PageStore implements CacheWriter {
/**
* Open the file and read the header.
*/
public
void
open
()
{
public
synchronized
void
open
()
{
try
{
metaRootPageId
.
put
(
META_TABLE_ID
,
PAGE_ID_META_ROOT
);
if
(
IOUtils
.
exists
(
fileName
))
{
...
...
@@ -445,7 +445,7 @@ public class PageStore implements CacheWriter {
* @param compactMode 0 if no compacting should happen, otherwise
* TransactionCommand.SHUTDOWN_COMPACT or TransactionCommand.SHUTDOWN_DEFRAG
*/
public
void
compact
(
int
compactMode
)
{
public
synchronized
void
compact
(
int
compactMode
)
{
if
(!
database
.
getSettings
().
pageStoreTrim
)
{
return
;
}
...
...
@@ -1032,7 +1032,7 @@ public class PageStore implements CacheWriter {
return
getFreeList
(
getFreeListId
(
pageId
));
}
private
synchronized
PageFreeList
getFreeList
(
int
i
)
{
private
PageFreeList
getFreeList
(
int
i
)
{
PageFreeList
list
=
null
;
if
(
i
<
freeLists
.
size
())
{
list
=
freeLists
.
get
(
i
);
...
...
@@ -1099,7 +1099,7 @@ public class PageStore implements CacheWriter {
*
* @return the page id
*/
public
int
allocatePage
()
{
public
synchronized
int
allocatePage
()
{
int
pos
=
allocatePage
(
null
,
0
);
if
(!
recoveryRunning
)
{
if
(
logMode
!=
LOG_MODE_OFF
)
{
...
...
@@ -1109,7 +1109,7 @@ public class PageStore implements CacheWriter {
return
pos
;
}
private
synchronized
int
allocatePage
(
BitField
exclude
,
int
first
)
{
private
int
allocatePage
(
BitField
exclude
,
int
first
)
{
int
page
;
// TODO could remember the first possible free list page
for
(
int
i
=
0
;;
i
++)
{
...
...
@@ -1153,7 +1153,7 @@ public class PageStore implements CacheWriter {
*
* @param pageId the page id
*/
public
void
free
(
int
pageId
)
{
public
synchronized
void
free
(
int
pageId
)
{
free
(
pageId
,
true
);
}
...
...
@@ -1163,7 +1163,7 @@ public class PageStore implements CacheWriter {
* @param pageId the page id
* @param undo if the undo record must have been written
*/
synchronized
void
free
(
int
pageId
,
boolean
undo
)
{
void
free
(
int
pageId
,
boolean
undo
)
{
if
(
trace
.
isDebugEnabled
())
{
// trace.debug("free " + pageId + " " + undo);
}
...
...
@@ -1193,7 +1193,7 @@ public class PageStore implements CacheWriter {
*
* @param pageId the page id
*/
synchronized
void
freeUnused
(
int
pageId
)
{
void
freeUnused
(
int
pageId
)
{
if
(
trace
.
isDebugEnabled
())
{
trace
.
debug
(
"freeUnused {0}"
,
pageId
);
}
...
...
@@ -1217,7 +1217,7 @@ public class PageStore implements CacheWriter {
* @param pos the page id
* @return the page
*/
public
Data
readPage
(
int
pos
)
{
public
synchronized
Data
readPage
(
int
pos
)
{
Data
page
=
createData
();
readPage
(
pos
,
page
);
return
page
;
...
...
@@ -1229,7 +1229,7 @@ public class PageStore implements CacheWriter {
* @param pos the page id
* @param page the page
*/
synchronized
void
readPage
(
int
pos
,
Data
page
)
{
void
readPage
(
int
pos
,
Data
page
)
{
if
(
recordPageReads
)
{
if
(
pos
>=
MIN_PAGE_COUNT
&&
recordedPagesIndex
.
get
(
pos
)
==
IntIntHashMap
.
NOT_FOUND
)
{
recordedPagesIndex
.
put
(
pos
,
recordedPagesList
.
size
());
...
...
@@ -1632,7 +1632,7 @@ public class PageStore implements CacheWriter {
*
* @param index the index
*/
public
void
addIndex
(
PageIndex
index
)
{
public
synchronized
void
addIndex
(
PageIndex
index
)
{
metaObjects
.
put
(
index
.
getId
(),
index
);
}
...
...
@@ -1642,7 +1642,7 @@ public class PageStore implements CacheWriter {
* @param index the index to add
* @param session the session
*/
public
void
addMeta
(
PageIndex
index
,
Session
session
)
{
public
synchronized
void
addMeta
(
PageIndex
index
,
Session
session
)
{
int
type
=
index
instanceof
PageDataIndex
?
META_TYPE_DATA_INDEX
:
META_TYPE_BTREE_INDEX
;
IndexColumn
[]
columns
=
index
.
getIndexColumns
();
StatementBuilder
buff
=
new
StatementBuilder
();
...
...
@@ -1684,7 +1684,7 @@ public class PageStore implements CacheWriter {
* @param index the index to remove
* @param session the session
*/
public
void
removeMeta
(
Index
index
,
Session
session
)
{
public
synchronized
void
removeMeta
(
Index
index
,
Session
session
)
{
if
(!
recoveryRunning
)
{
removeMetaIndex
(
index
,
session
);
metaObjects
.
remove
(
index
.
getId
());
...
...
@@ -1717,7 +1717,7 @@ public class PageStore implements CacheWriter {
* @param pageId the page where the transaction was prepared
* @param commit if the transaction should be committed
*/
public
void
setInDoubtTransactionState
(
int
sessionId
,
int
pageId
,
boolean
commit
)
{
public
synchronized
void
setInDoubtTransactionState
(
int
sessionId
,
int
pageId
,
boolean
commit
)
{
boolean
old
=
database
.
isReadOnly
();
try
{
database
.
setReadOnly
(
false
);
...
...
@@ -1742,7 +1742,7 @@ public class PageStore implements CacheWriter {
* @return true if it is
*/
public
boolean
isRecoveryRunning
()
{
return
this
.
recoveryRunning
;
return
recoveryRunning
;
}
private
void
checkOpen
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论