Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
Practical-Cryptdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhaozhen
Practical-Cryptdb
Commits
4b849d18
Commit
4b849d18
authored
Apr 26, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
able to process multiple table in tools/final_load&store,to be tested
parent
cacaa34f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
85 deletions
+136
-85
biotest.cc
test_redisbio/biotest.cc
+8
-4
final_load.cc
tools/final_load.cc
+116
-81
reuse.hh
wrapper/reuse.hh
+12
-0
No files found.
test_redisbio/biotest.cc
View file @
4b849d18
...
@@ -15,13 +15,13 @@ work(unsigned long id, void *input){
...
@@ -15,13 +15,13 @@ work(unsigned long id, void *input){
if
(
task
->
stop
==
1
)
return
1
;
if
(
task
->
stop
==
1
)
return
1
;
char
*
query
=
(
char
*
)(
task
->
arg1
);
char
*
query
=
(
char
*
)(
task
->
arg1
);
(
void
)
query
;
(
void
)
query
;
// printf("id=%lu %s\n",id,query);
return
0
;
return
0
;
}
}
int
int
main
(){
main
(){
userFunction
=
work
;
userFunction
=
work
;
//create threads, and each thread is waitting for the jobs, each thread has one queue.
bioInit
();
bioInit
();
std
::
vector
<
std
::
string
>
input
{
std
::
vector
<
std
::
string
>
input
{
"a"
,
"a"
,
...
@@ -35,16 +35,20 @@ main(){
...
@@ -35,16 +35,20 @@ main(){
"i"
,
"i"
,
"j"
"j"
};
};
int
type
=
0
;
int
type
=
0
;
for
(
int
i
=
0
;
i
<
10000
;
i
++
)
{
for
(
int
i
=
0
;
i
<
10000
;
i
++
)
{
//send to thread, whose number is type; arg1 is (input[i%10].c_str()) and arg2 is NULL
//the thread can extract the two arguments from JOB
bioCreateBackgroundJob
(
type
,(
input
[
i
%
10
].
c_str
()),
NULL
,
0
);
bioCreateBackgroundJob
(
type
,(
input
[
i
%
10
].
c_str
()),
NULL
,
0
);
type
+=
1
;
type
+=
REDIS_BIO_NUM_OPS
;
type
%=
10
;
type
%=
10
;
}
}
//Send 1 to stop the threads
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
bioCreateBackgroundJob
(
type
,
NULL
,
NULL
,
1
);
bioCreateBackgroundJob
(
type
,
NULL
,
NULL
,
1
);
type
+=
1
;
type
+=
1
;
type
%=
10
;
type
%=
REDIS_BIO_NUM_OPS
;
}
}
printf
(
"tobe joined
\n
"
);
printf
(
"tobe joined
\n
"
);
bioKillThreads
();
bioKillThreads
();
...
...
tools/final_load.cc
View file @
4b849d18
This diff is collapsed.
Click to expand it.
wrapper/reuse.hh
View file @
4b849d18
...
@@ -72,12 +72,22 @@ struct FieldMeta_Wrapper{
...
@@ -72,12 +72,22 @@ struct FieldMeta_Wrapper{
/*Transformed version of FieldMeta*/
/*Transformed version of FieldMeta*/
class
FieldMetaTrans
{
class
FieldMetaTrans
{
public
:
//??
enum
class
FILEFORMAT
{
ESP_STRING
,
NUM_STRING
,
NUM_BINARY
};
private
:
FieldMeta
*
originalFm
;
FieldMeta
*
originalFm
;
bool
hasSalt
;
bool
hasSalt
;
std
::
string
saltName
;
std
::
string
saltName
;
int
saltType
;
int
saltType
;
int
saltLength
;
int
saltLength
;
FILEFORMAT
fieldStoreFormat
;
std
::
vector
<
OnionMeta
*>
onionsOm
;
std
::
vector
<
OnionMeta
*>
onionsOm
;
std
::
vector
<
onion
>
onionsO
;
std
::
vector
<
onion
>
onionsO
;
std
::
vector
<
std
::
string
>
onionsName
;
std
::
vector
<
std
::
string
>
onionsName
;
...
@@ -89,6 +99,8 @@ class FieldMetaTrans{
...
@@ -89,6 +99,8 @@ class FieldMetaTrans{
std
::
vector
<
int
>
choosenFieldTypes
;
std
::
vector
<
int
>
choosenFieldTypes
;
std
::
vector
<
int
>
choosenFieldLengths
;
std
::
vector
<
int
>
choosenFieldLengths
;
public
:
public
:
FILEFORMAT
getFeidlStoreFormat
(){
return
fieldStoreFormat
;}
bool
setFieldStoreFormat
(
FILEFORMAT
f
){
fieldStoreFormat
=
f
;
return
true
;}
FieldMeta
*
getOriginalFieldMeta
(){
return
originalFm
;}
FieldMeta
*
getOriginalFieldMeta
(){
return
originalFm
;}
void
showChoosenOnionO
(){
std
::
cout
<<
"for field "
<<
originalFm
->
getFieldName
()
<<
std
::
endl
;
void
showChoosenOnionO
(){
std
::
cout
<<
"for field "
<<
originalFm
->
getFieldName
()
<<
std
::
endl
;
for
(
auto
item
:
choosenOnionO
){
for
(
auto
item
:
choosenOnionO
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment