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
f6d8e000
Commit
f6d8e000
authored
May 20, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
able to use log
parent
aa8cad5e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
12 deletions
+46
-12
global.constant
conf/global.constant
+2
-2
simple_load_new.cc
tools/simple_load_new.cc
+44
-10
No files found.
conf/global.constant
View file @
f6d8e000
...
...
@@ -7,9 +7,9 @@ useSWP:true
useDET:true
useSalt:true
#NA,MIN,MIDEAN,FULL
BS_STR:
MIN
BS_STR:
FULL
BS_IA:NA
BS_IH:
MIN
BS_IH:
FULL
#true or false
USE_ASHE:true
other:1
tools/simple_load_new.cc
View file @
f6d8e000
...
...
@@ -121,7 +121,8 @@ std::shared_ptr<ReturnMeta> getReturnMeta(std::vector<FieldMeta*> fms,
onion
o
=
tfds
[
i
].
getChoosenOnionO
()[
index
];
*
glog
<<
"choosenDecryptionOnion: "
<<
TypeText
<
onion
>::
toText
(
o
)
<<
"
\n
"
;
*
glog
<<
"field: "
<<
tfds
[
i
].
getOriginalFieldMeta
()
->
getFieldName
()
<<
" choosenDecryptionOnion: "
<<
TypeText
<
onion
>::
toText
(
o
)
<<
"
\n
"
;
SECLEVEL
l
=
tfds
[
i
].
getOriginalFieldMeta
()
->
getOnionMeta
(
o
)
->
getSecLevel
();
FieldMeta
*
k
=
tfds
[
i
].
getOriginalFieldMeta
();
...
...
@@ -160,13 +161,23 @@ static ResType load_files_new(std::string db, std::string table){
for
(
unsigned
int
i
=
0
;
i
<
fms
.
size
();
i
++
){
fmts
[
i
].
trans
(
fms
[
i
]);
}
mf
.
show
();
*
glog
<<
"loadtablemeta: "
<<
std
::
to_string
(
t_load_files
.
lap
()
/
1000000u
)
<<
" "
<<
std
::
to_string
(
time
(
NULL
))
<<
"
\n
"
;
// mf.show();
load_columns
(
fmts
,
db
,
table
);
*
glog
<<
"loadcolumns: "
<<
std
::
to_string
(
t_load_files
.
lap
()
/
1000000u
)
<<
" "
<<
std
::
to_string
(
time
(
NULL
))
<<
"
\n
"
;
vector
<
string
>
field_names
;
vector
<
int
>
field_types
;
vector
<
int
>
field_lengths
;
std
::
shared_ptr
<
ReturnMeta
>
rm
=
getReturnMeta
(
fms
,
fmts
,
field_names
,
field_types
,
field_lengths
);
UNUSED
(
rm
);
*
glog
<<
"getreturnmeta: "
<<
std
::
to_string
(
t_load_files
.
lap
()
/
1000000u
)
<<
" "
<<
std
::
to_string
(
time
(
NULL
))
<<
"
\n
"
;
create_embedded_thd
(
0
);
rawMySQLReturnValue
resraw
;
vector
<
vector
<
string
>>
res_field
;
...
...
@@ -197,10 +208,17 @@ static ResType load_files_new(std::string db, std::string table){
}
ResType
rawtorestype
=
rawMySQLReturnValue_to_ResType
(
false
,
&
resraw
);
UNUSED
(
rawtorestype
);
*
glog
<<
"transform: "
<<
std
::
to_string
(
t_load_files
.
lap
()
/
1000000u
)
<<
" "
<<
std
::
to_string
(
time
(
NULL
))
<<
"
\n
"
;
auto
finalresults
=
decryptResults
(
rawtorestype
,
*
rm
);
rawMySQLReturnValue
MM
;
ResTypeToRawMySQLReturnValue
(
MM
,
finalresults
);
*
glog
<<
"decryption: "
<<
std
::
to_string
(
t_load_files
.
lap
()
/
1000000u
)
<<
" "
<<
std
::
to_string
(
time
(
NULL
))
<<
"
\n
"
;
// rawMySQLReturnValue MM;
// ResTypeToRawMySQLReturnValue(MM,finalresults);
return
finalresults
;
//return ResType(false, 0, 0);
}
...
...
@@ -281,7 +299,7 @@ List<Item> * processRow(const std::vector<Item *> &row,
static
std
::
map
<
std
::
string
,
std
::
string
>
parseArgv
(
int
argc
,
char
*
argv
[]){
POINT
//
POINT
assert
(
argc
%
2
==
1
);
std
::
map
<
std
::
string
,
std
::
string
>
res
;
for
(
int
i
=
1
;
i
<
argc
;){
...
...
@@ -312,7 +330,15 @@ main(int argc, char* argv[]){
Analysis
analysis
(
db
,
*
schema
,
TK
,
SECURITY_RATING
::
SENSITIVE
);
logToFile
ll
(
table
+
logfileName
);
glog
=
&
ll
;
*
glog
<<
"loadSchema: "
<<
std
::
to_string
(
t_init
.
lap
()
/
1000000u
)
<<
" "
<<
std
::
to_string
(
time
(
NULL
))
<<
"
\n
"
;
ResType
res
=
load_files_new
(
db
,
table
);
*
glog
<<
"loadFile: "
<<
std
::
to_string
(
t_init
.
lap
()
/
1000000u
)
<<
" "
<<
std
::
to_string
(
time
(
NULL
))
<<
"
\n
"
;
if
(
!
res
.
success
()){
*
glog
<<
"empty table
\n
"
;
return
0
;
...
...
@@ -320,7 +346,7 @@ main(int argc, char* argv[]){
std
::
string
annoTableName
=
analysis
.
getTableMeta
(
db
,
table
).
getAnonTableName
();
const
std
::
string
head
=
std
::
string
(
"INSERT INTO `"
)
+
db
+
"`.`"
+
annoTableName
+
"` "
;
unsigned
int
i
=
0u
;
UNUSED
(
i
);
while
(
true
){
List
<
List_item
>
newList
;
int
localCount
=
0
;
...
...
@@ -347,8 +373,16 @@ main(int argc, char* argv[]){
break
;
}
}
UNUSED
(
load_files_new
);
UNUSED
(
processRow
);
*
glog
<<
"construct: "
<<
std
::
to_string
(
t_init
.
lap
()
/
1000000u
)
<<
" "
<<
std
::
to_string
(
time
(
NULL
))
<<
"
\n
"
;
for
(
auto
item
:
gcountMap
)
{
*
glog
<<
"onionComputed: "
<<
TypeText
<
onion
>::
toText
(
item
.
first
)
<<
"::"
<<
std
::
to_string
(
item
.
second
)
<<
"
\n
"
;
}
return
0
;
}
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