Commit f6d8e000 authored by yiwenshao's avatar yiwenshao

able to use log

parent aa8cad5e
...@@ -7,9 +7,9 @@ useSWP:true ...@@ -7,9 +7,9 @@ useSWP:true
useDET:true useDET:true
useSalt:true useSalt:true
#NA,MIN,MIDEAN,FULL #NA,MIN,MIDEAN,FULL
BS_STR:MIN BS_STR:FULL
BS_IA:NA BS_IA:NA
BS_IH:MIN BS_IH:FULL
#true or false #true or false
USE_ASHE:true USE_ASHE:true
other:1 other:1
...@@ -121,7 +121,8 @@ std::shared_ptr<ReturnMeta> getReturnMeta(std::vector<FieldMeta*> fms, ...@@ -121,7 +121,8 @@ std::shared_ptr<ReturnMeta> getReturnMeta(std::vector<FieldMeta*> fms,
onion o = tfds[i].getChoosenOnionO()[index]; 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(); SECLEVEL l = tfds[i].getOriginalFieldMeta()->getOnionMeta(o)->getSecLevel();
FieldMeta *k = tfds[i].getOriginalFieldMeta(); FieldMeta *k = tfds[i].getOriginalFieldMeta();
...@@ -160,13 +161,23 @@ static ResType load_files_new(std::string db, std::string table){ ...@@ -160,13 +161,23 @@ static ResType load_files_new(std::string db, std::string table){
for(unsigned int i=0;i<fms.size();i++){ for(unsigned int i=0;i<fms.size();i++){
fmts[i].trans(fms[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); 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<string> field_names;
vector<int> field_types; vector<int> field_types;
vector<int> field_lengths; vector<int> field_lengths;
std::shared_ptr<ReturnMeta> rm = getReturnMeta(fms,fmts,field_names,field_types,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); create_embedded_thd(0);
rawMySQLReturnValue resraw; rawMySQLReturnValue resraw;
vector<vector<string>> res_field; vector<vector<string>> res_field;
...@@ -197,10 +208,17 @@ static ResType load_files_new(std::string db, std::string table){ ...@@ -197,10 +208,17 @@ static ResType load_files_new(std::string db, std::string table){
} }
ResType rawtorestype = rawMySQLReturnValue_to_ResType(false, &resraw); 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); auto finalresults = decryptResults(rawtorestype,*rm);
rawMySQLReturnValue MM; *glog<<"decryption: "<<
ResTypeToRawMySQLReturnValue(MM,finalresults); std::to_string(t_load_files.lap()/1000000u)<<
" "<<std::to_string(time(NULL))<<"\n";
// rawMySQLReturnValue MM;
// ResTypeToRawMySQLReturnValue(MM,finalresults);
return finalresults; return finalresults;
//return ResType(false, 0, 0); //return ResType(false, 0, 0);
} }
...@@ -281,7 +299,7 @@ List<Item> * processRow(const std::vector<Item *> &row, ...@@ -281,7 +299,7 @@ List<Item> * processRow(const std::vector<Item *> &row,
static static
std::map<std::string,std::string> std::map<std::string,std::string>
parseArgv(int argc, char* argv[]){ parseArgv(int argc, char* argv[]){
POINT //POINT
assert(argc%2==1); assert(argc%2==1);
std::map<std::string,std::string> res; std::map<std::string,std::string> res;
for(int i=1;i<argc;){ for(int i=1;i<argc;){
...@@ -312,7 +330,15 @@ main(int argc, char* argv[]){ ...@@ -312,7 +330,15 @@ main(int argc, char* argv[]){
Analysis analysis(db, *schema, TK, SECURITY_RATING::SENSITIVE); Analysis analysis(db, *schema, TK, SECURITY_RATING::SENSITIVE);
logToFile ll(table+logfileName); logToFile ll(table+logfileName);
glog = &ll; glog = &ll;
*glog<<"loadSchema: "<<
std::to_string(t_init.lap()/1000000u)<<
" "<<std::to_string(time(NULL))<<"\n";
ResType res = load_files_new(db,table); 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()){ if(!res.success()){
*glog<<"empty table \n"; *glog<<"empty table \n";
return 0; return 0;
...@@ -320,7 +346,7 @@ main(int argc, char* argv[]){ ...@@ -320,7 +346,7 @@ main(int argc, char* argv[]){
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+"` ";
unsigned int i=0u; unsigned int i=0u;
UNUSED(i);
while(true){ while(true){
List<List_item> newList; List<List_item> newList;
int localCount=0; int localCount=0;
...@@ -347,8 +373,16 @@ main(int argc, char* argv[]){ ...@@ -347,8 +373,16 @@ main(int argc, char* argv[]){
break; break;
} }
} }
UNUSED(load_files_new); *glog<<"construct: "<<
UNUSED(processRow); 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; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment