Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
9f4ea2c5
Unverified
提交
9f4ea2c5
authored
6月 22, 2018
作者:
Evgenij Ryazanov
提交者:
GitHub
6月 22, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1228 from katzyn/mvcc
Remove some PageStore+MVCC leftovers
上级
a729e2cd
39f4df3f
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
0 行增加
和
113 行删除
+0
-113
Session.java
h2/src/main/org/h2/engine/Session.java
+0
-24
UndoLogRecord.java
h2/src/main/org/h2/engine/UndoLogRecord.java
+0
-14
BaseIndex.java
h2/src/main/org/h2/index/BaseIndex.java
+0
-5
Index.java
h2/src/main/org/h2/index/Index.java
+0
-9
Row.java
h2/src/main/org/h2/result/Row.java
+0
-19
RowImpl.java
h2/src/main/org/h2/result/RowImpl.java
+0
-20
RowList.java
h2/src/main/org/h2/result/RowList.java
+0
-3
RegularTable.java
h2/src/main/org/h2/table/RegularTable.java
+0
-8
Table.java
h2/src/main/org/h2/table/Table.java
+0
-11
没有找到文件。
h2/src/main/org/h2/engine/Session.java
浏览文件 @
9f4ea2c5
...
...
@@ -692,21 +692,6 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
}
removeTemporaryLobs
(
true
);
if
(
undoLog
.
size
()
>
0
)
{
// commit the rows when using MVCC
if
(
database
.
isMVStore
())
{
synchronized
(
database
)
{
ArrayList
<
Row
>
rows
=
new
ArrayList
<>(
undoLog
.
size
());
while
(
undoLog
.
size
()
>
0
)
{
UndoLogRecord
entry
=
undoLog
.
getLast
();
entry
.
commit
();
rows
.
add
(
entry
.
getRow
());
undoLog
.
removeLast
(
false
);
}
for
(
Row
r
:
rows
)
{
r
.
commit
();
}
}
}
undoLog
.
clear
();
}
if
(!
ddl
)
{
...
...
@@ -926,15 +911,6 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
}
}
undoLog
.
add
(
log
);
}
else
{
if
(
database
.
isMVStore
())
{
// see also UndoLogRecord.commit
ArrayList
<
Index
>
indexes
=
table
.
getIndexes
();
for
(
Index
index
:
indexes
)
{
index
.
commit
(
operation
,
row
);
}
row
.
commit
();
}
}
}
...
...
h2/src/main/org/h2/engine/UndoLogRecord.java
浏览文件 @
9f4ea2c5
...
...
@@ -106,9 +106,6 @@ public class UndoLogRecord {
try
{
table
.
addRow
(
session
,
row
);
table
.
fireAfterRow
(
session
,
null
,
row
,
true
);
// reset session id, otherwise other sessions think
// that this row was inserted by this session
row
.
commit
();
}
catch
(
DbException
e
)
{
if
(
session
.
getDatabase
().
getLockMode
()
==
Constants
.
LOCK_MODE_OFF
&&
e
.
getSQLException
().
getErrorCode
()
==
ErrorCode
.
DUPLICATE_KEY_1
)
{
...
...
@@ -137,7 +134,6 @@ public class UndoLogRecord {
buff
.
writeByte
(
row
.
isDeleted
()
?
(
byte
)
1
:
(
byte
)
0
);
buff
.
writeInt
(
log
.
getTableId
(
table
));
buff
.
writeLong
(
row
.
getKey
());
buff
.
writeInt
(
row
.
getSessionId
());
int
count
=
row
.
getColumnCount
();
buff
.
writeInt
(
count
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
...
...
@@ -212,7 +208,6 @@ public class UndoLogRecord {
boolean
deleted
=
buff
.
readByte
()
==
1
;
table
=
log
.
getTable
(
buff
.
readInt
());
long
key
=
buff
.
readLong
();
int
sessionId
=
buff
.
readInt
();
int
columnCount
=
buff
.
readInt
();
Value
[]
values
=
new
Value
[
columnCount
];
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
...
...
@@ -221,7 +216,6 @@ public class UndoLogRecord {
row
=
getTable
().
getDatabase
().
createRow
(
values
,
Row
.
MEMORY_CALCULATE
);
row
.
setKey
(
key
);
row
.
setDeleted
(
deleted
);
row
.
setSessionId
(
sessionId
);
state
=
IN_MEMORY_INVALID
;
}
...
...
@@ -243,14 +237,6 @@ public class UndoLogRecord {
return
filePos
;
}
/**
* This method is called after the operation was committed.
* It commits the change to the indexes.
*/
void
commit
()
{
table
.
commit
(
operation
,
row
);
}
/**
* Get the row that was deleted or inserted.
*
...
...
h2/src/main/org/h2/index/BaseIndex.java
浏览文件 @
9f4ea2c5
...
...
@@ -446,11 +446,6 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
return
table
;
}
@Override
public
void
commit
(
int
operation
,
Row
row
)
{
// nothing to do
}
@Override
public
Row
getRow
(
Session
session
,
long
key
)
{
throw
DbException
.
getUnsupportedException
(
toString
());
...
...
h2/src/main/org/h2/index/Index.java
浏览文件 @
9f4ea2c5
...
...
@@ -244,15 +244,6 @@ public interface Index extends SchemaObject {
*/
Table
getTable
();
/**
* Commit the operation for a row. This is only important for multi-version
* indexes. The method is only called if multi-version is enabled.
*
* @param operation the operation type
* @param row the row
*/
void
commit
(
int
operation
,
Row
row
);
/**
* Get the row with the given key.
*
...
...
h2/src/main/org/h2/result/Row.java
浏览文件 @
9f4ea2c5
...
...
@@ -53,25 +53,6 @@ public interface Row extends SearchRow {
*/
void
setDeleted
(
boolean
deleted
);
/**
* Set session id.
*
* @param sessionId the session id
*/
void
setSessionId
(
int
sessionId
);
/**
* Get session id.
*
* @return the session id
*/
int
getSessionId
();
/**
* This record has been committed. The session id is reset.
*/
void
commit
();
/**
* Check if the row is deleted.
*
...
...
h2/src/main/org/h2/result/RowImpl.java
浏览文件 @
9f4ea2c5
...
...
@@ -22,7 +22,6 @@ public class RowImpl implements Row {
private
int
memory
;
private
int
version
;
private
boolean
deleted
;
private
int
sessionId
;
public
RowImpl
(
Value
[]
data
,
int
memory
)
{
this
.
data
=
data
;
...
...
@@ -41,7 +40,6 @@ public class RowImpl implements Row {
RowImpl
r2
=
new
RowImpl
(
d2
,
memory
);
r2
.
key
=
key
;
r2
.
version
=
version
+
1
;
r2
.
sessionId
=
sessionId
;
return
r2
;
}
...
...
@@ -154,24 +152,6 @@ public class RowImpl implements Row {
this
.
deleted
=
deleted
;
}
@Override
public
void
setSessionId
(
int
sessionId
)
{
this
.
sessionId
=
sessionId
;
}
@Override
public
int
getSessionId
()
{
return
sessionId
;
}
/**
* This record has been committed. The session id is reset.
*/
@Override
public
void
commit
()
{
this
.
sessionId
=
0
;
}
@Override
public
boolean
isDeleted
()
{
return
deleted
;
...
...
h2/src/main/org/h2/result/RowList.java
浏览文件 @
9f4ea2c5
...
...
@@ -56,7 +56,6 @@ public class RowList {
buff
.
writeLong
(
r
.
getKey
());
buff
.
writeInt
(
r
.
getVersion
());
buff
.
writeInt
(
r
.
isDeleted
()
?
1
:
0
);
buff
.
writeInt
(
r
.
getSessionId
());
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
Value
v
=
r
.
getValue
(
i
);
buff
.
checkCapacity
(
1
);
...
...
@@ -174,7 +173,6 @@ public class RowList {
key
=
0
;
}
boolean
deleted
=
buff
.
readInt
()
==
1
;
int
sessionId
=
buff
.
readInt
();
Value
[]
values
=
new
Value
[
columnCount
];
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
Value
v
;
...
...
@@ -196,7 +194,6 @@ public class RowList {
row
.
setKey
(
key
);
row
.
setVersion
(
version
);
row
.
setDeleted
(
deleted
);
row
.
setSessionId
(
sessionId
);
return
row
;
}
...
...
h2/src/main/org/h2/table/RegularTable.java
浏览文件 @
9f4ea2c5
...
...
@@ -142,14 +142,6 @@ public class RegularTable extends TableBase {
analyzeIfRequired
(
session
);
}
@Override
public
void
commit
(
short
operation
,
Row
row
)
{
lastModificationId
=
database
.
getNextModificationDataId
();
for
(
Index
index
:
indexes
)
{
index
.
commit
(
operation
,
row
);
}
}
private
void
checkRowCount
(
Session
session
,
Index
index
,
int
offset
)
{
if
(
SysProperties
.
CHECK
)
{
if
(!(
index
instanceof
PageDelegateIndex
))
{
...
...
h2/src/main/org/h2/table/Table.java
浏览文件 @
9f4ea2c5
...
...
@@ -224,17 +224,6 @@ public abstract class Table extends SchemaObjectBase {
addRow
(
session
,
newRow
);
}
/**
* Commit an operation (when using multi-version concurrency).
*
* @param operation the operation
* @param row the row
*/
@SuppressWarnings
(
"unused"
)
public
void
commit
(
short
operation
,
Row
row
)
{
// nothing to do
}
/**
* Check if this table supports ALTER TABLE.
*
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论