Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
2eeaa754
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2eeaa754
编写于
7月 16, 2020
作者:
B
barrierye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change param endpoints in connect function to target
上级
87fddeea
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
19 deletion
+20
-19
java/examples/src/main/java/PaddleServingClientExample.java
java/examples/src/main/java/PaddleServingClientExample.java
+15
-13
java/src/main/java/io/paddle/serving/client/Client.java
java/src/main/java/io/paddle/serving/client/Client.java
+5
-6
未找到文件。
java/examples/src/main/java/PaddleServingClientExample.java
浏览文件 @
2eeaa754
...
...
@@ -17,8 +17,8 @@ public class PaddleServingClientExample {
List
<
String
>
fetch
=
Arrays
.
asList
(
"price"
);
Client
client
=
new
Client
();
List
<
String
>
endpoints
=
Arrays
.
asList
(
"localhost:9393"
)
;
boolean
succ
=
client
.
connect
(
endpoints
);
String
target
=
"localhost:9393"
;
boolean
succ
=
client
.
connect
(
target
);
if
(
succ
!=
true
)
{
System
.
out
.
println
(
"connect failed."
);
return
false
;
...
...
@@ -52,8 +52,8 @@ public class PaddleServingClientExample {
List
<
String
>
fetch
=
Arrays
.
asList
(
"price"
);
Client
client
=
new
Client
();
List
<
String
>
endpoints
=
Arrays
.
asList
(
"localhost:9393"
)
;
boolean
succ
=
client
.
connect
(
endpoints
);
String
target
=
"localhost:9393"
;
boolean
succ
=
client
.
connect
(
target
);
if
(
succ
!=
true
)
{
System
.
out
.
println
(
"connect failed."
);
return
false
;
...
...
@@ -82,8 +82,8 @@ public class PaddleServingClientExample {
List
<
String
>
fetch
=
Arrays
.
asList
(
"price"
);
Client
client
=
new
Client
();
List
<
String
>
endpoints
=
Arrays
.
asList
(
"localhost:9393"
)
;
boolean
succ
=
client
.
connect
(
endpoints
);
String
target
=
"localhost:9393"
;
boolean
succ
=
client
.
connect
(
target
);
if
(
succ
!=
true
)
{
System
.
out
.
println
(
"connect failed."
);
return
false
;
...
...
@@ -112,8 +112,8 @@ public class PaddleServingClientExample {
List
<
String
>
fetch
=
Arrays
.
asList
(
"prediction"
);
Client
client
=
new
Client
();
List
<
String
>
endpoints
=
Arrays
.
asList
(
"localhost:9393"
)
;
boolean
succ
=
client
.
connect
(
endpoints
);
String
target
=
"localhost:9393"
;
boolean
succ
=
client
.
connect
(
target
);
if
(
succ
!=
true
)
{
System
.
out
.
println
(
"connect failed."
);
return
false
;
...
...
@@ -150,8 +150,8 @@ public class PaddleServingClientExample {
List
<
String
>
fetch
=
Arrays
.
asList
(
"pooled_output"
);
Client
client
=
new
Client
();
List
<
String
>
endpoints
=
Arrays
.
asList
(
"localhost:9393"
)
;
boolean
succ
=
client
.
connect
(
endpoints
);
String
target
=
"localhost:9393"
;
boolean
succ
=
client
.
connect
(
target
);
if
(
succ
!=
true
)
{
System
.
out
.
println
(
"connect failed."
);
return
false
;
...
...
@@ -231,8 +231,8 @@ public class PaddleServingClientExample {
List
<
String
>
fetch
=
Arrays
.
asList
(
"prob"
);
Client
client
=
new
Client
();
List
<
String
>
endpoints
=
Arrays
.
asList
(
"localhost:9292"
)
;
boolean
succ
=
client
.
connect
(
endpoints
);
String
target
=
"localhost:9393"
;
boolean
succ
=
client
.
connect
(
target
);
if
(
succ
!=
true
)
{
System
.
out
.
println
(
"connect failed."
);
return
false
;
...
...
@@ -269,9 +269,11 @@ public class PaddleServingClientExample {
succ
=
e
.
batch_predict
();
}
else
if
(
"cube_local"
.
equals
(
arg
))
{
succ
=
e
.
cube_local
();
}
else
if
(
"cube_quant"
.
equals
(
arg
))
{
succ
=
e
.
cube_local
();
}
else
{
System
.
out
.
format
(
"%s not match: java -cp <jar> PaddleServingClientExample <exp>.\n"
,
arg
);
System
.
out
.
println
(
"<exp>: fit_a_line bert model_ensemble asyn_predict batch_predict cube_local."
);
System
.
out
.
println
(
"<exp>: fit_a_line bert model_ensemble asyn_predict batch_predict cube_local
cube_quant
."
);
}
}
...
...
java/src/main/java/io/paddle/serving/client/Client.java
浏览文件 @
2eeaa754
...
...
@@ -109,10 +109,9 @@ public class Client {
return
resp
.
getErrCode
()
==
0
;
}
public
boolean
connect
(
List
<
String
>
endpoints
)
{
// TODO
//String target = "ipv4:" + String.join(",", endpoints);
String
target
=
endpoints
.
get
(
0
);
public
boolean
connect
(
String
target
)
{
// TODO: target must be NameResolver-compliant URI
// https://grpc.github.io/grpc-java/javadoc/io/grpc/ManagedChannelBuilder.html
try
{
channel_
=
ManagedChannelBuilder
.
forTarget
(
target
)
.
defaultLoadBalancingPolicy
(
"round_robin"
)
...
...
@@ -484,8 +483,8 @@ public class Client {
List
<
String
>
fetch
=
Arrays
.
asList
(
"price"
);
Client
client
=
new
Client
();
List
<
String
>
endpoints
=
Arrays
.
asList
(
"localhost:9393"
)
;
boolean
succ
=
client
.
connect
(
endpoint
s
);
String
endpoint
=
"localhost:9393"
;
boolean
succ
=
client
.
connect
(
endpoint
);
if
(
succ
!=
true
)
{
System
.
out
.
println
(
"connect failed."
);
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录