Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d396f152
提交
d396f152
authored
7月 14, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
New experimental page store.
上级
aa3c5565
全部展开
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
1014 行增加
和
990 行删除
+1014
-990
changelog.html
h2/src/docsrc/html/changelog.html
+1
-1
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+329
-323
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+329
-323
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+326
-324
PageDataLeaf.java
h2/src/main/org/h2/index/PageDataLeaf.java
+6
-6
PageDataOverflow.java
h2/src/main/org/h2/index/PageDataOverflow.java
+4
-4
PageScanIndex.java
h2/src/main/org/h2/index/PageScanIndex.java
+3
-3
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+1
-1
PageLog.java
h2/src/main/org/h2/store/PageLog.java
+2
-2
PageStore.java
h2/src/main/org/h2/store/PageStore.java
+1
-1
TestBase.java
h2/src/test/org/h2/test/TestBase.java
+8
-1
TestMemoryUsage.java
h2/src/test/org/h2/test/db/TestMemoryUsage.java
+3
-0
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
d396f152
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
d396f152
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
d396f152
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
d396f152
差异被折叠。
点击展开。
h2/src/main/org/h2/index/PageDataLeaf.java
浏览文件 @
d396f152
...
@@ -159,16 +159,16 @@ class PageDataLeaf extends PageData {
...
@@ -159,16 +159,16 @@ class PageDataLeaf extends PageData {
rows
[
0
]
=
null
;
rows
[
0
]
=
null
;
do
{
do
{
int
type
,
size
,
next
;
int
type
,
size
,
next
;
if
(
remaining
<=
pageSize
-
PageData
Leaf
Overflow
.
START_LAST
)
{
if
(
remaining
<=
pageSize
-
PageDataOverflow
.
START_LAST
)
{
type
=
Page
.
TYPE_DATA_OVERFLOW
|
Page
.
FLAG_LAST
;
type
=
Page
.
TYPE_DATA_OVERFLOW
|
Page
.
FLAG_LAST
;
size
=
remaining
;
size
=
remaining
;
next
=
0
;
next
=
0
;
}
else
{
}
else
{
type
=
Page
.
TYPE_DATA_OVERFLOW
;
type
=
Page
.
TYPE_DATA_OVERFLOW
;
size
=
pageSize
-
PageData
Leaf
Overflow
.
START_MORE
;
size
=
pageSize
-
PageDataOverflow
.
START_MORE
;
next
=
index
.
getPageStore
().
allocatePage
();
next
=
index
.
getPageStore
().
allocatePage
();
}
}
PageData
LeafOverflow
overflow
=
new
PageDataLeaf
Overflow
(
this
,
page
,
type
,
previous
,
next
,
data
,
dataOffset
,
size
);
PageData
Overflow
overflow
=
new
PageData
Overflow
(
this
,
page
,
type
,
previous
,
next
,
data
,
dataOffset
,
size
);
index
.
getPageStore
().
updateRecord
(
overflow
,
true
,
null
);
index
.
getPageStore
().
updateRecord
(
overflow
,
true
,
null
);
dataOffset
+=
size
;
dataOffset
+=
size
;
remaining
-=
size
;
remaining
-=
size
;
...
@@ -232,7 +232,7 @@ class PageDataLeaf extends PageData {
...
@@ -232,7 +232,7 @@ class PageDataLeaf extends PageData {
int
next
=
firstOverflowPageId
;
int
next
=
firstOverflowPageId
;
int
offset
=
pageSize
;
int
offset
=
pageSize
;
do
{
do
{
PageData
Leaf
Overflow
page
=
index
.
getPageOverflow
(
next
,
this
,
offset
);
PageDataOverflow
page
=
index
.
getPageOverflow
(
next
,
this
,
offset
);
next
=
page
.
readInto
(
data
);
next
=
page
.
readInto
(
data
);
}
while
(
next
!=
0
);
}
while
(
next
!=
0
);
overflowRowSize
=
data
.
length
();
overflowRowSize
=
data
.
length
();
...
@@ -287,7 +287,7 @@ class PageDataLeaf extends PageData {
...
@@ -287,7 +287,7 @@ class PageDataLeaf extends PageData {
if
(
firstOverflowPageId
==
0
)
{
if
(
firstOverflowPageId
==
0
)
{
return
;
return
;
}
}
PageData
Leaf
Overflow
overflow
=
index
.
getPageOverflow
(
firstOverflowPageId
,
this
,
0
);
PageDataOverflow
overflow
=
index
.
getPageOverflow
(
firstOverflowPageId
,
this
,
0
);
overflow
.
setParent
(
getPos
());
overflow
.
setParent
(
getPos
());
index
.
getPageStore
().
updateRecord
(
overflow
,
true
,
null
);
index
.
getPageStore
().
updateRecord
(
overflow
,
true
,
null
);
}
}
...
@@ -310,7 +310,7 @@ class PageDataLeaf extends PageData {
...
@@ -310,7 +310,7 @@ class PageDataLeaf extends PageData {
PageStore
store
=
index
.
getPageStore
();
PageStore
store
=
index
.
getPageStore
();
int
next
=
firstOverflowPageId
;
int
next
=
firstOverflowPageId
;
do
{
do
{
PageData
Leaf
Overflow
page
=
index
.
getPageOverflow
(
next
,
this
,
0
);
PageDataOverflow
page
=
index
.
getPageOverflow
(
next
,
this
,
0
);
store
.
freePage
(
next
,
false
,
null
);
store
.
freePage
(
next
,
false
,
null
);
next
=
page
.
getNextOverflow
();
next
=
page
.
getNextOverflow
();
}
while
(
next
!=
0
);
}
while
(
next
!=
0
);
...
...
h2/src/main/org/h2/index/PageData
Leaf
Overflow.java
→
h2/src/main/org/h2/index/PageDataOverflow.java
浏览文件 @
d396f152
...
@@ -23,7 +23,7 @@ import org.h2.store.Record;
...
@@ -23,7 +23,7 @@ import org.h2.store.Record;
* </li><li>data
* </li><li>data
* </li></ul>
* </li></ul>
*/
*/
public
class
PageData
Leaf
Overflow
extends
Record
{
public
class
PageDataOverflow
extends
Record
{
/**
/**
* The start of the data in the last overflow page.
* The start of the data in the last overflow page.
...
@@ -62,7 +62,7 @@ public class PageDataLeafOverflow extends Record {
...
@@ -62,7 +62,7 @@ public class PageDataLeafOverflow extends Record {
private
Data
data
;
private
Data
data
;
PageData
Leaf
Overflow
(
PageDataLeaf
leaf
,
int
pageId
,
int
type
,
int
previous
,
int
next
,
Data
allData
,
int
offset
,
int
size
)
{
PageDataOverflow
(
PageDataLeaf
leaf
,
int
pageId
,
int
type
,
int
previous
,
int
next
,
Data
allData
,
int
offset
,
int
size
)
{
this
.
index
=
leaf
.
index
;
this
.
index
=
leaf
.
index
;
setPos
(
pageId
);
setPos
(
pageId
);
this
.
type
=
type
;
this
.
type
=
type
;
...
@@ -85,10 +85,10 @@ public class PageDataLeafOverflow extends Record {
...
@@ -85,10 +85,10 @@ public class PageDataLeafOverflow extends Record {
*
*
* @param leaf the leaf page
* @param leaf the leaf page
* @param pageId the page id
* @param pageId the page id
* @param data
All the data page with the complete valu
e
* @param data
the data pag
e
* @param offset the offset
* @param offset the offset
*/
*/
public
PageDataLeaf
Overflow
(
PageDataLeaf
leaf
,
int
pageId
,
Data
data
,
int
offset
)
{
PageData
Overflow
(
PageDataLeaf
leaf
,
int
pageId
,
Data
data
,
int
offset
)
{
this
.
index
=
leaf
.
index
;
this
.
index
=
leaf
.
index
;
setPos
(
pageId
);
setPos
(
pageId
);
this
.
data
=
data
;
this
.
data
=
data
;
...
...
h2/src/main/org/h2/index/PageScanIndex.java
浏览文件 @
d396f152
...
@@ -158,14 +158,14 @@ public class PageScanIndex extends BaseIndex implements RowIndex {
...
@@ -158,14 +158,14 @@ public class PageScanIndex extends BaseIndex implements RowIndex {
* @param offset the offset in bytes
* @param offset the offset in bytes
* @return the page
* @return the page
*/
*/
PageData
Leaf
Overflow
getPageOverflow
(
int
id
,
PageDataLeaf
leaf
,
int
offset
)
throws
SQLException
{
PageDataOverflow
getPageOverflow
(
int
id
,
PageDataLeaf
leaf
,
int
offset
)
throws
SQLException
{
Record
rec
=
store
.
getRecord
(
id
);
Record
rec
=
store
.
getRecord
(
id
);
if
(
rec
!=
null
)
{
if
(
rec
!=
null
)
{
return
(
PageData
Leaf
Overflow
)
rec
;
return
(
PageDataOverflow
)
rec
;
}
}
Data
data
=
store
.
readPage
(
id
);
Data
data
=
store
.
readPage
(
id
);
data
.
reset
();
data
.
reset
();
PageData
LeafOverflow
result
=
new
PageDataLeaf
Overflow
(
leaf
,
id
,
data
,
offset
);
PageData
Overflow
result
=
new
PageData
Overflow
(
leaf
,
id
,
data
,
offset
);
result
.
read
();
result
.
read
();
return
result
;
return
result
;
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
d396f152
...
@@ -1439,7 +1439,7 @@ public class JdbcConnection extends TraceObject implements Connection {
...
@@ -1439,7 +1439,7 @@ public class JdbcConnection extends TraceObject implements Connection {
int id = getNextId(TraceObject.CLOB);
int id = getNextId(TraceObject.CLOB);
debugCodeAssign("NClob", TraceObject.CLOB, id, "createNClob()");
debugCodeAssign("NClob", TraceObject.CLOB, id, "createNClob()");
checkClosedForWrite();
checkClosedForWrite();
ValueLob v = ValueLob.createSmallLob(Value.CLOB,
ByteUtils.EMPTY
);
ValueLob v = ValueLob.createSmallLob(Value.CLOB,
MemoryUtils.EMPTY_BYTES
);
return new JdbcClob(this, v, id);
return new JdbcClob(this, v, id);
} catch (Exception e) {
} catch (Exception e) {
throw logAndConvert(e);
throw logAndConvert(e);
...
...
h2/src/main/org/h2/store/PageLog.java
浏览文件 @
d396f152
...
@@ -667,7 +667,7 @@ public class PageLog {
...
@@ -667,7 +667,7 @@ public class PageLog {
}
}
/**
/**
* Called after the rec
v
overy has been completed.
* Called after the recovery has been completed.
*/
*/
void
recoverEnd
()
{
void
recoverEnd
()
{
sessionStates
=
New
.
hashMap
();
sessionStates
=
New
.
hashMap
();
...
...
h2/src/main/org/h2/store/PageStore.java
浏览文件 @
d396f152
...
@@ -1019,7 +1019,7 @@ public class PageStore implements CacheWriter {
...
@@ -1019,7 +1019,7 @@ public class PageStore implements CacheWriter {
/**
/**
* Create an array of SearchRow with the given size.
* Create an array of SearchRow with the given size.
*
*
* @param
len the number of bytes requested
* @param
entryCount the number of elements
* @return the array
* @return the array
*/
*/
public
static
SearchRow
[]
newSearchRows
(
int
entryCount
)
{
public
static
SearchRow
[]
newSearchRows
(
int
entryCount
)
{
...
...
h2/src/test/org/h2/test/TestBase.java
浏览文件 @
d396f152
...
@@ -1071,7 +1071,11 @@ public abstract class TestBase {
...
@@ -1071,7 +1071,11 @@ public abstract class TestBase {
return
"-Dh2.pageStore="
+
System
.
getProperty
(
"h2.pageStore"
);
return
"-Dh2.pageStore="
+
System
.
getProperty
(
"h2.pageStore"
);
}
}
/**
* Use up almost all memory.
*
* @param remainingKB the number of kilobytes that are not referenced
*/
protected
void
eatMemory
(
int
remainingKB
)
{
protected
void
eatMemory
(
int
remainingKB
)
{
byte
[]
reserve
=
new
byte
[
remainingKB
*
1024
];
byte
[]
reserve
=
new
byte
[
remainingKB
*
1024
];
int
max
=
128
*
1024
*
1024
;
int
max
=
128
*
1024
*
1024
;
...
@@ -1106,6 +1110,9 @@ public abstract class TestBase {
...
@@ -1106,6 +1110,9 @@ public abstract class TestBase {
reserve
=
null
;
reserve
=
null
;
}
}
/**
* Remove the hard reference to the memory.
*/
protected
void
freeMemory
()
{
protected
void
freeMemory
()
{
memory
.
clear
();
memory
.
clear
();
}
}
...
...
h2/src/test/org/h2/test/db/TestMemoryUsage.java
浏览文件 @
d396f152
...
@@ -103,6 +103,9 @@ public class TestMemoryUsage extends TestBase {
...
@@ -103,6 +103,9 @@ public class TestMemoryUsage extends TestBase {
}
}
}
}
/**
* Eat memory so that all soft references are garbage collected.
*/
void
freeSoftReferences
()
{
void
freeSoftReferences
()
{
try
{
try
{
eatMemory
(
1
);
eatMemory
(
1
);
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
d396f152
...
@@ -594,4 +594,4 @@ ops jopr googlegroups fletcher prefer djava expires fffe polish articles
...
@@ -594,4 +594,4 @@ ops jopr googlegroups fletcher prefer djava expires fffe polish articles
attachment transiently cleanup dbsnmp olapsys wmsys tsmsys outln ctxsys mddata
attachment transiently cleanup dbsnmp olapsys wmsys tsmsys outln ctxsys mddata
ordsys ordplugins mgmt dmsys exfsys mdsys sysman informtn textarray tmzone cdo
ordsys ordplugins mgmt dmsys exfsys mdsys sysman informtn textarray tmzone cdo
emf decompile streamed setmaxlengthinplacelob setcompresslob compressing
emf decompile streamed setmaxlengthinplacelob setcompresslob compressing
compressible subclass
compressible subclass ints seeks kilobytes
\ No newline at end of file
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论