Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
ffe1a24d
提交
ffe1a24d
authored
7月 04, 2014
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix formatting
上级
5e9911e5
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
43 行增加
和
28 行删除
+43
-28
advanced.html
h2/src/docsrc/html/advanced.html
+3
-3
changelog.html
h2/src/docsrc/html/changelog.html
+4
-4
Engine.java
h2/src/main/org/h2/engine/Engine.java
+3
-1
Session.java
h2/src/main/org/h2/engine/Session.java
+2
-1
SessionInterface.java
h2/src/main/org/h2/engine/SessionInterface.java
+3
-2
SessionRemote.java
h2/src/main/org/h2/engine/SessionRemote.java
+5
-2
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+2
-2
help.csv
h2/src/main/org/h2/res/help.csv
+2
-1
WebServer.java
h2/src/main/org/h2/server/web/WebServer.java
+15
-8
WebSession.java
h2/src/main/org/h2/server/web/WebSession.java
+2
-1
TestCluster.java
h2/src/test/org/h2/test/db/TestCluster.java
+2
-3
没有找到文件。
h2/src/docsrc/html/advanced.html
浏览文件 @
ffe1a24d
...
...
@@ -401,8 +401,8 @@ properties <code>server0</code>..<code>serverX</code>, where serverX is the numb
</p>
<p>
Example: To get the 2nd server in the connection list one uses
<code>
getClientInfo('server1')
<
code>
.
<b>
Note:
</b>
The
<code>
serverX
</code>
property only returns IP addresses and ports and not hostnames.
Example: To get the 2nd server in the connection list one uses
<code>
getClientInfo('server1')
<
/code>
.
<
b>
Note:
</b>
The
<
code>
serverX
</code>
property only returns IP addresses and ports and not hostnames.
</p>
<h3>
Clustering Algorithm and Limitations
</h3>
...
...
h2/src/docsrc/html/changelog.html
浏览文件 @
ffe1a24d
...
...
@@ -25,7 +25,7 @@ Change Log
occur MVMap.openVersion when concurrently accessing the store.
</li><li>
The LIRS cache now re-sizes the internal hash map if needed.
</li><li>
Optionally persist session history in the H2 console. (patch from Martin Grajcar)
<
ul
><li>
Add client-info property to get the number of servers currently in the cluster
<
/li
><li>
Add client-info property to get the number of servers currently in the cluster
and which servers that are available. (patch from Nikolaj Fogh)
</li><li>
Fix bug in changing encrypted DB password that kept the file handle
open when the wrong password was supplied. (test case from Jens Hohmuth).
...
...
h2/src/main/org/h2/engine/Engine.java
浏览文件 @
ffe1a24d
...
...
@@ -32,7 +32,9 @@ public class Engine implements SessionFactory {
SysProperties
.
DELAY_WRONG_PASSWORD_MIN
;
private
boolean
jmx
;
private
Engine
()
{}
private
Engine
()
{
// use getInstance()
}
public
static
Engine
getInstance
()
{
return
INSTANCE
;
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
ffe1a24d
...
...
@@ -127,6 +127,7 @@ public class Session extends SessionWithState {
this
.
currentSchemaName
=
Constants
.
SCHEMA_MAIN
;
}
@Override
public
ArrayList
<
String
>
getClusterServers
()
{
return
new
ArrayList
<
String
>();
}
...
...
h2/src/main/org/h2/engine/SessionInterface.java
浏览文件 @
ffe1a24d
...
...
@@ -21,7 +21,8 @@ public interface SessionInterface extends Closeable {
/**
* Get the list of the cluster servers for this session.
*
* @return A list of "IP:PORT" strings for the cluster servers in this session.
* @return A list of "ip:port" strings for the cluster servers in this
* session.
*/
ArrayList
<
String
>
getClusterServers
();
...
...
h2/src/main/org/h2/engine/SessionRemote.java
浏览文件 @
ffe1a24d
...
...
@@ -95,11 +95,14 @@ public class SessionRemote extends SessionWithState implements DataHandler {
this
.
connectionInfo
=
ci
;
}
@Override
public
ArrayList
<
String
>
getClusterServers
()
{
ArrayList
<
String
>
serverList
=
new
ArrayList
<
String
>();
for
(
int
i
=
0
;
i
<
transferList
.
size
();
i
++)
{
Transfer
transfer
=
transferList
.
get
(
i
);
serverList
.
add
(
transfer
.
getSocket
().
getInetAddress
().
getHostAddress
().
toString
()
+
":"
+
String
.
valueOf
(
transfer
.
getSocket
().
getPort
()));
serverList
.
add
(
transfer
.
getSocket
().
getInetAddress
().
getHostAddress
()
+
":"
+
transfer
.
getSocket
().
getPort
());
}
return
serverList
;
}
...
...
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
ffe1a24d
h2/src/main/org/h2/res/help.csv
浏览文件 @
ffe1a24d
...
...
@@ -1408,7 +1408,8 @@ Returns the name of the default schema for this session."
"Functions (System)","SCOPE_IDENTITY","
SCOPE_IDENTITY()
","
Returns the last inserted identity value for this session for the current scope."
Returns the last inserted identity value for this session for the current scope
(ie."
"Functions (System)","SESSION_ID","
SESSION_ID()
","
...
...
h2/src/main/org/h2/server/web/WebServer.java
浏览文件 @
ffe1a24d
...
...
@@ -48,8 +48,6 @@ import org.h2.util.Utils;
*/
public
class
WebServer
implements
Service
{
private
static
final
String
COMMAND_HISTORY
=
"commandHistory"
;
static
final
String
TRANSFER
=
"transfer"
;
static
final
String
[][]
LANGUAGES
=
{
...
...
@@ -75,6 +73,8 @@ public class WebServer implements Service {
{
"zh_TW"
,
"\u4e2d\u6587 (\u7e41\u9ad4)"
},
};
private
static
final
String
COMMAND_HISTORY
=
"commandHistory"
;
private
static
final
String
DEFAULT_LANGUAGE
=
"en"
;
private
static
final
String
[]
GENERIC
=
{
...
...
@@ -549,10 +549,12 @@ public class WebServer implements Service {
return
result
;
}
// Split the commandHistoryString on non-escaped semicolons and unescape it.
// Split the commandHistoryString on non-escaped semicolons
// and unescape it.
StringBuilder
sb
=
new
StringBuilder
();
for
(
int
end
=
0
;
;
end
++)
{
if
(
end
==
commandHistoryString
.
length
()
||
commandHistoryString
.
charAt
(
end
)
==
';'
)
{
for
(
int
end
=
0
;;
end
++)
{
if
(
end
==
commandHistoryString
.
length
()
||
commandHistoryString
.
charAt
(
end
)
==
';'
)
{
if
(
sb
.
length
()
>
0
)
{
result
.
add
(
sb
.
toString
());
sb
.
delete
(
0
,
sb
.
length
());
...
...
@@ -560,16 +562,21 @@ public class WebServer implements Service {
if
(
end
==
commandHistoryString
.
length
())
{
break
;
}
}
else
if
(
commandHistoryString
.
charAt
(
end
)
==
'\\'
&&
end
<
commandHistoryString
.
length
()
-
1
)
{
}
else
if
(
commandHistoryString
.
charAt
(
end
)
==
'\\'
&&
end
<
commandHistoryString
.
length
()
-
1
)
{
sb
.
append
(
commandHistoryString
.
charAt
(++
end
));
}
else
{
sb
.
append
(
commandHistoryString
.
charAt
(
end
));
}
}
return
result
;
}
/**
* Save the command history to the properties file.
*
* @param commandHistory the history
*/
public
void
saveCommandHistoryList
(
ArrayList
<
String
>
commandHistory
)
{
StringBuilder
sb
=
new
StringBuilder
();
for
(
String
s
:
commandHistory
)
{
...
...
h2/src/main/org/h2/server/web/WebSession.java
浏览文件 @
ffe1a24d
...
...
@@ -67,7 +67,8 @@ class WebSession {
WebSession
(
WebServer
server
)
{
this
.
server
=
server
;
// This must be stored in the session rather than in the server.
// Otherwise, one client could allow saving history for others (insecure).
// Otherwise, one client could allow
// saving history for others (insecure).
this
.
commandHistory
=
server
.
getCommandHistoryList
();
}
...
...
h2/src/test/org/h2/test/db/TestCluster.java
浏览文件 @
ffe1a24d
...
...
@@ -280,7 +280,6 @@ public class TestCluster extends TestBase {
conn
=
getConnection
(
urlCluster
,
user
,
password
);
Properties
p
=
conn
.
getClientInfo
();
assertEquals
(
"2"
,
p
.
getProperty
(
"numServers"
));
assertEquals
(
"127.0.0.1:"
+
port1
,
p
.
getProperty
(
"server0"
));
assertEquals
(
"127.0.0.1:"
+
port2
,
p
.
getProperty
(
"server1"
));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论