Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
5f1bd724
提交
5f1bd724
authored
16 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
better trace messages
上级
4ae3cdb6
master
noel-pr1
plus33-master
pr/267
stumc-Issue#576
version-1.1.x
version-1.4.198
version-1.4.197
version-1.4.196
version-1.4.195
version-1.4.194
version-1.4.193
version-1.4.192
version-1.4.191
version-1.4.190
version-1.4.188
version-1.4.187
version-1.4.186
version-1.4.185
version-1.4.184
version-1.4.183
version-1.4.182
version-1.4.181
version-1.4.178
version-1.4.177
version-1.3
version-1.2
version-1.1
version-1.0
无相关合并请求
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
53 行增加
和
9 行删除
+53
-9
ScriptBase.java
h2/src/main/org/h2/command/dml/ScriptBase.java
+5
-0
Database.java
h2/src/main/org/h2/engine/Database.java
+4
-0
DataHandler.java
h2/src/main/org/h2/store/DataHandler.java
+8
-0
DiskFile.java
h2/src/main/org/h2/store/DiskFile.java
+7
-2
FileStore.java
h2/src/main/org/h2/store/FileStore.java
+5
-1
TableData.java
h2/src/main/org/h2/table/TableData.java
+3
-3
Recover.java
h2/src/main/org/h2/tools/Recover.java
+8
-0
Cache2Q.java
h2/src/main/org/h2/util/Cache2Q.java
+1
-1
CacheLRU.java
h2/src/main/org/h2/util/CacheLRU.java
+2
-2
CacheWriter.java
h2/src/main/org/h2/util/CacheWriter.java
+10
-0
没有找到文件。
h2/src/main/org/h2/command/dml/ScriptBase.java
浏览文件 @
5f1bd724
...
@@ -21,6 +21,7 @@ import org.h2.engine.Database;
...
@@ -21,6 +21,7 @@ import org.h2.engine.Database;
import
org.h2.engine.Session
;
import
org.h2.engine.Session
;
import
org.h2.expression.Expression
;
import
org.h2.expression.Expression
;
import
org.h2.message.Message
;
import
org.h2.message.Message
;
import
org.h2.message.Trace
;
import
org.h2.security.SHA256
;
import
org.h2.security.SHA256
;
import
org.h2.store.DataHandler
;
import
org.h2.store.DataHandler
;
import
org.h2.store.FileStore
;
import
org.h2.store.FileStore
;
...
@@ -251,5 +252,9 @@ public abstract class ScriptBase extends Prepared implements DataHandler {
...
@@ -251,5 +252,9 @@ public abstract class ScriptBase extends Prepared implements DataHandler {
public
SmallLRUCache
getLobFileListCache
()
{
public
SmallLRUCache
getLobFileListCache
()
{
return
null
;
return
null
;
}
}
public
Trace
getTrace
()
{
return
session
.
getDatabase
().
getTrace
(
Trace
.
DATABASE
);
}
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Database.java
浏览文件 @
5f1bd724
...
@@ -2117,4 +2117,8 @@ public class Database implements DataHandler {
...
@@ -2117,4 +2117,8 @@ public class Database implements DataHandler {
return
tempFileDeleter
;
return
tempFileDeleter
;
}
}
public
Trace
getTrace
()
{
return
getTrace
(
Trace
.
DATABASE
);
}
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/DataHandler.java
浏览文件 @
5f1bd724
...
@@ -8,6 +8,7 @@ package org.h2.store;
...
@@ -8,6 +8,7 @@ package org.h2.store;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
org.h2.message.Trace
;
import
org.h2.util.SmallLRUCache
;
import
org.h2.util.SmallLRUCache
;
import
org.h2.util.TempFileDeleter
;
import
org.h2.util.TempFileDeleter
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
...
@@ -151,4 +152,11 @@ public interface DataHandler {
...
@@ -151,4 +152,11 @@ public interface DataHandler {
*/
*/
SmallLRUCache
getLobFileListCache
();
SmallLRUCache
getLobFileListCache
();
/**
* Get the trace writer.
*
* @return the trace writer
*/
Trace
getTrace
();
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/DiskFile.java
浏览文件 @
5f1bd724
...
@@ -314,7 +314,7 @@ public class DiskFile implements CacheWriter {
...
@@ -314,7 +314,7 @@ public class DiskFile implements CacheWriter {
DataInputStream
in
=
new
DataInputStream
(
new
ByteArrayInputStream
(
summary
));
DataInputStream
in
=
new
DataInputStream
(
new
ByteArrayInputStream
(
summary
));
int
b2
=
in
.
readInt
();
int
b2
=
in
.
readInt
();
if
(
b2
>
fileBlockCount
)
{
if
(
b2
>
fileBlockCount
)
{
database
.
getTrace
(
Trace
.
DATABASE
).
info
(
getTrace
(
).
info
(
"unexpected size "
+
b2
+
" when initializing summary for "
+
fileName
+
" expected:"
"unexpected size "
+
b2
+
" when initializing summary for "
+
fileName
+
" expected:"
+
fileBlockCount
);
+
fileBlockCount
);
return
;
return
;
...
@@ -378,7 +378,7 @@ public class DiskFile implements CacheWriter {
...
@@ -378,7 +378,7 @@ public class DiskFile implements CacheWriter {
freeUnusedPages
();
freeUnusedPages
();
init
=
true
;
init
=
true
;
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
database
.
getTrace
(
Trace
.
DATABASE
).
error
(
getTrace
(
).
error
(
"error initializing summary for "
+
fileName
+
" size:"
+
summary
.
length
+
" stage:"
+
stage
,
e
);
"error initializing summary for "
+
fileName
+
" size:"
+
summary
.
length
+
" stage:"
+
stage
,
e
);
// ignore - init is still false in this case
// ignore - init is still false in this case
}
}
...
@@ -1278,5 +1278,10 @@ public class DiskFile implements CacheWriter {
...
@@ -1278,5 +1278,10 @@ public class DiskFile implements CacheWriter {
public
String
toString
()
{
public
String
toString
()
{
return
getClass
().
getName
()
+
":"
+
fileName
;
return
getClass
().
getName
()
+
":"
+
fileName
;
}
}
public
Trace
getTrace
()
{
return
database
.
getTrace
(
Trace
.
DATABASE
);
}
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/FileStore.java
浏览文件 @
5f1bd724
...
@@ -14,6 +14,7 @@ import org.h2.constant.ErrorCode;
...
@@ -14,6 +14,7 @@ import org.h2.constant.ErrorCode;
import
org.h2.constant.SysProperties
;
import
org.h2.constant.SysProperties
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Constants
;
import
org.h2.message.Message
;
import
org.h2.message.Message
;
import
org.h2.message.Trace
;
import
org.h2.security.SecureFileStore
;
import
org.h2.security.SecureFileStore
;
import
org.h2.store.fs.FileObject
;
import
org.h2.store.fs.FileObject
;
import
org.h2.store.fs.FileSystem
;
import
org.h2.store.fs.FileSystem
;
...
@@ -454,7 +455,10 @@ public class FileStore {
...
@@ -454,7 +455,10 @@ public class FileStore {
try
{
try
{
file
.
sync
();
file
.
sync
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
// TODO log exception
Trace
trace
=
handler
.
getTrace
();
if
(
trace
!=
null
)
{
trace
.
error
(
"Sync failed"
,
e
);
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/table/TableData.java
浏览文件 @
5f1bd724
...
@@ -119,7 +119,7 @@ public class TableData extends Table implements RecordReader {
...
@@ -119,7 +119,7 @@ public class TableData extends Table implements RecordReader {
// this could happen, for example on failure in the storage
// this could happen, for example on failure in the storage
// but if that is not the case it means there is something wrong
// but if that is not the case it means there is something wrong
// with the database
// with the database
// TODO log this problem
trace
.
error
(
"Could not undo operation"
,
e
);
throw
e2
;
throw
e2
;
}
}
throw
Message
.
convert
(
e
);
throw
Message
.
convert
(
e
);
...
@@ -209,7 +209,7 @@ public class TableData extends Table implements RecordReader {
...
@@ -209,7 +209,7 @@ public class TableData extends Table implements RecordReader {
// this could happen, for example on failure in the storage
// this could happen, for example on failure in the storage
// but if that is not the case it means
// but if that is not the case it means
// there is something wrong with the database
// there is something wrong with the database
// TODO log this problem
trace
.
error
(
"Could not remove index"
,
e
);
throw
e2
;
throw
e2
;
}
}
throw
e
;
throw
e
;
...
@@ -310,7 +310,7 @@ public class TableData extends Table implements RecordReader {
...
@@ -310,7 +310,7 @@ public class TableData extends Table implements RecordReader {
// this could happen, for example on failure in the storage
// this could happen, for example on failure in the storage
// but if that is not the case it means there is something wrong
// but if that is not the case it means there is something wrong
// with the database
// with the database
// TODO log this problem
trace
.
error
(
"Could not undo operation"
,
e
);
throw
e2
;
throw
e2
;
}
}
throw
Message
.
convert
(
e
);
throw
Message
.
convert
(
e
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/tools/Recover.java
浏览文件 @
5f1bd724
...
@@ -32,6 +32,7 @@ import org.h2.engine.DbObject;
...
@@ -32,6 +32,7 @@ import org.h2.engine.DbObject;
import
org.h2.engine.MetaRecord
;
import
org.h2.engine.MetaRecord
;
import
org.h2.log.LogFile
;
import
org.h2.log.LogFile
;
import
org.h2.message.Message
;
import
org.h2.message.Message
;
import
org.h2.message.Trace
;
import
org.h2.result.SimpleRow
;
import
org.h2.result.SimpleRow
;
import
org.h2.security.SHA256
;
import
org.h2.security.SHA256
;
import
org.h2.store.DataHandler
;
import
org.h2.store.DataHandler
;
...
@@ -1043,5 +1044,12 @@ public class Recover extends Tool implements DataHandler {
...
@@ -1043,5 +1044,12 @@ public class Recover extends Tool implements DataHandler {
public
TempFileDeleter
getTempFileDeleter
()
{
public
TempFileDeleter
getTempFileDeleter
()
{
return
TempFileDeleter
.
getInstance
();
return
TempFileDeleter
.
getInstance
();
}
}
/**
* INTERNAL
*/
public
Trace
getTrace
()
{
return
null
;
}
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/Cache2Q.java
浏览文件 @
5f1bd724
...
@@ -178,7 +178,7 @@ public class Cache2Q implements Cache {
...
@@ -178,7 +178,7 @@ public class Cache2Q implements Cache {
// can't remove any record, because the log is not written yet
// can't remove any record, because the log is not written yet
// hopefully this does not happen too much, but it could happen
// hopefully this does not happen too much, but it could happen
// theoretically
// theoretically
// TODO log this
writer
.
getTrace
().
info
(
"Cannot remove records, cache size too small?"
);
break
;
break
;
}
}
if
(
sizeIn
>
maxIn
)
{
if
(
sizeIn
>
maxIn
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/CacheLRU.java
浏览文件 @
5f1bd724
...
@@ -100,7 +100,7 @@ public class CacheLRU implements Cache {
...
@@ -100,7 +100,7 @@ public class CacheLRU implements Cache {
// can't remove any record, because the log is not written yet
// can't remove any record, because the log is not written yet
// hopefully this does not happen too much, but it could happen
// hopefully this does not happen too much, but it could happen
// theoretically
// theoretically
// TODO log this
writer
.
getTrace
().
info
(
"Cannot remove records, cache size too small?"
);
break
;
break
;
}
}
CacheObject
last
=
head
.
next
;
CacheObject
last
=
head
.
next
;
...
@@ -304,7 +304,7 @@ public class CacheLRU implements Cache {
...
@@ -304,7 +304,7 @@ public class CacheLRU implements Cache {
////System.out.println("cache write "+entry.getPos());
////System.out.println("cache write "+entry.getPos());
// writer.writeBack(entry);
// writer.writeBack(entry);
// } catch(SQLException e) {
// } catch(SQLException e) {
// //
TODO cache:
printStackTrace not needed
// // printStackTrace not needed
// // if we use our own hashtable
// // if we use our own hashtable
// e.printStackTrace();
// e.printStackTrace();
// }
// }
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/CacheWriter.java
浏览文件 @
5f1bd724
...
@@ -8,6 +8,8 @@ package org.h2.util;
...
@@ -8,6 +8,8 @@ package org.h2.util;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
org.h2.message.Trace
;
/**
/**
* The cache writer is called by the cache to persist changed data that needs to
* The cache writer is called by the cache to persist changed data that needs to
* be removed from the cache.
* be removed from the cache.
...
@@ -28,4 +30,12 @@ public interface CacheWriter {
...
@@ -28,4 +30,12 @@ public interface CacheWriter {
* log file first, because the log file is 'write ahead'.
* log file first, because the log file is 'write ahead'.
*/
*/
void
flushLog
()
throws
SQLException
;
void
flushLog
()
throws
SQLException
;
/**
* Get the trace writer.
*
* @return the trace writer
*/
Trace
getTrace
();
}
}
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论