X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fftacmp%2Ftranslate_fta.cc;h=4ee0bb43243f7f187c9b81324759f410d25020c3;hb=6eada93445e22ce99c498c01e24fdf33783e1637;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..4ee0bb4 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; @@ -395,24 +397,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 +1355,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 +1912,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); @@ -2311,7 +2320,6 @@ for(i=0;i &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_i &input_file_names, int nfiles, 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 fprintf(outfl," -lgscpaux"); #ifdef GCOV fprintf(outfl," -fprofile-arcs");