Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
5cec4af7
提交
5cec4af7
authored
1月 29, 2013
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Copyright update.
上级
dd004998
全部展开
显示空白字符变更
内嵌
并排
正在显示
35 个修改的文件
包含
353 行增加
和
288 行删除
+353
-288
mvstore.html
h2/src/docsrc/html/mvstore.html
+34
-31
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+97
-73
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+97
-73
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+81
-73
ChangeCursor.java
h2/src/main/org/h2/mvstore/ChangeCursor.java
+1
-1
Chunk.java
h2/src/main/org/h2/mvstore/Chunk.java
+1
-1
Cursor.java
h2/src/main/org/h2/mvstore/Cursor.java
+1
-1
CursorPos.java
h2/src/main/org/h2/mvstore/CursorPos.java
+1
-1
DataUtils.java
h2/src/main/org/h2/mvstore/DataUtils.java
+1
-1
MVMap.java
h2/src/main/org/h2/mvstore/MVMap.java
+1
-1
MVMapConcurrent.java
h2/src/main/org/h2/mvstore/MVMapConcurrent.java
+1
-1
MVStore.java
h2/src/main/org/h2/mvstore/MVStore.java
+12
-5
MVStoreTool.java
h2/src/main/org/h2/mvstore/MVStoreTool.java
+1
-1
Page.java
h2/src/main/org/h2/mvstore/Page.java
+1
-1
StreamStore.java
h2/src/main/org/h2/mvstore/StreamStore.java
+1
-1
CacheLongKeyLIRS.java
h2/src/main/org/h2/mvstore/cache/CacheLongKeyLIRS.java
+1
-1
FilePathCache.java
h2/src/main/org/h2/mvstore/cache/FilePathCache.java
+1
-1
package.html
h2/src/main/org/h2/mvstore/cache/package.html
+1
-1
MVDelegateIndex.java
h2/src/main/org/h2/mvstore/db/MVDelegateIndex.java
+1
-1
MVPrimaryIndex.java
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
+1
-1
MVSecondaryIndex.java
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
+1
-1
MVTable.java
h2/src/main/org/h2/mvstore/db/MVTable.java
+1
-1
MVTableEngine.java
h2/src/main/org/h2/mvstore/db/MVTableEngine.java
+1
-1
ValueArrayDataType.java
h2/src/main/org/h2/mvstore/db/ValueArrayDataType.java
+1
-1
package.html
h2/src/main/org/h2/mvstore/db/package.html
+1
-1
package.html
h2/src/main/org/h2/mvstore/package.html
+1
-1
MVRTreeMap.java
h2/src/main/org/h2/mvstore/rtree/MVRTreeMap.java
+1
-1
SpatialDataType.java
h2/src/main/org/h2/mvstore/rtree/SpatialDataType.java
+1
-1
SpatialKey.java
h2/src/main/org/h2/mvstore/rtree/SpatialKey.java
+1
-1
package.html
h2/src/main/org/h2/mvstore/rtree/package.html
+1
-1
DataType.java
h2/src/main/org/h2/mvstore/type/DataType.java
+1
-1
ObjectDataType.java
h2/src/main/org/h2/mvstore/type/ObjectDataType.java
+1
-1
StringDataType.java
h2/src/main/org/h2/mvstore/type/StringDataType.java
+1
-1
package.html
h2/src/main/org/h2/mvstore/type/package.html
+1
-1
TestMVStore.java
h2/src/test/org/h2/test/store/TestMVStore.java
+3
-4
没有找到文件。
h2/src/docsrc/html/mvstore.html
浏览文件 @
5cec4af7
...
@@ -20,6 +20,12 @@ MVStore
...
@@ -20,6 +20,12 @@ MVStore
Overview
</a><br
/>
Overview
</a><br
/>
<a
href=
"#example_code"
>
<a
href=
"#example_code"
>
Example Code
</a><br
/>
Example Code
</a><br
/>
<a
href=
"#store_builder"
>
Store Builder
</a><br
/>
<a
href=
"#r_tree"
>
R-Tree
</a><br
/>
<a
href=
"#features"
>
<a
href=
"#features"
>
Features
</a><br
/>
Features
</a><br
/>
<a
href=
"#differences"
>
<a
href=
"#differences"
>
...
@@ -47,7 +53,6 @@ and a file system abstraction to support encrypted files and zip files.
...
@@ -47,7 +53,6 @@ and a file system abstraction to support encrypted files and zip files.
</li></ul>
</li></ul>
<h2
id=
"example_code"
>
Example Code
</h2>
<h2
id=
"example_code"
>
Example Code
</h2>
<h3>
Map Operations and Versioning
</h3>
<p>
<p>
The following sample code show how to create a store,
The following sample code show how to create a store,
open a map, add some data, and access the current and an old version:
open a map, add some data, and access the current and an old version:
...
@@ -81,8 +86,8 @@ map.remove(2);
...
@@ -81,8 +86,8 @@ map.remove(2);
MVMap
<
Integer, String
>
oldMap =
MVMap
<
Integer, String
>
oldMap =
map.openVersion(oldVersion);
map.openVersion(oldVersion);
//
store the newest data to disk
//
mark the changes as committed
s.
store
();
s.
commit
();
// print the old version (can be done
// print the old version (can be done
// concurrently with further modifications)
// concurrently with further modifications)
...
@@ -98,7 +103,7 @@ System.out.println(map.get(1));
...
@@ -98,7 +103,7 @@ System.out.println(map.get(1));
s.close();
s.close();
</pre>
</pre>
<h
3>
Store Builder
</h3
>
<h
2
id=
"store_builder"
>
Store Builder
</h2
>
<p>
<p>
The
<code>
MVStore.Builder
</code>
provides a fluid interface
The
<code>
MVStore.Builder
</code>
provides a fluid interface
to build a store if more complex configuration options are used.
to build a store if more complex configuration options are used.
...
@@ -125,7 +130,7 @@ MVStore s = new MVStore.Builder().
...
@@ -125,7 +130,7 @@ MVStore s = new MVStore.Builder().
changes are stored (unless stored explicitly).
changes are stored (unless stored explicitly).
</li></ul>
</li></ul>
<h
3>
R-Tree
</h3
>
<h
2
id=
"r_tree"
>
R-Tree
</h2
>
<p>
<p>
The
<code>
MVRTreeMap
</code>
is an R-tree implementation
The
<code>
MVRTreeMap
</code>
is an R-tree implementation
that supports fast spatial queries. It can be used as follows:
that supports fast spatial queries. It can be used as follows:
...
@@ -155,7 +160,7 @@ s.close();
...
@@ -155,7 +160,7 @@ s.close();
</pre>
</pre>
<p>
<p>
The default number of dimensions is 2. To use a different number of dimensions,
The default number of dimensions is 2. To use a different number of dimensions,
use
<code>
new MVRTreeMap.Builder
<
String
>
().dimensions(3)
</code>
.
call
<code>
new MVRTreeMap.Builder
<
String
>
().dimensions(3)
</code>
.
The minimum number of dimensions is 1, the maximum is 255.
The minimum number of dimensions is 1, the maximum is 255.
</p>
</p>
...
@@ -167,11 +172,11 @@ Each store supports a set of named maps.
...
@@ -167,11 +172,11 @@ Each store supports a set of named maps.
A map is sorted by key, and supports the common lookup operations,
A map is sorted by key, and supports the common lookup operations,
including access to the first and last key, iterate over some or all keys, and so on.
including access to the first and last key, iterate over some or all keys, and so on.
</p><p>
</p><p>
Also supported, and very uncommon for maps, is fast index lookup
.
Also supported, and very uncommon for maps, is fast index lookup
:
T
he keys of the map can be accessed like a list
t
he keys of the map can be accessed like a list
(get the key at the given index, get the index of a certain key).
(get the key at the given index, get the index of a certain key).
That means getting the median of two keys is trivial,
That means getting the median of two keys is trivial,
and
it allows to very quickly count ranges
.
and
range of keys can be counted very quickly
.
The iterator supports fast skipping.
The iterator supports fast skipping.
This is possible because internally, each map is organized in the form of a counted B+-tree.
This is possible because internally, each map is organized in the form of a counted B+-tree.
</p><p>
</p><p>
...
@@ -193,7 +198,7 @@ so that it can still be read.
...
@@ -193,7 +198,7 @@ so that it can still be read.
</p><p>
</p><p>
Old persisted versions are readable until the old data was explicitly overwritten.
Old persisted versions are readable until the old data was explicitly overwritten.
Creating a snapshot is fast: only the pages that are changed after a snapshot are copied.
Creating a snapshot is fast: only the pages that are changed after a snapshot are copied.
This behavior also called COW (copy on write).
This behavior
is
also called COW (copy on write).
</p><p>
</p><p>
Rollback is supported (rollback to any old in-memory version or an old persisted version).
Rollback is supported (rollback to any old in-memory version or an old persisted version).
</p>
</p>
...
@@ -220,8 +225,7 @@ performance characteristics) until data is persisted.
...
@@ -220,8 +225,7 @@ performance characteristics) until data is persisted.
Serialization is pluggable. The default serialization currently supports many common data types,
Serialization is pluggable. The default serialization currently supports many common data types,
and uses Java serialization for other objects. The following classes are currently directly supported:
and uses Java serialization for other objects. The following classes are currently directly supported:
<code>
Boolean, Byte, Short, Character, Integer, Long, Float, Double, BigInteger, BigDecimal,
<code>
Boolean, Byte, Short, Character, Integer, Long, Float, Double, BigInteger, BigDecimal,
byte[], char[], int[], long[], String, UUID
</code>
.
String, UUID, Date
</code>
and arrays (both primitive arrays and object arrays).
The plan is to add more common classes (date, time, timestamp, object array).
</p><p>
</p><p>
Parameterized data types are supported
Parameterized data types are supported
(for example one could build a string data type that limits the length for some reason).
(for example one could build a string data type that limits the length for some reason).
...
@@ -243,7 +247,7 @@ This tool is written on top of the store (only using the map interface).
...
@@ -243,7 +247,7 @@ This tool is written on top of the store (only using the map interface).
<h3>
R-Tree and Pluggable Map Implementations
</h3>
<h3>
R-Tree and Pluggable Map Implementations
</h3>
<p>
<p>
The map implementation is pluggable.
The map implementation is pluggable.
In addition to the default
MVMap
(multi-version map),
In addition to the default
<code>
MVMap
</code>
(multi-version map),
there is a multi-version R-tree map implementation
there is a multi-version R-tree map implementation
for spatial operations (contain and intersection; nearest neighbor is not yet implemented).
for spatial operations (contain and intersection; nearest neighbor is not yet implemented).
</p>
</p>
...
@@ -254,8 +258,7 @@ The default map implementation supports concurrent reads on old versions of the
...
@@ -254,8 +258,7 @@ The default map implementation supports concurrent reads on old versions of the
All such read operations can occur in parallel. Concurrent reads from the page cache,
All such read operations can occur in parallel. Concurrent reads from the page cache,
as well as concurrent reads from the file system are supported.
as well as concurrent reads from the file system are supported.
</p><p>
</p><p>
Storing changes can occur concurrently to modifying the data,
Storing changes can occur concurrently to modifying the data, as it operates on a snapshot.
as
<code>
store()
</code>
operates on a snapshot.
</p><p>
</p><p>
Caching is done on the page level.
Caching is done on the page level.
The page cache is a concurrent LIRS cache, which should be resistant against scan operations.
The page cache is a concurrent LIRS cache, which should be resistant against scan operations.
...
@@ -279,14 +282,16 @@ The plan is to add such a mechanism later when needed.
...
@@ -279,14 +282,16 @@ The plan is to add such a mechanism later when needed.
<h3>
Log Structured Storage
</h3>
<h3>
Log Structured Storage
</h3>
<p>
<p>
Currently,
<code>
store()
</code>
needs to be called explicitly to save changes.
Changes are buffered in memory, and once enough changes have accumulated,
Changes are buffered in memory, and once enough changes have accumulated
they are written in one continuous disk write operation.
(for example 2 MB), all changes are written in one continuous disk write operation.
(According to a test, write throughput of a common SSD gets higher the larger the block size,
(According to a test, write throughput of a common SSD gets higher the larger the block size,
until a block size of 2 MB, and then does not further increase.)
until a block size of 2 MB, and then does not further increase.)
But of course, if needed, changes can also be persisted if only little data was changed.
By default, committed changes are automatically written once every second
The estimated amount of unsaved changes is tracked.
in a background thread, even if only little data was changed.
The plan is to automatically store in a background thread once there are enough changes.
Changes can also be written explicitly by calling
<code>
store()
</code>
.
To avoid out of memory, uncommitted changes are also written when needed,
however they are rolled back when closing the store,
or at the latest (when the store was not correctly closed) when opening the store.
</p><p>
</p><p>
When storing, all changed pages are serialized,
When storing, all changed pages are serialized,
optionally compressed using the LZF algorithm,
optionally compressed using the LZF algorithm,
...
@@ -296,17 +301,15 @@ All parent pages of the changed B-trees are stored in this chunk as well,
...
@@ -296,17 +301,15 @@ All parent pages of the changed B-trees are stored in this chunk as well,
so that each chunk also contains the root of each changed map
so that each chunk also contains the root of each changed map
(which is the entry point to read this version of the data).
(which is the entry point to read this version of the data).
There is no separate index: all data is stored as a list of pages.
There is no separate index: all data is stored as a list of pages.
Per store, the is one additional map that contains the metadata (the list of
Per store, the
re
is one additional map that contains the metadata (the list of
maps, where the root page of each map is stored, and the list of chunks).
maps, where the root page of each map is stored, and the list of chunks).
</p><p>
</p><p>
There are usually two write operations per chunk:
There are usually two write operations per chunk:
one to store the chunk data (the pages), and one to update the file header (so it points to the latest chunk).
one to store the chunk data (the pages), and one to update the file header (so it points to the latest chunk).
If the chunk is appended at the end of the file, the file header is only written at the end of the chunk.
If the chunk is appended at the end of the file, the file header is only written at the end of the chunk.
</p><p>
</p><p>
There is currently no transaction log, no undo log,
There is no transaction log, no undo log,
and there are no in-place updates (however unused chunks are overwritten).
and there are no in-place updates (however unused chunks are overwritten by default).
To save space when persisting very small transactions, the plan is to use a transaction log
where only the deltas are stored, until enough changes have accumulated to persist a chunk.
</p><p>
</p><p>
Old data is kept for at least 45 seconds (configurable),
Old data is kept for at least 45 seconds (configurable),
so that there are no explicit sync operations required to guarantee data consistency,
so that there are no explicit sync operations required to guarantee data consistency,
...
@@ -315,7 +318,7 @@ To reuse disk space, the chunks with the lowest amount of live data are compacte
...
@@ -315,7 +318,7 @@ To reuse disk space, the chunks with the lowest amount of live data are compacte
(the live data is simply stored again in the next chunk).
(the live data is simply stored again in the next chunk).
To improve data locality and disk space usage, the plan is to automatically defragment and compact data.
To improve data locality and disk space usage, the plan is to automatically defragment and compact data.
</p><p>
</p><p>
Compared to
regular databas
es (that use a transaction log, undo log, and main storage area),
Compared to
traditional storage engin
es (that use a transaction log, undo log, and main storage area),
the log structured storage is simpler, more flexible, and typically needs less disk operations per change,
the log structured storage is simpler, more flexible, and typically needs less disk operations per change,
as data is only written once instead of twice or 3 times, and because the B-tree pages are
as data is only written once instead of twice or 3 times, and because the B-tree pages are
always full (they are stored next to each other) and can be easily compressed.
always full (they are stored next to each other) and can be easily compressed.
...
@@ -326,8 +329,8 @@ as disk space is not immediately re-used (there are no in-place updates).
...
@@ -326,8 +329,8 @@ as disk space is not immediately re-used (there are no in-place updates).
<h3>
File System Abstraction, File Locking and Online Backup
</h3>
<h3>
File System Abstraction, File Locking and Online Backup
</h3>
<p>
<p>
The file system is pluggable (the same file system abstraction is used as H2 uses).
The file system is pluggable (the same file system abstraction is used as H2 uses).
Support for encryption is plann
ed using an encrypting file system.
The file can be encrypt
ed using an encrypting file system.
Other file system implementations support reading from a compressed zip or
t
ar file.
Other file system implementations support reading from a compressed zip or
j
ar file.
</p>
</p>
<p>
<p>
Each store may only be opened once within a JVM.
Each store may only be opened once within a JVM.
...
@@ -418,8 +421,8 @@ The MVStore does not have a record size limit.
...
@@ -418,8 +421,8 @@ The MVStore does not have a record size limit.
<h2
id=
"current_state"
>
Current State
</h2>
<h2
id=
"current_state"
>
Current State
</h2>
<p>
<p>
The code is still
very
experimental at this stage.
The code is still experimental at this stage.
The API as well as the behavior
will probab
ly change.
The API as well as the behavior
may partial
ly change.
Features may be added and removed (even thought the main features will stay).
Features may be added and removed (even thought the main features will stay).
</p>
</p>
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
5cec4af7
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
5cec4af7
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
5cec4af7
差异被折叠。
点击展开。
h2/src/main/org/h2/mvstore/ChangeCursor.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/Chunk.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/Cursor.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/CursorPos.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/DataUtils.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/MVMap.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/MVMapConcurrent.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/MVStore.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
@@ -43,6 +43,8 @@ H:3,...
...
@@ -43,6 +43,8 @@ H:3,...
TODO:
TODO:
- rolling docs review: at convert "Features" to top-level (linked) entries
- background thread: async store when the write buffer is almost full
- test new write / read algorithm for speed and errors
- test new write / read algorithm for speed and errors
- detect concurrent writes / reads in the MVMap
- detect concurrent writes / reads in the MVMap
- maybe rename store to write
- maybe rename store to write
...
@@ -51,7 +53,6 @@ TODO:
...
@@ -51,7 +53,6 @@ TODO:
- store() should probably be store(false), and maybe rename to write
- store() should probably be store(false), and maybe rename to write
- move setters to the builder, except for setRetainVersion, setReuseSpace,
- move setters to the builder, except for setRetainVersion, setReuseSpace,
and settings that are persistent (setStoreVersion)
and settings that are persistent (setStoreVersion)
- update copyright
- test meta table rollback: it is changed after save; could rollback break it?
- test meta table rollback: it is changed after save; could rollback break it?
- automated 'kill process' and 'power failure' test
- automated 'kill process' and 'power failure' test
- mvcc with multiple transactions
- mvcc with multiple transactions
...
@@ -96,6 +97,8 @@ TODO:
...
@@ -96,6 +97,8 @@ TODO:
- support pluggable logging or remove log
- support pluggable logging or remove log
- maybe add an optional finalizer and exit hook
- maybe add an optional finalizer and exit hook
to store committed changes
to store committed changes
- to save space when persisting very small transactions,
-- use a transaction log where only the deltas are stored
*/
*/
...
@@ -1780,9 +1783,13 @@ public class MVStore {
...
@@ -1780,9 +1783,13 @@ public class MVStore {
}
}
/**
/**
* Compress data before writing using the LZF algorithm. This setting only
* Compress data before writing using the LZF algorithm. This will save
* affects writes; it is not necessary to enable compression when reading,
* about 50% of the disk space, but will slow down read and write
* even if compression was enabled when writing.
* operations slightly.
* <p>
* This setting only affects writes; it is not necessary to enable
* compression when reading, even if compression was enabled when
* writing.
*
*
* @return this
* @return this
*/
*/
...
...
h2/src/main/org/h2/mvstore/MVStoreTool.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/Page.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/StreamStore.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/cache/CacheLongKeyLIRS.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/cache/FilePathCache.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/cache/package.html
浏览文件 @
5cec4af7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
<!--
Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/db/MVDelegateIndex.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/db/MVTable.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/db/MVTableEngine.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/db/ValueArrayDataType.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/db/package.html
浏览文件 @
5cec4af7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
<!--
Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/package.html
浏览文件 @
5cec4af7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
<!--
Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/rtree/MVRTreeMap.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/rtree/SpatialDataType.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/rtree/SpatialKey.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/rtree/package.html
浏览文件 @
5cec4af7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
<!--
Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/type/DataType.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/type/ObjectDataType.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/type/StringDataType.java
浏览文件 @
5cec4af7
/*
/*
* Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License,
* Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
...
...
h2/src/main/org/h2/mvstore/type/package.html
浏览文件 @
5cec4af7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
<!--
Copyright 2004-201
1
H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
Copyright 2004-201
3
H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
Initial Developer: H2 Group
...
...
h2/src/test/org/h2/test/store/TestMVStore.java
浏览文件 @
5cec4af7
...
@@ -88,8 +88,7 @@ public class TestMVStore extends TestBase {
...
@@ -88,8 +88,7 @@ public class TestMVStore extends TestBase {
long
lastSize
=
0
;
long
lastSize
=
0
;
int
len
=
1000
;
int
len
=
1000
;
for
(
int
bs
=
0
;
bs
<=
1
;
bs
++)
{
for
(
int
bs
=
0
;
bs
<=
1
;
bs
++)
{
int
tes
;
s
=
new
MVStore
.
Builder
().
s
=
new
MVStore
.
Builder
().
compressData
().
writeBufferSize
(
1
).
writeDelay
(
10
).
fileName
(
fileName
).
fileName
(
fileName
).
writeBufferSize
(
bs
).
writeBufferSize
(
bs
).
open
();
open
();
...
@@ -625,8 +624,8 @@ public class TestMVStore extends TestBase {
...
@@ -625,8 +624,8 @@ public class TestMVStore extends TestBase {
MVMap
<
Integer
,
String
>
oldMap
=
MVMap
<
Integer
,
String
>
oldMap
=
map
.
openVersion
(
oldVersion
);
map
.
openVersion
(
oldVersion
);
//
store the newest data to disk
//
mark the changes as committed
s
.
store
();
s
.
commit
();
// print the old version (can be done
// print the old version (can be done
// concurrently with further modifications)
// concurrently with further modifications)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论