X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fftacmp%2Ftranslate_fta.cc;h=19ff6349ee040838f2820da8ad8b33dffd7e732e;hb=dec9c93423775db0f4783a93145f016d5d780ffd;hp=b6855ff8aea4bc965bf699f1003ccf88e820662d;hpb=eb761d89890df8d74532dd4faad118db18fd3b7d;p=com%2Fgs-lite.git diff --git a/src/ftacmp/translate_fta.cc b/src/ftacmp/translate_fta.cc index b6855ff..19ff634 100644 --- a/src/ftacmp/translate_fta.cc +++ b/src/ftacmp/translate_fta.cc @@ -55,6 +55,8 @@ Copyright 2014 AT&T Intellectual Property #include"xml_t.h" #include"field_list.h" +#include "gsconfig.h" + extern int xmlParserparse(void); extern FILE *xmlParserin; extern int xmlParserdebug; @@ -167,6 +169,7 @@ int main(int argc, char **argv){ vector registration_query_names; // for lfta.c registration map > mach_query_names; // list queries of machine vector snap_lengths; // for lfta.c registration + vector snap_position; // for lfta.c registration vector interface_names; // for lfta.c registration vector machine_names; // machine of interface vector lfta_reuse_options; // for lfta.c registration @@ -395,24 +398,26 @@ int main(int argc, char **argv){ while(fgets(tmpstr,TMPSTRLEN,osp_in)){ o_lineno++; int nflds = split_string(tmpstr,',',flds,MAXFLDS); - if(nflds == 7){ + if(tmpstr[0]!='\n' && tmpstr[0]!='\r' && tmpstr[0]!='\0' && tmpstr[0]!='#'){ + if(nflds == 7){ // make operator type lowercase - char *tmpc; - for(tmpc=flds[1];*tmpc!='\0';++tmpc) - *tmpc = tolower(*tmpc); - - ospec_str *tmp_ospec = new ospec_str(); - tmp_ospec->query = flds[0]; - tmp_ospec->operator_type = flds[1]; - tmp_ospec->operator_param = flds[2]; - tmp_ospec->output_directory = flds[3]; - tmp_ospec->bucketwidth = atoi(flds[4]); - tmp_ospec->partitioning_flds = flds[5]; - tmp_ospec->n_partitions = atoi(flds[6]); - qname_to_ospec.insert(pair(tmp_ospec->query,output_specs.size())); - output_specs.push_back(tmp_ospec); - }else{ - fprintf(stderr,"Warning, line %d corrupted in output_spec.cfg, has %d fields.\n",o_lineno,nflds); + char *tmpc; + for(tmpc=flds[1];*tmpc!='\0';++tmpc) + *tmpc = tolower(*tmpc); + + ospec_str *tmp_ospec = new ospec_str(); + tmp_ospec->query = flds[0]; + tmp_ospec->operator_type = flds[1]; + tmp_ospec->operator_param = flds[2]; + tmp_ospec->output_directory = flds[3]; + tmp_ospec->bucketwidth = atoi(flds[4]); + tmp_ospec->partitioning_flds = flds[5]; + tmp_ospec->n_partitions = atoi(flds[6]); + qname_to_ospec.insert(pair(tmp_ospec->query,output_specs.size())); + output_specs.push_back(tmp_ospec); + }else{ + fprintf(stderr,"Warning, line %d corrupted in output_spec.cfg, has %d fields.\n",o_lineno,nflds); + } } } fclose(osp_in); @@ -1351,6 +1356,7 @@ fprintf(stderr,"Parsing file %s\n",qpathname.c_str()); } if(dangling_ospecs!=""){ fprintf(stderr,"WARNING, the following entries in output_spec.cfg don't have a matching query: %s\n",dangling_ospecs.c_str()); + exit(1); } string dangling_par = ""; @@ -1907,7 +1913,11 @@ for(q=0;q0){ liface = tvec[0]->get_interface(); // iface queries have been resolved - lmach = tvec[0]->get_machine(); + if(tvec[0]->get_machine() != ""){ + lmach = tvec[0]->get_machine(); + }else{ + fprintf(stderr,"WARNING, lfta %s has empty machine name, using %s\n", split_queries[l]->query_plan[0]->node_name.c_str(), hostname.c_str()); + } } // else{ interface_names.push_back(liface); machine_names.push_back(lmach); @@ -2086,7 +2096,11 @@ for(q=0;qquery_plan[0], Schema, split_queries[l]->get_gid(), Ext_fcns, lfta_schema_embed, ifaces_db,nicprop); */ - snap_lengths.push_back(compute_snap_len(split_queries[l]->query_plan[0], Schema)); + snap_lengths.push_back(compute_snap_len(split_queries[l]->query_plan[0], Schema, "snap")); + snap_position.push_back(compute_snap_len(split_queries[l]->query_plan[0], Schema, "index")); + +// STOPPED HERE need to figure out how to generate the code that Vlad needs +// from snap_postion // TODO NOTE : I'd like it to be the case that registration_query_names // are the queries to be registered for subsciption. @@ -2311,7 +2325,6 @@ for(i=0;i >::iterator ssqi; for(ssqi=lfta_mach_lists.begin(); ssqi!=lfta_mach_lists.end(); ++ssqi){ @@ -2647,10 +2663,13 @@ for(ssi_el=extra_external_libs.begin();ssi_el!=extra_external_libs.end();++ssi_e lfta_prefilter_val[lmach] += "#define PREFILTER_DEFINED 1;\n\n"; #endif map > lfta_sigs; // used again later + map lfta_snap_pos; // optimize csv parsing + // compute now, use in get_iface_properties for(auto mvsi=lfta_iface_lists.begin(); mvsi!=lfta_iface_lists.end(); ++mvsi){ string liface = (*mvsi).first; vector empty_list; lfta_sigs[liface] = empty_list; + lfta_snap_pos[liface] = -1; vector lfta_cols; vector lfta_snap_length; @@ -2664,7 +2683,10 @@ for(ssi_el=extra_external_libs.begin();ssi_el!=extra_external_libs.end();++ssi_e } lfta_sigs[liface].push_back(mask); lfta_cols.push_back(lfta_iface_lists[liface][li]->query_plan[0]->get_colrefs(true,Schema)); - lfta_snap_length.push_back(compute_snap_len(lfta_iface_lists[liface][li]->query_plan[0], Schema)); + lfta_snap_length.push_back(compute_snap_len(lfta_iface_lists[liface][li]->query_plan[0], Schema, "snap")); + int this_snap_pos = compute_snap_len(lfta_iface_lists[liface][li]->query_plan[0], Schema, "index"); + if(this_snap_pos > lfta_snap_pos[liface]) + lfta_snap_pos[liface] = this_snap_pos; } //for(li=0;li &input_file_names, int nfiles, bool use_proto = false; bool use_bsa = false; bool use_kafka = false; + bool use_ssl = false; int erri; string err_str; for(ssi=ifaces.begin();ssi!=ifaces.end();++ssi){ @@ -3078,21 +3103,47 @@ void generate_makefile(vector &input_file_names, int nfiles, vector ift = ifdb->get_iface_vals(ifmachines[ifnm],ifnm, "InterfaceType", erri, err_str); for(int ift_i=0;ift_iget_iface_vals(ifmachines[ifnm],ifnm, "BSA", erri, err_str); for(int ift_i=0;ift_iget_iface_vals(ifmachines[ifnm],ifnm, "KAFKA", erri, err_str); for(int ift_i=0;ift_iget_iface_vals(ifmachines[ifnm],ifnm, "ENCRYPTED", erri, err_str); + for(int ift_i=0;ift_i &input_file_names, int nfiles, if(use_pads) fprintf(outfl,"-lgscppads -lpads "); fprintf(outfl, -"-lgscprts -lgscphost -lm -lgscpaux -lgscplftaaux -lclearinghouse -lresolv -lpthread -lgscpinterface -lz"); +"-lgscprts -lgscphost -lm -lgscpaux -lgscplftaaux -lclearinghouse -lresolv -lpthread -lgscpinterface -lz -lrt"); if(use_pads) fprintf(outfl, " -lpz -lz -lbz "); if(libz_exists && libast_exists) fprintf(outfl," -last "); if(use_pads) fprintf(outfl, " -ldll -ldl "); - if(use_proto) - fprintf(outfl, " -L/usr/local/lib/ -lprotobuf-c "); - if(use_bsa) - fprintf(outfl, " -lbsa_stream "); - if(use_kafka) - fprintf(outfl, " -lrdkafka "); + +#ifdef PROTO_ENABLED + fprintf(outfl, " -L/usr/local/lib/ -lprotobuf-c "); +#endif +#ifdef BSA_ENABLED + fprintf(outfl, " -lbsa_stream "); +#endif +#ifdef KAFKA_ENABLED + fprintf(outfl, " -lrdkafka "); +#endif +#ifdef SSL_ENABLED + fprintf(outfl, " -lssl -lcrypto "); +#endif fprintf(outfl," -lgscpaux"); #ifdef GCOV fprintf(outfl," -fprofile-arcs");