Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
b61f3de4
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看板
提交
b61f3de4
编写于
5月 27, 2019
作者:
W
wangjiawei04
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix icode error other than RULE103 & 069
Change-Id: Ie3d8315aad1826788211fd2842c823d01fd1f50a
上级
d7fd7c8d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
12 deletion
+14
-12
demo-client/src/echo_kvdb.cpp
demo-client/src/echo_kvdb.cpp
+4
-4
kvdb/include/kvdb/mock_kvdb_impl.h
kvdb/include/kvdb/mock_kvdb_impl.h
+1
-1
kvdb/src/gtest_db_thread.cpp
kvdb/src/gtest_db_thread.cpp
+3
-1
kvdb/src/mock_param_dict_impl.cpp
kvdb/src/mock_param_dict_impl.cpp
+6
-6
未找到文件。
demo-client/src/echo_kvdb.cpp
浏览文件 @
b61f3de4
...
...
@@ -38,7 +38,7 @@ int create_req(Request& req) { // NOLINT
key
=
req
.
mutable_reqs
()
->
Add
();
key
->
set_op
(
"GET"
);
key
->
set_key
(
std
::
to_string
(
global_key
));
global_key
++
;
global_key
++
;
return
0
;
}
...
...
@@ -47,7 +47,7 @@ void print_res(const Request& req,
std
::
string
route_tag
,
uint64_t
elapse_ms
)
{
LOG
(
INFO
)
<<
"Receive Response size: "
<<
res
.
ress_size
();
for
(
size_t
i
=
0
;
i
<
res
.
ress_size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
res
.
ress_size
();
i
++
)
{
KVDBRes
val
=
res
.
ress
(
i
);
LOG
(
INFO
)
<<
"Receive value from demo-server: "
<<
val
.
value
();
}
...
...
@@ -99,9 +99,9 @@ int main(int argc, char** argv) {
api
.
thrd_initialize
();
while
(
true
)
{
if
(
global_key
>
10000
)
if
(
global_key
>
10000
)
{
break
;
}
timeval
start
;
gettimeofday
(
&
start
,
NULL
);
...
...
kvdb/include/kvdb/mock_kvdb_impl.h
浏览文件 @
b61f3de4
...
...
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include "kvdb_impl.h"
#include "paddle_rocksdb.h"
class
RocksKVDB
:
public
AbstractKVDB
{
...
...
kvdb/src/gtest_db_thread.cpp
浏览文件 @
b61f3de4
...
...
@@ -27,8 +27,10 @@ protected:
}
static
void
SetUpTestCase
()
{
}
~
KVDBTest
()
{}
};
int
my_argc
;
...
...
kvdb/src/mock_param_dict_impl.cpp
浏览文件 @
b61f3de4
...
...
@@ -30,7 +30,7 @@ void MockDictReader::SetFileName(std::string filename) {
std
::
string
MockDictReader
::
GetMD5
()
{
auto
getCmdOut
=
[]
(
std
::
string
cmd
)
{
std
::
string
data
;
FILE
*
stream
;
FILE
*
stream
=
nullptr
;
const
int
max_buffer
=
256
;
char
buffer
[
max_buffer
];
cmd
.
append
(
" 2>&1"
);
...
...
@@ -110,12 +110,12 @@ bool MockParamDict::InsertSparseValue(int64_t feasign, int64_t slot, const std::
bool
MockParamDict
::
InsertSparseValue
(
std
::
string
feasign
,
std
::
string
slot
,
const
std
::
vector
<
float
>&
values
)
{
auto
FloatToBytes
=
[](
float
fvalue
,
uint8_t
*
arr
){
unsigned
char
*
pf
;
unsigned
char
*
px
;
unsigned
char
i
;
unsigned
char
*
pf
=
nullptr
;
unsigned
char
*
px
=
nullptr
;
unsigned
char
i
=
0
;
pf
=
(
unsigned
char
*
)
&
fvalue
;
px
=
arr
;
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
i
=
0
;
i
<
4
;
i
++
)
{
*
(
px
+
i
)
=*
(
pf
+
i
);
}
...
...
@@ -128,7 +128,7 @@ bool MockParamDict::InsertSparseValue(std::string feasign, std::string slot, con
FloatToBytes
(
values
[
i
],
values_ptr
+
4
*
i
);
}
char
*
raw_values_ptr
=
reinterpret_cast
<
char
*>
(
values_ptr
);
for
(
size_t
i
=
0
;
i
<
values
.
size
()
*
4
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
values
.
size
()
*
4
;
i
++
)
{
value
.
push_back
(
raw_values_ptr
[
i
]);
}
back_db
->
Set
(
key
,
value
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录