Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
62372306
提交
62372306
authored
11月 29, 2012
作者:
noelgrandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make some more fields final where appropriate.
Found by UCDetector, which seems to have gotten smarter recently.
上级
38ed19b9
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
28 行增加
和
24 行删除
+28
-24
RuleElement.java
h2/src/main/org/h2/bnf/RuleElement.java
+2
-4
FullTextSettings.java
h2/src/main/org/h2/fulltext/FullTextSettings.java
+4
-4
PageBtreeIndex.java
h2/src/main/org/h2/index/PageBtreeIndex.java
+2
-5
JdbcStatement.java
h2/src/main/org/h2/jdbc/JdbcStatement.java
+1
-1
FileStore.java
h2/src/main/org/h2/store/FileStore.java
+4
-2
FileStoreInputStream.java
h2/src/main/org/h2/store/FileStoreInputStream.java
+3
-1
FileStoreOutputStream.java
h2/src/main/org/h2/store/FileStoreOutputStream.java
+7
-4
BuildBase.java
h2/src/tools/org/h2/build/BuildBase.java
+1
-1
MVStore.java
h2/src/tools/org/h2/dev/store/btree/MVStore.java
+3
-1
GenerateModels.java
h2/src/tools/org/h2/jaqu/util/GenerateModels.java
+1
-1
没有找到文件。
h2/src/main/org/h2/bnf/RuleElement.java
浏览文件 @
62372306
...
...
@@ -15,16 +15,14 @@ import org.h2.util.StringUtils;
*/
class
RuleElement
implements
Rule
{
private
boolean
keyword
;
private
final
boolean
keyword
;
private
final
String
name
;
private
Rule
link
;
private
final
int
type
;
RuleElement
(
String
name
,
String
topic
)
{
this
.
name
=
name
;
if
(
name
.
length
()
==
1
||
name
.
equals
(
StringUtils
.
toUpperEnglish
(
name
)))
{
keyword
=
true
;
}
this
.
keyword
=
name
.
length
()
==
1
||
name
.
equals
(
StringUtils
.
toUpperEnglish
(
name
));
topic
=
StringUtils
.
toLowerEnglish
(
topic
);
this
.
type
=
topic
.
startsWith
(
"function"
)
?
Sentence
.
FUNCTION
:
Sentence
.
KEYWORD
;
}
...
...
h2/src/main/org/h2/fulltext/FullTextSettings.java
浏览文件 @
62372306
...
...
@@ -34,22 +34,22 @@ class FullTextSettings {
/**
* The set of words not to index (stop words).
*/
private
HashSet
<
String
>
ignoreList
=
New
.
hashSet
();
private
final
HashSet
<
String
>
ignoreList
=
New
.
hashSet
();
/**
* The set of words / terms.
*/
private
HashMap
<
String
,
Integer
>
words
=
New
.
hashMap
();
private
final
HashMap
<
String
,
Integer
>
words
=
New
.
hashMap
();
/**
* The set of indexes in this database.
*/
private
HashMap
<
Integer
,
IndexInfo
>
indexes
=
New
.
hashMap
();
private
final
HashMap
<
Integer
,
IndexInfo
>
indexes
=
New
.
hashMap
();
/**
* The prepared statement cache.
*/
private
SoftHashMap
<
Connection
,
SoftHashMap
<
String
,
PreparedStatement
>>
cache
=
private
final
SoftHashMap
<
Connection
,
SoftHashMap
<
String
,
PreparedStatement
>>
cache
=
new
SoftHashMap
<
Connection
,
SoftHashMap
<
String
,
PreparedStatement
>>();
/**
...
...
h2/src/main/org/h2/index/PageBtreeIndex.java
浏览文件 @
62372306
...
...
@@ -33,7 +33,7 @@ public class PageBtreeIndex extends PageIndex {
private
final
PageStore
store
;
private
final
RegularTable
tableData
;
private
boolean
needRebuild
;
private
final
boolean
needRebuild
;
private
long
rowCount
;
private
int
memoryPerPage
;
private
int
memoryCount
;
...
...
@@ -55,7 +55,6 @@ public class PageBtreeIndex extends PageIndex {
if
(
create
)
{
// new index
rootPageId
=
store
.
allocatePage
();
needRebuild
=
true
;
// TODO currently the head position is stored in the log
// it should not for new tables, otherwise redo of other operations
// must ensure this page is not used for other things
...
...
@@ -67,10 +66,8 @@ public class PageBtreeIndex extends PageIndex {
rootPageId
=
store
.
getRootPageId
(
id
);
PageBtree
root
=
getPage
(
rootPageId
);
rowCount
=
root
.
getRowCount
();
if
(
rowCount
==
0
&&
store
.
isRecoveryRunning
())
{
needRebuild
=
true
;
}
}
this
.
needRebuild
=
create
||
(
rowCount
==
0
&&
store
.
isRecoveryRunning
());
if
(
trace
.
isDebugEnabled
())
{
trace
.
debug
(
"opened {0} rows: {1}"
,
getName
()
,
rowCount
);
}
...
...
h2/src/main/org/h2/jdbc/JdbcStatement.java
浏览文件 @
62372306
...
...
@@ -34,7 +34,7 @@ public class JdbcStatement extends TraceObject implements Statement {
protected
int
updateCount
;
protected
final
int
resultSetType
;
protected
final
int
resultSetConcurrency
;
protected
boolean
closedByResultSet
;
protected
final
boolean
closedByResultSet
;
private
CommandInterface
executingCommand
;
private
int
lastExecutedCommandType
;
private
ArrayList
<
String
>
batchCommands
;
...
...
h2/src/main/org/h2/store/FileStore.java
浏览文件 @
62372306
...
...
@@ -45,7 +45,7 @@ public class FileStore {
* The callback object is responsible to check access rights, and free up
* disk space if required.
*/
private
DataHandler
handler
;
private
final
DataHandler
handler
;
private
FileChannel
file
;
private
long
filePos
;
...
...
@@ -53,7 +53,7 @@ public class FileStore {
private
Reference
<?>
autoDeleteReference
;
private
boolean
checkedWriting
=
true
;
private
final
String
mode
;
private
TempFileDeleter
tempFileDeleter
;
private
final
TempFileDeleter
tempFileDeleter
;
private
java
.
nio
.
channels
.
FileLock
lock
;
/**
...
...
@@ -68,6 +68,8 @@ public class FileStore {
this
.
name
=
name
;
if
(
handler
!=
null
)
{
tempFileDeleter
=
handler
.
getTempFileDeleter
();
}
else
{
tempFileDeleter
=
null
;
}
try
{
boolean
exists
=
FileUtils
.
exists
(
name
);
...
...
h2/src/main/org/h2/store/FileStoreInputStream.java
浏览文件 @
62372306
...
...
@@ -21,7 +21,7 @@ public class FileStoreInputStream extends InputStream {
private
FileStore
store
;
private
final
Data
page
;
private
int
remainingInBuffer
;
private
CompressTool
compress
;
private
final
CompressTool
compress
;
private
boolean
endOfFile
;
private
final
boolean
alwaysClose
;
...
...
@@ -30,6 +30,8 @@ public class FileStoreInputStream extends InputStream {
this
.
alwaysClose
=
alwaysClose
;
if
(
compression
)
{
compress
=
CompressTool
.
getInstance
();
}
else
{
compress
=
null
;
}
page
=
Data
.
create
(
handler
,
Constants
.
FILE_BLOCK_SIZE
);
try
{
...
...
h2/src/main/org/h2/store/FileStoreOutputStream.java
浏览文件 @
62372306
...
...
@@ -16,15 +16,18 @@ import org.h2.tools.CompressTool;
public
class
FileStoreOutputStream
extends
OutputStream
{
private
FileStore
store
;
private
final
Data
page
;
private
String
compressionAlgorithm
;
private
CompressTool
compress
;
private
byte
[]
buffer
=
{
0
};
private
final
String
compressionAlgorithm
;
private
final
CompressTool
compress
;
private
final
byte
[]
buffer
=
{
0
};
public
FileStoreOutputStream
(
FileStore
store
,
DataHandler
handler
,
String
compressionAlgorithm
)
{
this
.
store
=
store
;
if
(
compressionAlgorithm
!=
null
)
{
compress
=
CompressTool
.
getInstance
();
this
.
compress
=
CompressTool
.
getInstance
();
this
.
compressionAlgorithm
=
compressionAlgorithm
;
}
else
{
this
.
compress
=
null
;
this
.
compressionAlgorithm
=
null
;
}
page
=
Data
.
create
(
handler
,
Constants
.
FILE_BLOCK_SIZE
);
}
...
...
h2/src/tools/org/h2/build/BuildBase.java
浏览文件 @
62372306
...
...
@@ -150,7 +150,7 @@ public class BuildBase {
/**
* The output stream (System.out).
*/
protected
PrintStream
sysOut
=
System
.
out
;
protected
final
PrintStream
sysOut
=
System
.
out
;
/**
* If output should be disabled.
...
...
h2/src/tools/org/h2/dev/store/btree/MVStore.java
浏览文件 @
62372306
...
...
@@ -129,7 +129,7 @@ public class MVStore {
* split in 16 segments. The stack move distance is 2% of the expected
* number of entries.
*/
private
CacheLongKeyLIRS
<
Page
>
cache
;
private
final
CacheLongKeyLIRS
<
Page
>
cache
;
private
int
lastChunkId
;
private
final
HashMap
<
Integer
,
Chunk
>
chunks
=
New
.
hashMap
();
...
...
@@ -184,6 +184,8 @@ public class MVStore {
int
mb
=
s
==
null
?
16
:
Integer
.
parseInt
(
s
.
toString
());
cache
=
CacheLongKeyLIRS
.
newInstance
(
mb
*
1024
*
1024
,
2048
,
16
,
mb
*
1024
*
1024
/
2048
*
2
/
100
);
}
else
{
cache
=
null
;
}
}
...
...
h2/src/tools/org/h2/jaqu/util/GenerateModels.java
浏览文件 @
62372306
...
...
@@ -35,7 +35,7 @@ public class GenerateModels {
/**
* The output stream where this tool writes to.
*/
protected
PrintStream
out
=
System
.
out
;
protected
final
PrintStream
out
=
System
.
out
;
public
static
void
main
(
String
...
args
)
throws
SQLException
{
new
GenerateModels
().
runTool
(
args
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论