Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
48f24252
提交
48f24252
authored
11月 20, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
The emergency reserve file has been removed.
上级
0cc8c7bf
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
19 行增加
和
49 行删除
+19
-49
changelog.html
h2/src/docsrc/html/changelog.html
+6
-1
DatabaseEventListener.java
h2/src/main/org/h2/api/DatabaseEventListener.java
+1
-0
ScriptBase.java
h2/src/main/org/h2/command/dml/ScriptBase.java
+1
-1
SysProperties.java
h2/src/main/org/h2/constant/SysProperties.java
+0
-12
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-25
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+3
-1
WebThread.java
h2/src/main/org/h2/server/web/WebThread.java
+3
-3
MetaTable.java
h2/src/main/org/h2/table/MetaTable.java
+0
-2
ShowProgress.java
h2/src/test/org/h2/samples/ShowProgress.java
+1
-1
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+2
-2
TestListener.java
h2/src/test/org/h2/test/db/TestListener.java
+1
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
48f24252
...
...
@@ -18,7 +18,12 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Build: JAVA_HOME is now automatically detected on Mac OS X.
<ul><li>
The emergency reserve file has been removed. It didn't provide an appropriate
solution for the problem. It is still possible for an application to detect and deal with
the low disk space problem (deleting temporary files for example)
using DatabaseEventListener.diskSpaceIsLow, but this method is now always called
with stillAvailable=0.
</li><li>
Build: JAVA_HOME is now automatically detected on Mac OS X.
</li><li>
Testing for local connections was very slow on some systems.
</li><li>
The cache memory usage calculation is more conservative.
</li><li>
Allocating space got slower and slower the larger the database.
...
...
h2/src/main/org/h2/api/DatabaseEventListener.java
浏览文件 @
48f24252
...
...
@@ -68,6 +68,7 @@ public interface DatabaseEventListener extends EventListener {
* within this method (even to close it).
*
* @param stillAvailable the estimated space that is still available, in bytes
* (if known)
* @throws SQLException if the operation should be canceled
*/
void
diskSpaceIsLow
(
long
stillAvailable
)
throws
SQLException
;
...
...
h2/src/main/org/h2/command/dml/ScriptBase.java
浏览文件 @
48f24252
...
...
@@ -206,7 +206,7 @@ public abstract class ScriptBase extends Prepared implements DataHandler {
}
public
void
freeUpDiskSpace
()
throws
SQLException
{
session
.
getDatabase
().
checkWritingAllowed
();
session
.
getDatabase
().
freeUpDiskSpace
();
}
public
void
handleInvalidChecksum
()
throws
SQLException
{
...
...
h2/src/main/org/h2/constant/SysProperties.java
浏览文件 @
48f24252
...
...
@@ -215,18 +215,6 @@ public class SysProperties {
*/
public
static
final
boolean
DOLLAR_QUOTING
=
getBooleanSetting
(
"h2.dollarQuoting"
,
true
);
/**
* System property <code>h2.emergencySpaceInitial</code> (default: 262144).<br />
* Size of 'reserve' file to detect disk full problems early.
*/
public
static
final
int
EMERGENCY_SPACE_INITIAL
=
getIntSetting
(
"h2.emergencySpaceInitial"
,
256
*
1024
);
/**
* System property <code>h2.emergencySpaceMin</code> (default: 65536).<br />
* Minimum size of 'reserve' file.
*/
public
static
final
int
EMERGENCY_SPACE_MIN
=
getIntSetting
(
"h2.emergencySpaceMin"
,
64
*
1024
);
/**
* System property <code>h2.largeResultBufferSize</code> (default: 4096).<br />
* Buffer size for large result sets. Set this value to 0 to disable the buffer.
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
48f24252
...
...
@@ -130,7 +130,6 @@ public class Database implements DataHandler {
private
boolean
noDiskSpace
;
private
int
writeDelay
=
Constants
.
DEFAULT_WRITE_DELAY
;
private
DatabaseEventListener
eventListener
;
private
FileStore
emergencyReserve
;
private
int
maxMemoryRows
=
Constants
.
DEFAULT_MAX_MEMORY_ROWS
;
private
int
maxMemoryUndo
=
SysProperties
.
DEFAULT_MAX_MEMORY_UNDO
;
private
int
lockMode
=
SysProperties
.
DEFAULT_LOCK_MODE
;
...
...
@@ -406,10 +405,6 @@ public class Database implements DataHandler {
lock
.
unlock
();
lock
=
null
;
}
if
(
emergencyReserve
!=
null
)
{
emergencyReserve
.
closeAndDeleteSilently
();
emergencyReserve
=
null
;
}
}
catch
(
Exception
e
)
{
TraceSystem
.
traceThrowable
(
e
);
}
...
...
@@ -618,11 +613,6 @@ public class Database implements DataHandler {
removeUnusedStorages
(
systemSession
);
}
systemSession
.
commit
(
true
);
if
(!
readOnly
&&
persistent
)
{
emergencyReserve
=
openFile
(
createTempFile
(),
"rw"
,
false
);
emergencyReserve
.
setLength
(
SysProperties
.
EMERGENCY_SPACE_INITIAL
);
emergencyReserve
.
autoDelete
();
}
traceSystem
.
getTrace
(
Trace
.
DATABASE
).
info
(
"opened "
+
databaseName
);
}
...
...
@@ -1453,10 +1443,6 @@ public class Database implements DataHandler {
}
private
void
deleteOldTempFiles
()
throws
SQLException
{
if
(
emergencyReserve
!=
null
)
{
emergencyReserve
.
closeAndDeleteSilently
();
emergencyReserve
=
null
;
}
String
path
=
FileUtils
.
getParent
(
databaseName
);
String
prefix
=
FileUtils
.
normalize
(
databaseName
);
String
[]
list
=
FileUtils
.
listFiles
(
path
);
...
...
@@ -1742,18 +1728,8 @@ public class Database implements DataHandler {
}
public
synchronized
void
freeUpDiskSpace
()
throws
SQLException
{
long
sizeAvailable
=
0
;
if
(
emergencyReserve
!=
null
)
{
sizeAvailable
=
emergencyReserve
.
length
();
long
newLength
=
sizeAvailable
/
4
;
if
(
newLength
<
SysProperties
.
EMERGENCY_SPACE_MIN
)
{
newLength
=
0
;
noDiskSpace
=
true
;
}
emergencyReserve
.
setLength
(
newLength
);
}
if
(
eventListener
!=
null
)
{
eventListener
.
diskSpaceIsLow
(
sizeAvailable
);
eventListener
.
diskSpaceIsLow
(
0
);
}
}
...
...
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
48f24252
...
...
@@ -53,6 +53,7 @@ implements Trigger, CloseListener
{
//## Java 1.4 begin ##
private
static
final
boolean
STORE_DOCUMENT_TEXT_IN_INDEX
=
Boolean
.
getBoolean
(
"h2.storeDocumentTextInIndex"
);
private
static
HashMap
indexers
=
new
HashMap
();
private
static
final
String
FIELD_DATA
=
"DATA"
;
private
static
final
String
FIELD_QUERY
=
"QUERY"
;
...
...
@@ -471,7 +472,8 @@ implements Trigger, CloseListener
}
allData
.
append
(
data
);
}
doc
.
add
(
new
Field
(
FIELD_DATA
,
allData
.
toString
(),
Field
.
Store
.
NO
,
Field
.
Index
.
TOKENIZED
));
Field
.
Store
storeText
=
STORE_DOCUMENT_TEXT_IN_INDEX
?
Field
.
Store
.
YES
:
Field
.
Store
.
NO
;
doc
.
add
(
new
Field
(
FIELD_DATA
,
allData
.
toString
(),
storeText
,
Field
.
Index
.
TOKENIZED
));
try
{
indexer
.
addDocument
(
doc
);
}
catch
(
IOException
e
)
{
...
...
h2/src/main/org/h2/server/web/WebThread.java
浏览文件 @
48f24252
...
...
@@ -1114,7 +1114,7 @@ class WebThread extends Thread implements DatabaseEventListener {
}
public
void
diskSpaceIsLow
(
long
stillAvailable
)
{
log
(
"
Disk space is low; still available: "
+
stillAvailable
);
log
(
"
No more disk space is available"
);
}
public
void
exceptionThrown
(
SQLException
e
,
String
sql
)
{
...
...
@@ -2147,7 +2147,7 @@ class WebThread extends Thread implements DatabaseEventListener {
}
public
void
diskSpaceIsLow
(
long
stillAvailable
)
{
trace
(
"
Disk space is low; still available: "
+
stillAvailable
);
trace
(
"
No more disk space is available"
);
}
public
void
exceptionThrown
(
SQLException
e
,
String
sql
)
{
...
...
h2/src/main/org/h2/table/MetaTable.java
浏览文件 @
48f24252
...
...
@@ -827,8 +827,6 @@ public class MetaTable extends Table {
add
(
rows
,
new
String
[]{
"h2.clientTraceDirectory"
,
SysProperties
.
CLIENT_TRACE_DIRECTORY
});
add
(
rows
,
new
String
[]{
SysProperties
.
H2_COLLATOR_CACHE_SIZE
,
""
+
SysProperties
.
getCollatorCacheSize
()});
add
(
rows
,
new
String
[]{
"h2.defaultMaxMemoryUndo"
,
""
+
SysProperties
.
DEFAULT_MAX_MEMORY_UNDO
});
add
(
rows
,
new
String
[]{
"h2.emergencySpaceInitial"
,
""
+
SysProperties
.
EMERGENCY_SPACE_INITIAL
});
add
(
rows
,
new
String
[]{
"h2.emergencySpaceMin"
,
""
+
SysProperties
.
EMERGENCY_SPACE_MIN
});
add
(
rows
,
new
String
[]{
"h2.lobFilesInDirectories"
,
""
+
SysProperties
.
LOB_FILES_IN_DIRECTORIES
});
add
(
rows
,
new
String
[]{
"h2.lobFilesPerDirectory"
,
""
+
SysProperties
.
LOB_FILES_PER_DIRECTORY
});
add
(
rows
,
new
String
[]{
"h2.logAllErrors"
,
""
+
SysProperties
.
LOG_ALL_ERRORS
});
...
...
h2/src/test/org/h2/samples/ShowProgress.java
浏览文件 @
48f24252
...
...
@@ -90,7 +90,7 @@ public class ShowProgress implements DatabaseEventListener {
* @param stillAvailable the number of bytes still available
*/
public
void
diskSpaceIsLow
(
long
stillAvailable
)
{
System
.
out
.
println
(
"diskSpaceIsLow
stillAvailable="
+
stillAvailable
);
System
.
out
.
println
(
"diskSpaceIsLow
"
);
}
/**
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
48f24252
...
...
@@ -282,8 +282,8 @@ java org.h2.test.TestAll timer
System
.
setProperty
(
"h2.check2"
,
"true"
);
/*
remove emergencyReserver?
remove emergencyReserve?
build.sh from mac (test in Ubuntu)
test.sql
good:
...
...
h2/src/test/org/h2/test/db/TestListener.java
浏览文件 @
48f24252
...
...
@@ -52,7 +52,7 @@ public class TestListener extends TestBase implements DatabaseEventListener {
}
public
void
diskSpaceIsLow
(
long
stillAvailable
)
{
printTime
(
"diskSpaceIsLow
stillAvailable="
+
stillAvailable
);
printTime
(
"diskSpaceIsLow
"
);
}
public
void
exceptionThrown
(
SQLException
e
,
String
sql
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论