Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
51a00e71
提交
51a00e71
authored
9月 16, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improved compatibility with the Java 7 FileSystem abstraction.
上级
bd00e7d3
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
22 行增加
和
20 行删除
+22
-20
FileStore.java
h2/src/main/org/h2/store/FileStore.java
+1
-1
FileObject.java
h2/src/main/org/h2/store/fs/FileObject.java
+4
-2
FileObjectDisk.java
h2/src/main/org/h2/store/fs/FileObjectDisk.java
+1
-1
FileObjectMem.java
h2/src/main/org/h2/store/fs/FileObjectMem.java
+1
-1
FileObjectNio.java
h2/src/main/org/h2/store/fs/FileObjectNio.java
+2
-2
FileObjectNioMapped.java
h2/src/main/org/h2/store/fs/FileObjectNioMapped.java
+1
-1
FileObjectRec.java
h2/src/main/org/h2/store/fs/FileObjectRec.java
+2
-2
FileObjectSplit.java
h2/src/main/org/h2/store/fs/FileObjectSplit.java
+2
-2
FileObjectZip.java
h2/src/main/org/h2/store/fs/FileObjectZip.java
+1
-1
TestFileSystem.java
h2/src/test/org/h2/test/unit/TestFileSystem.java
+1
-1
FileDebug.java
h2/src/test/org/h2/test/utils/FileDebug.java
+3
-3
FileObjectCrypt.java
h2/src/tools/org/h2/dev/fs/FileObjectCrypt.java
+2
-2
FileObjectZip2.java
h2/src/tools/org/h2/dev/fs/FileObjectZip2.java
+1
-1
没有找到文件。
h2/src/main/org/h2/store/FileStore.java
浏览文件 @
51a00e71
...
...
@@ -431,7 +431,7 @@ public class FileStore {
*/
public
void
sync
()
{
try
{
file
.
sync
(
);
file
.
force
(
true
);
}
catch
(
IOException
e
)
{
throw
DbException
.
convertIOException
(
e
,
name
);
}
...
...
h2/src/main/org/h2/store/fs/FileObject.java
浏览文件 @
51a00e71
...
...
@@ -58,9 +58,11 @@ public interface FileObject {
long
position
()
throws
IOException
;
/**
* Force changes to the physical location.
* Force changes to the physical location (sync).
*
* @param metaData whether the file metadata should be written as well
*/
void
sync
(
)
throws
IOException
;
void
force
(
boolean
metaData
)
throws
IOException
;
/**
* Change the length of the file.
...
...
h2/src/main/org/h2/store/fs/FileObjectDisk.java
浏览文件 @
51a00e71
...
...
@@ -25,7 +25,7 @@ public class FileObjectDisk implements FileObject {
this
.
name
=
fileName
;
}
public
void
sync
(
)
throws
IOException
{
public
void
force
(
boolean
metaData
)
throws
IOException
{
String
m
=
SysProperties
.
SYNC_METHOD
;
if
(
""
.
equals
(
m
))
{
// do nothing
...
...
h2/src/main/org/h2/store/fs/FileObjectMem.java
浏览文件 @
51a00e71
...
...
@@ -57,7 +57,7 @@ public class FileObjectMem implements FileObject {
pos
=
0
;
}
public
void
sync
()
{
public
void
force
(
boolean
metaData
)
throws
IOException
{
// do nothing
}
...
...
h2/src/main/org/h2/store/fs/FileObjectNio.java
浏览文件 @
51a00e71
...
...
@@ -78,8 +78,8 @@ public class FileObjectNio implements FileObject {
length
=
newLength
;
}
public
void
sync
(
)
throws
IOException
{
channel
.
force
(
true
);
public
void
force
(
boolean
metaData
)
throws
IOException
{
channel
.
force
(
metaData
);
}
public
void
write
(
byte
[]
b
,
int
off
,
int
len
)
throws
IOException
{
...
...
h2/src/main/org/h2/store/fs/FileObjectNioMapped.java
浏览文件 @
51a00e71
...
...
@@ -186,7 +186,7 @@ public class FileObjectNioMapped implements FileObject {
pos
=
(
int
)
Math
.
min
(
newLength
,
oldPos
);
}
public
synchronized
void
sync
(
)
throws
IOException
{
public
void
force
(
boolean
metaData
)
throws
IOException
{
mapped
.
force
();
file
.
getFD
().
sync
();
}
...
...
h2/src/main/org/h2/store/fs/FileObjectRec.java
浏览文件 @
51a00e71
...
...
@@ -49,8 +49,8 @@ public class FileObjectRec implements FileObject {
file
.
truncate
(
newLength
);
}
public
void
sync
(
)
throws
IOException
{
file
.
sync
(
);
public
void
force
(
boolean
metaData
)
throws
IOException
{
file
.
force
(
metaData
);
}
public
void
write
(
byte
[]
b
,
int
off
,
int
len
)
throws
IOException
{
...
...
h2/src/main/org/h2/store/fs/FileObjectSplit.java
浏览文件 @
51a00e71
...
...
@@ -114,9 +114,9 @@ public class FileObjectSplit implements FileObject {
this
.
length
=
newLength
;
}
public
void
sync
(
)
throws
IOException
{
public
void
force
(
boolean
metaData
)
throws
IOException
{
for
(
FileObject
f
:
list
)
{
f
.
sync
(
);
f
.
force
(
metaData
);
}
}
...
...
h2/src/main/org/h2/store/fs/FileObjectZip.java
浏览文件 @
51a00e71
...
...
@@ -96,7 +96,7 @@ public class FileObjectZip implements FileObject {
throw
new
IOException
(
"File is read-only"
);
}
public
void
sync
()
{
public
void
force
(
boolean
metaData
)
throws
IOException
{
// nothing to do
}
...
...
h2/src/test/org/h2/test/unit/TestFileSystem.java
浏览文件 @
51a00e71
...
...
@@ -316,7 +316,7 @@ public class TestFileSystem extends TestBase {
FileUtils
.
delete
(
s
);
FileObject
f
=
FileUtils
.
openFileObject
(
s
,
"rw"
);
assertThrows
(
EOFException
.
class
,
f
).
readFully
(
new
byte
[
1
],
0
,
1
);
f
.
sync
(
);
f
.
force
(
true
);
Random
random
=
new
Random
(
seed
);
int
size
=
getSize
(
100
,
500
);
try
{
...
...
h2/src/test/org/h2/test/utils/FileDebug.java
浏览文件 @
51a00e71
...
...
@@ -56,9 +56,9 @@ public class FileDebug implements FileObject {
file
.
truncate
(
newLength
);
}
public
void
sync
(
)
throws
IOException
{
debug
(
"
sync
"
);
file
.
sync
(
);
public
void
force
(
boolean
metaData
)
throws
IOException
{
debug
(
"
force
"
);
file
.
force
(
metaData
);
}
public
void
write
(
byte
[]
b
,
int
off
,
int
len
)
throws
IOException
{
...
...
h2/src/tools/org/h2/dev/fs/FileObjectCrypt.java
浏览文件 @
51a00e71
...
...
@@ -85,8 +85,8 @@ public class FileObjectCrypt implements FileObject {
file
.
position
(
pos
+
HEADER_LENGTH
);
}
public
void
sync
(
)
throws
IOException
{
file
.
sync
(
);
public
void
force
(
boolean
metaData
)
throws
IOException
{
file
.
force
(
metaData
);
}
public
FileLock
tryLock
()
throws
IOException
{
...
...
h2/src/tools/org/h2/dev/fs/FileObjectZip2.java
浏览文件 @
51a00e71
...
...
@@ -102,7 +102,7 @@ public class FileObjectZip2 implements FileObject {
throw
new
IOException
(
"File is read-only"
);
}
public
void
sync
()
{
public
void
force
(
boolean
metaData
)
throws
IOException
{
// nothing to do
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论