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
6fd756df
Commit
6fd756df
authored
Jan 26, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add log for final_load
parent
2596e747
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
375 additions
and
40 deletions
+375
-40
final_load.cc
debug/final_load.cc
+15
-40
final_load.cc.back
debug/final_load.cc.back
+360
-0
No files found.
debug/final_load.cc
View file @
6fd756df
...
@@ -15,6 +15,9 @@
...
@@ -15,6 +15,9 @@
#include "wrapper/common.hh"
#include "wrapper/common.hh"
#include "wrapper/insert_lib.hh"
#include "wrapper/insert_lib.hh"
#include "util/constants.hh"
#include "util/constants.hh"
#include "util/timer.hh"
#include "util/log.hh"
using
std
::
cout
;
using
std
::
cout
;
using
std
::
cin
;
using
std
::
cin
;
using
std
::
endl
;
using
std
::
endl
;
...
@@ -26,6 +29,17 @@ char * globalEsp=NULL;
...
@@ -26,6 +29,17 @@ char * globalEsp=NULL;
int
num_of_pipe
=
4
;
int
num_of_pipe
=
4
;
//global map, for each client, we have one WrapperState which contains ProxyState.
//global map, for each client, we have one WrapperState which contains ProxyState.
static
std
::
map
<
std
::
string
,
WrapperState
*>
clients
;
static
std
::
map
<
std
::
string
,
WrapperState
*>
clients
;
static
std
::
string
logfilePrefix
=
"final_load"
;
static
std
::
string
logfileName
=
logfilePrefix
+
constGlobalConstants
.
logFile
+
std
::
to_string
(
time
(
NULL
));
static
logToFile
glog
(
logfileName
);
//This connection mimics the behaviour of MySQL-Proxy
//This connection mimics the behaviour of MySQL-Proxy
Connect
*
globalConn
;
Connect
*
globalConn
;
/*for each field, convert the format to FieldMeta_Wrapper*/
/*for each field, convert the format to FieldMeta_Wrapper*/
...
@@ -279,54 +293,15 @@ main(int argc, char* argv[]){
...
@@ -279,54 +293,15 @@ main(int argc, char* argv[]){
db
=
std
::
string
(
argv
[
2
]);
db
=
std
::
string
(
argv
[
2
]);
table
=
std
::
string
(
argv
[
3
]);
table
=
std
::
string
(
argv
[
3
]);
}
}
std
::
unique_ptr
<
SchemaInfo
>
schema
=
myLoadSchemaInfo
(
embeddedDir
);
std
::
unique_ptr
<
SchemaInfo
>
schema
=
myLoadSchemaInfo
(
embeddedDir
);
schema
.
get
();
schema
.
get
();
const
std
::
unique_ptr
<
AES_KEY
>
&
TK
=
std
::
unique_ptr
<
AES_KEY
>
(
getKey
(
std
::
string
(
"113341234"
)));
const
std
::
unique_ptr
<
AES_KEY
>
&
TK
=
std
::
unique_ptr
<
AES_KEY
>
(
getKey
(
std
::
string
(
"113341234"
)));
Analysis
analysis
(
db
,
*
schema
,
TK
,
SECURITY_RATING
::
SENSITIVE
);
Analysis
analysis
(
db
,
*
schema
,
TK
,
SECURITY_RATING
::
SENSITIVE
);
/*choose decryption onion, load and decrypt to plain text*/
/*choose decryption onion, load and decrypt to plain text*/
ResType
res
=
load_files
(
db
,
table
);
ResType
res
=
load_files
(
db
,
table
);
std
::
string
annoTableName
=
analysis
.
getTableMeta
(
db
,
table
).
getAnonTableName
();
std
::
string
annoTableName
=
analysis
.
getTableMeta
(
db
,
table
).
getAnonTableName
();
const
std
::
string
head
=
std
::
string
(
"INSERT INTO `"
)
+
db
+
"`.`"
+
annoTableName
+
"` "
;
const
std
::
string
head
=
std
::
string
(
"INSERT INTO `"
)
+
db
+
"`.`"
+
annoTableName
+
"` "
;
/*reencryption to get the encrypted insert!!!*/
/*reencryption to get the encrypted insert!!!*/
/* int currentCount=0;
List<List_item> newList;
for(auto &row:res.rows) {
List<Item> * newList0 = new List<Item>();
for(auto i=0u;i<res.names.size();i++) {
std::string field_name = res.names[i];
FieldMeta & fm = analysis.getFieldMeta(db,table,field_name);
local_wrapper(*row[i],fm,analysis,newList0);
}
newList.push_back(newList0);
currentCount++;
if(currentCount==constGlobalConstants.pipelineCount){
currentCount=0;
std::ostringstream o;
insertManyValues(o,newList);
std::cout<<(head+o.str())<<std::endl;
//newList = List<List_item>();
}
} */
/* if(currentCount!=0){
std::ostringstream o;
insertManyValues(o,newList);
std::cout<<(head+o.str())<<std::endl;
}*/
/* for(auto &row:res.rows) {
List<List_item> newList;
List<Item> * newList0 = processRow(row,res.names,analysis,db,table);
newList.push_back(newList0);
std::ostringstream o;
insertManyValues(o,newList);
std::cout<<(head+o.str())<<std::endl;
}
*/
unsigned
int
i
=
0u
;
unsigned
int
i
=
0u
;
while
(
true
){
while
(
true
){
List
<
List_item
>
newList
;
List
<
List_item
>
newList
;
...
@@ -354,7 +329,7 @@ main(int argc, char* argv[]){
...
@@ -354,7 +329,7 @@ main(int argc, char* argv[]){
break
;
break
;
}
}
}
}
// std::cout<<"gcount<<"<<gcount<<std::endl
;
glog
<<
std
::
string
(
"gcount<<"
)
<<
std
::
to_string
(
gcount
)
<<
std
::
string
(
"
\n
"
)
;
return
0
;
return
0
;
}
}
debug/final_load.cc.back
0 → 100644
View file @
6fd756df
This diff is collapsed.
Click to expand it.
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