Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2705a8c5
提交
2705a8c5
authored
2月 17, 2014
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Documentation / formatting
上级
1c51be2e
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
1041 行增加
和
933 行删除
+1041
-933
changelog.html
h2/src/docsrc/html/changelog.html
+1
-1
mvstore.html
h2/src/docsrc/html/mvstore.html
+7
-7
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+345
-297
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+345
-297
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+308
-292
Aggregate.java
h2/src/main/org/h2/api/Aggregate.java
+3
-3
AggregateFunction.java
h2/src/main/org/h2/api/AggregateFunction.java
+1
-0
Bnf.java
h2/src/main/org/h2/bnf/Bnf.java
+2
-2
Session.java
h2/src/main/org/h2/engine/Session.java
+1
-1
UserAggregate.java
h2/src/main/org/h2/engine/UserAggregate.java
+2
-1
MVMap.java
h2/src/main/org/h2/mvstore/MVMap.java
+1
-0
MVStore.java
h2/src/main/org/h2/mvstore/MVStore.java
+2
-4
MVStoreTool.java
h2/src/main/org/h2/mvstore/MVStoreTool.java
+11
-11
LobStorageMap.java
h2/src/main/org/h2/store/LobStorageMap.java
+0
-6
Shell.java
h2/src/main/org/h2/tools/Shell.java
+2
-1
TestLob.java
h2/src/test/org/h2/test/db/TestLob.java
+2
-2
TestSpatial.java
h2/src/test/org/h2/test/db/TestSpatial.java
+4
-4
TestMVStore.java
h2/src/test/org/h2/test/store/TestMVStore.java
+1
-1
TestStreamStore.java
h2/src/test/org/h2/test/store/TestStreamStore.java
+1
-1
FilePathUnstable.java
h2/src/test/org/h2/test/utils/FilePathUnstable.java
+1
-1
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
2705a8c5
...
...
@@ -43,7 +43,7 @@ Change Log
</li><li>
Lucene 2 is no longer supported.
</li><li>
Fix bug in calculating default MIN and MAX values for SEQUENCE.
</li><li>
Fix bug in performing IN queries with multiple values when IGNORECASE=TRUE
</li><li>
Add entrypoint to org.h2.tools.Shell so it can be called from inside an application.
</li><li>
Add entry
-
point to org.h2.tools.Shell so it can be called from inside an application.
patch by Thomas Gillet.
</li><li>
Fix bug that prevented the PgServer from being stopped and started multiple times.
</li></ul>
...
...
h2/src/docsrc/html/mvstore.html
浏览文件 @
2705a8c5
...
...
@@ -478,11 +478,11 @@ it is recommended to use it together with the MVCC mode
<h2
id=
"fileFormat"
>
File Format
</h2>
<p>
The data is stored in one file.
The file contains two file headers (for safety), and a number of chunks.
The data is stored in one file.
The file contains two file headers (for safety), and a number of chunks.
The file headers are one block each; a block is 4096 bytes.
Each chunk is at least one block, but typically 200 blocks or more.
Data is stored in the chunks in the form of a
Data is stored in the chunks in the form of a
<a
href=
"https://en.wikipedia.org/wiki/Log-structured_file_system"
>
log structured storage
</a>
.
There is one chunk for every version.
</p>
...
...
@@ -495,12 +495,12 @@ As an example, the following code:
</p>
<pre>
MVStore s = MVStore.open(fileName);
MVMap
<Integer
,
String
>
map = s.openMap("data");
for (int i = 0; i
<
400
;
i
++)
{
MVMap
<
Integer, String
>
map = s.openMap("data");
for (int i = 0; i
<
400; i++) {
map.put(i, "Hello");
}
s.commit();
for
(
int
i =
0;
i
<
100
;
i
++)
{
for (int i = 0; i
<
100; i++) {
map.put(0, "Hi");
}
s.commit();
...
...
@@ -522,7 +522,7 @@ will result in the following two chunks (excluding metadata):
</p>
<p>
That means each chunk contains the changes of one version:
the new version of the changed pages and the parent pages, recursively, up to the root page.
the new version of the changed pages and the parent pages, recursively, up to the root page.
Pages in subsequent chunks refer to pages in earlier chunks.
</p>
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
2705a8c5
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
2705a8c5
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
2705a8c5
差异被折叠。
点击展开。
h2/src/main/org/h2/api/Aggregate.java
浏览文件 @
2705a8c5
...
...
@@ -24,12 +24,12 @@ public interface Aggregate {
void
init
(
Connection
conn
)
throws
SQLException
;
/**
* This method must return the H2 data type, {@link org.h2.value.Value},
* of the aggregate function, given the H2 data type of the input data.
* This method must return the H2 data type, {@link org.h2.value.Value},
* of the aggregate function, given the H2 data type of the input data.
* The method should check here if the number of parameters
* passed is correct, and if not it should throw an exception.
*
* @param inputTypes the H2 data type of the parameters,
* @param inputTypes the H2 data type of the parameters,
* @return the H2 data type of the result
* @throws SQLException if the number/type of parameters passed is incorrect
*/
...
...
h2/src/main/org/h2/api/AggregateFunction.java
浏览文件 @
2705a8c5
...
...
@@ -16,6 +16,7 @@ import java.sql.SQLException;
* Please note this interface only has limited support for data types.
* If you need data types that don't have a corresponding SQL type
* (for example GEOMETRY), then use the {@link Aggregate} interface.
* </p>
*/
public
interface
AggregateFunction
{
...
...
h2/src/main/org/h2/bnf/Bnf.java
浏览文件 @
2705a8c5
...
...
@@ -137,10 +137,10 @@ public class Bnf {
rule
.
setLinks
(
ruleMap
);
rule
.
accept
(
visitor
);
}
/**
* Check whether the statement starts with a whitespace.
*
*
* @param s the statement
* @return if the statement is not empty and starts with a whitespace
*/
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
2705a8c5
...
...
@@ -530,7 +530,7 @@ public class Session extends SessionWithState {
throw
DbException
.
get
(
ErrorCode
.
COMMIT_ROLLBACK_NOT_ALLOWED
);
}
}
private
void
endTransaction
()
{
if
(
unlinkLobMap
!=
null
&&
unlinkLobMap
.
size
()
>
0
)
{
// need to flush the transaction log, because we can't unlink lobs if the
...
...
h2/src/main/org/h2/engine/UserAggregate.java
浏览文件 @
2705a8c5
...
...
@@ -91,7 +91,8 @@ public class UserAggregate extends DbObjectBase {
}
/**
* Wrap {@link AggregateFunction} in order to behave as {@link org.h2.api.Aggregate}
* Wrap {@link AggregateFunction} in order to behave as
* {@link org.h2.api.Aggregate}
**/
private
static
class
AggregateWrapper
implements
Aggregate
{
private
final
AggregateFunction
aggregateFunction
;
...
...
h2/src/main/org/h2/mvstore/MVMap.java
浏览文件 @
2705a8c5
...
...
@@ -982,6 +982,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
* Remove the given page (make the space available).
*
* @param pos the position of the page to remove
* @param memory the number of bytes used for this page
*/
protected
void
removePage
(
long
pos
,
int
memory
)
{
store
.
removePage
(
this
,
pos
,
memory
);
...
...
h2/src/main/org/h2/mvstore/MVStore.java
浏览文件 @
2705a8c5
...
...
@@ -49,8 +49,6 @@ TransactionStore:
MVStore:
- console auto-complete: only tab to complete; remove newlines before autocomplete?
- maybe change the length code to have lower gaps
- improve memory calculation for transient and cache
...
...
@@ -1617,7 +1615,7 @@ public class MVStore {
// to support reading old versions and rollback
if
(
pos
==
0
)
{
// the value could be smaller than 0 because
// in some cases a page is allocated,
// in some cases a page is allocated,
// but never stored
int
count
=
1
+
memory
/
pageSplitSize
;
unsavedPageCount
=
Math
.
max
(
0
,
unsavedPageCount
-
count
);
...
...
@@ -1806,7 +1804,7 @@ public class MVStore {
/**
* Increment the number of unsaved pages.
*
*
* @param memory the memory usage of the page
*/
void
registerUnsavedPage
(
int
memory
)
{
...
...
h2/src/main/org/h2/mvstore/MVStoreTool.java
浏览文件 @
2705a8c5
...
...
@@ -74,7 +74,7 @@ public class MVStoreTool {
block
.
rewind
();
int
headerType
=
block
.
get
();
if
(
headerType
==
'H'
)
{
pw
.
printf
(
"%0"
+
len
+
"x fileHeader %s%n"
,
pw
.
printf
(
"%0"
+
len
+
"x fileHeader %s%n"
,
pos
,
new
String
(
block
.
array
(),
DataUtils
.
LATIN
).
trim
());
pos
+=
blockSize
;
...
...
@@ -104,8 +104,8 @@ public class MVStoreTool {
boolean
compressed
=
(
type
&
2
)
!=
0
;
boolean
node
=
(
type
&
1
)
!=
0
;
pw
.
printf
(
"+%0"
+
len
+
"x %s, map %x, %d entries, %d bytes%n"
,
p
,
"+%0"
+
len
+
"x %s, map %x, %d entries, %d bytes%n"
,
p
,
(
node
?
"node"
:
"leaf"
)
+
(
compressed
?
" compressed"
:
""
),
mapId
,
...
...
@@ -129,7 +129,7 @@ public class MVStoreTool {
long
s
=
DataUtils
.
readVarLong
(
chunk
);
counts
[
i
]
=
s
;
}
}
}
if
(
mapId
==
0
)
{
for
(
int
i
=
0
;
i
<
entries
;
i
++)
{
String
k
=
StringDataType
.
INSTANCE
.
read
(
chunk
);
...
...
@@ -142,14 +142,14 @@ public class MVStoreTool {
pw
.
printf
(
" %d children < %s @ chunk %x +%0"
+
len
+
"x%n"
,
counts
[
i
],
keys
[
i
],
DataUtils
.
getPageChunkId
(
cp
),
DataUtils
.
getPageChunkId
(
cp
),
DataUtils
.
getPageOffset
(
cp
));
}
long
cp
=
children
[
entries
];
pw
.
printf
(
" %d children >= %s @ chunk %x +%0"
+
len
+
"x%n"
,
counts
[
entries
],
keys
[
entries
],
DataUtils
.
getPageChunkId
(
cp
),
DataUtils
.
getPageChunkId
(
cp
),
DataUtils
.
getPageOffset
(
cp
));
}
else
{
// meta map leaf
...
...
@@ -168,18 +168,18 @@ public class MVStoreTool {
long
cp
=
children
[
i
];
pw
.
printf
(
" %d children @ chunk %x +%0"
+
len
+
"x%n"
,
counts
[
i
],
DataUtils
.
getPageChunkId
(
cp
),
DataUtils
.
getPageChunkId
(
cp
),
DataUtils
.
getPageOffset
(
cp
));
}
}
}
}
}
int
footerPos
=
chunk
.
limit
()
-
Chunk
.
FOOTER_LENGTH
;
chunk
.
position
(
footerPos
);
pw
.
printf
(
"+%0"
+
len
+
"x chunkFooter %s%n"
,
footerPos
,
new
String
(
chunk
.
array
(),
chunk
.
position
(),
"+%0"
+
len
+
"x chunkFooter %s%n"
,
footerPos
,
new
String
(
chunk
.
array
(),
chunk
.
position
(),
Chunk
.
FOOTER_LENGTH
,
DataUtils
.
LATIN
).
trim
());
}
pw
.
printf
(
"%n%0"
+
len
+
"x eof%n"
,
fileSize
);
...
...
h2/src/main/org/h2/store/LobStorageMap.java
浏览文件 @
2705a8c5
...
...
@@ -96,12 +96,6 @@ public class LobStorageMap implements LobStorageInterface {
dataMap
=
mvStore
.
openMap
(
"lobData"
,
new
MVMapConcurrent
.
Builder
<
Long
,
byte
[]>());
streamStore
=
new
StreamStore
(
dataMap
);
;;
int
todo
;
// test and then remove
// TODO currently needed to avoid out of memory,
// because memory usage is only measure in number of pages currently
// streamStore.setMaxBlockSize(32 * 1024);
}
@Override
...
...
h2/src/main/org/h2/tools/Shell.java
浏览文件 @
2705a8c5
...
...
@@ -163,7 +163,7 @@ public class Shell extends Tool implements Runnable {
}
}
}
/**
* Run the shell tool with the given connection and command line settings.
* The connection will be closed when the shell exits.
...
...
@@ -171,6 +171,7 @@ public class Shell extends Tool implements Runnable {
* <p>
* Note: using the "-url" option in {@code args} doesn't make much sense
* since it will override the {@code conn} parameter.
* </p>
*
* @param conn the connection
* @param args the command line settings
...
...
h2/src/test/org/h2/test/db/TestLob.java
浏览文件 @
2705a8c5
...
...
@@ -111,7 +111,7 @@ public class TestLob extends TestBase {
deleteDb
(
"lob"
);
FileUtils
.
deleteRecursive
(
TEMP_DIR
,
true
);
}
private
void
testCleaningUpLobsOnRollback
()
throws
Exception
{
if
(
config
.
mvStore
)
{
return
;
...
...
@@ -132,7 +132,7 @@ public class TestLob extends TestBase {
assertEquals
(
0
,
rs
.
getInt
(
1
));
conn
.
close
();
}
private
void
testReadManyLobs
()
throws
Exception
{
deleteDb
(
"lob"
);
Connection
conn
;
...
...
h2/src/test/org/h2/test/db/TestSpatial.java
浏览文件 @
2705a8c5
...
...
@@ -645,8 +645,8 @@ public class TestSpatial extends TestBase {
rs
.
addRow
(
factory
.
createPoint
(
new
Coordinate
(
x
,
y
)));
return
rs
;
}
p
ublic
void
testAggregateWithGeometry
()
throws
SQLException
{
p
rivate
void
testAggregateWithGeometry
()
throws
SQLException
{
deleteDb
(
"spatialIndex"
);
Connection
conn
=
getConnection
(
"spatialIndex"
);
try
{
...
...
@@ -681,7 +681,7 @@ public class TestSpatial extends TestBase {
}
return
Value
.
GEOMETRY
;
}
@Override
public
void
init
(
Connection
conn
)
throws
SQLException
{
tableEnvelope
=
null
;
...
...
@@ -702,6 +702,6 @@ public class TestSpatial extends TestBase {
public
Object
getResult
()
throws
SQLException
{
return
new
GeometryFactory
().
toGeometry
(
tableEnvelope
);
}
}
}
}
h2/src/test/org/h2/test/store/TestMVStore.java
浏览文件 @
2705a8c5
...
...
@@ -102,7 +102,7 @@ public class TestMVStore extends TestBase {
// longer running tests
testLargerThan2G
();
}
private
void
testFileFormatExample
()
{
String
fileName
=
getBaseDir
()
+
"/testFileFormatExample.h3"
;
MVStore
s
=
MVStore
.
open
(
fileName
);
...
...
h2/src/test/org/h2/test/store/TestStreamStore.java
浏览文件 @
2705a8c5
...
...
@@ -53,7 +53,7 @@ public class TestStreamStore extends TestBase {
testWithFullMap
();
testLoop
();
}
private
void
testSaveCount
()
throws
IOException
{
String
fileName
=
getBaseDir
()
+
"/testSaveCount.h3"
;
FileUtils
.
delete
(
fileName
);
...
...
h2/src/test/org/h2/test/utils/FilePathUnstable.java
浏览文件 @
2705a8c5
...
...
@@ -299,7 +299,7 @@ class FileUnstable extends FileBase {
public
synchronized
FileLock
tryLock
(
long
position
,
long
size
,
boolean
shared
)
throws
IOException
{
return
channel
.
tryLock
(
position
,
size
,
shared
);
}
@Override
public
String
toString
()
{
return
"unstable:"
+
file
.
toString
();
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
2705a8c5
...
...
@@ -752,4 +752,4 @@ maginatics jdbclint lint lsm unmappable adams douglas definer invoker
fmrn fmxxx fmday fml syyyy tzd nov iyy iyyy fmc fmb fmxx tzr btc yyfxyy scc syear
overwrote though randomize readability datagram rsync mongodb divides crypto
predicted prediction wojtek hops jurczyk cbtree predict vast assumption upside
adjusted lastly sgtatham
adjusted lastly sgtatham
cleaning gillet prevented
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论