Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
pulsar
提交
de24aaf1
pulsar
项目概览
apache
/
pulsar
通知
129
Star
40
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
pulsar
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
de24aaf1
编写于
8月 09, 2017
作者:
H
hrsakai
提交者:
Matteo Merli
8月 08, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support tls in performance tool (#662)
上级
005aa12d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
59 addition
and
2 deletion
+59
-2
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceConsumer.java
...ava/org/apache/pulsar/testclient/PerformanceConsumer.java
+20
-1
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java
...ava/org/apache/pulsar/testclient/PerformanceProducer.java
+19
-0
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceReader.java
.../java/org/apache/pulsar/testclient/PerformanceReader.java
+20
-1
未找到文件。
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceConsumer.java
浏览文件 @
de24aaf1
...
...
@@ -18,6 +18,7 @@
*/
package
org.apache.pulsar.testclient
;
import
static
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
;
import
static
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
;
import
java.io.FileInputStream
;
...
...
@@ -100,6 +101,14 @@ public class PerformanceConsumer {
@Parameter
(
names
=
{
"--auth_params"
},
description
=
"Authentication parameters, e.g., \"key1:val1,key2:val2\""
)
public
String
authParams
;
@Parameter
(
names
=
{
"--use-tls"
},
description
=
"Use TLS encryption on the connection"
)
public
boolean
useTls
;
@Parameter
(
names
=
{
"--trust-cert-file"
},
description
=
"Path for the trusted TLS certificate file"
)
public
String
tlsTrustCertsFilePath
=
""
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
...
...
@@ -150,6 +159,14 @@ public class PerformanceConsumer {
if
(
arguments
.
authParams
==
null
)
{
arguments
.
authParams
=
prop
.
getProperty
(
"authParams"
,
null
);
}
if
(
arguments
.
useTls
==
false
)
{
arguments
.
useTls
=
Boolean
.
parseBoolean
(
prop
.
getProperty
(
"useTls"
));
}
if
(
isBlank
(
arguments
.
tlsTrustCertsFilePath
))
{
arguments
.
tlsTrustCertsFilePath
=
prop
.
getProperty
(
"tlsTrustCertsFilePath"
,
""
);
}
}
// Dump config variables
...
...
@@ -181,6 +198,8 @@ public class PerformanceConsumer {
if
(
isNotBlank
(
arguments
.
authPluginClassName
))
{
clientConf
.
setAuthentication
(
arguments
.
authPluginClassName
,
arguments
.
authParams
);
}
clientConf
.
setUseTls
(
arguments
.
useTls
);
clientConf
.
setTlsTrustCertsFilePath
(
arguments
.
tlsTrustCertsFilePath
);
PulsarClient
pulsarClient
=
new
PulsarClientImpl
(
arguments
.
serviceURL
,
clientConf
);
List
<
Future
<
Consumer
>>
futures
=
Lists
.
newArrayList
();
...
...
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java
浏览文件 @
de24aaf1
...
...
@@ -19,6 +19,7 @@
package
org.apache.pulsar.testclient
;
import
static
java
.
util
.
concurrent
.
TimeUnit
.
NANOSECONDS
;
import
static
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
;
import
static
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
;
import
java.io.FileInputStream
;
...
...
@@ -132,6 +133,14 @@ public class PerformanceProducer {
@Parameter
(
names
=
{
"-time"
,
"--test-duration"
},
description
=
"Test duration in secs. If 0, it will keep publishing"
)
public
long
testTime
=
0
;
@Parameter
(
names
=
{
"--use-tls"
},
description
=
"Use TLS encryption on the connection"
)
public
boolean
useTls
;
@Parameter
(
names
=
{
"--trust-cert-file"
},
description
=
"Path for the trusted TLS certificate file"
)
public
String
tlsTrustCertsFilePath
=
""
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
...
...
@@ -182,6 +191,14 @@ public class PerformanceProducer {
if
(
arguments
.
authParams
==
null
)
{
arguments
.
authParams
=
prop
.
getProperty
(
"authParams"
,
null
);
}
if
(
arguments
.
useTls
==
false
)
{
arguments
.
useTls
=
Boolean
.
parseBoolean
(
prop
.
getProperty
(
"useTls"
));
}
if
(
isBlank
(
arguments
.
tlsTrustCertsFilePath
))
{
arguments
.
tlsTrustCertsFilePath
=
prop
.
getProperty
(
"tlsTrustCertsFilePath"
,
""
);
}
}
arguments
.
testTime
=
TimeUnit
.
SECONDS
.
toMillis
(
arguments
.
testTime
);
...
...
@@ -210,6 +227,8 @@ public class PerformanceProducer {
if
(
isNotBlank
(
arguments
.
authPluginClassName
))
{
clientConf
.
setAuthentication
(
arguments
.
authPluginClassName
,
arguments
.
authParams
);
}
clientConf
.
setUseTls
(
arguments
.
useTls
);
clientConf
.
setTlsTrustCertsFilePath
(
arguments
.
tlsTrustCertsFilePath
);
PulsarClient
client
=
new
PulsarClientImpl
(
arguments
.
serviceURL
,
clientConf
);
...
...
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceReader.java
浏览文件 @
de24aaf1
...
...
@@ -18,6 +18,7 @@
*/
package
org.apache.pulsar.testclient
;
import
static
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
;
import
static
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
;
import
java.io.FileInputStream
;
...
...
@@ -95,6 +96,14 @@ public class PerformanceReader {
@Parameter
(
names
=
{
"--auth-params"
},
description
=
"Authentication parameters, e.g., \"key1:val1,key2:val2\""
)
public
String
authParams
;
@Parameter
(
names
=
{
"--use-tls"
},
description
=
"Use TLS encryption on the connection"
)
public
boolean
useTls
;
@Parameter
(
names
=
{
"--trust-cert-file"
},
description
=
"Path for the trusted TLS certificate file"
)
public
String
tlsTrustCertsFilePath
=
""
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
...
...
@@ -145,6 +154,14 @@ public class PerformanceReader {
if
(
arguments
.
authParams
==
null
)
{
arguments
.
authParams
=
prop
.
getProperty
(
"authParams"
,
null
);
}
if
(
arguments
.
useTls
==
false
)
{
arguments
.
useTls
=
Boolean
.
parseBoolean
(
prop
.
getProperty
(
"useTls"
));
}
if
(
isBlank
(
arguments
.
tlsTrustCertsFilePath
))
{
arguments
.
tlsTrustCertsFilePath
=
prop
.
getProperty
(
"tlsTrustCertsFilePath"
,
""
);
}
}
// Dump config variables
...
...
@@ -172,6 +189,8 @@ public class PerformanceReader {
if
(
isNotBlank
(
arguments
.
authPluginClassName
))
{
clientConf
.
setAuthentication
(
arguments
.
authPluginClassName
,
arguments
.
authParams
);
}
clientConf
.
setUseTls
(
arguments
.
useTls
);
clientConf
.
setTlsTrustCertsFilePath
(
arguments
.
tlsTrustCertsFilePath
);
PulsarClient
pulsarClient
=
new
PulsarClientImpl
(
arguments
.
serviceURL
,
clientConf
);
List
<
CompletableFuture
<
Reader
>>
futures
=
Lists
.
newArrayList
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录