X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fftacmp%2Fparse_schema.h;h=763ebd538d68400a1789c0efe472af28a6426c18;hb=f6f278dfd4bca7effd6f452d38ce74cf109d41f4;hp=3c009ba36547384f9e56ab4833b012c0a64c4c39;hpb=e981e864b812c938d3df8b555b6bb98bb89273e7;p=com%2Fgs-lite.git diff --git a/src/ftacmp/parse_schema.h b/src/ftacmp/parse_schema.h index 3c009ba..763ebd5 100644 --- a/src/ftacmp/parse_schema.h +++ b/src/ftacmp/parse_schema.h @@ -316,6 +316,8 @@ struct query_list_t; #define STREAM_SCHEMA 2 #define OPERATOR_VIEW_SCHEMA 3 #define UNPACK_FCNS_SCHEMA 4 +#define WATCHLIST_SCHEMA 5 + // Represent a STREAM, PROTOCOL, OPERATOR_VIEW, or UNPACK_FCN list. @@ -326,10 +328,13 @@ private: param_list *base_tables; // if PROTOCOL, the PROTOCOLS that // this PROTOCOL inherits fields from. int schema_type; // STREAM_SCHEMA, PROTOCOL_SCHEMA, OPERATOR_VIEW_SCHEMA + int schema_id; // the id associated with the protocol + std::set all_schema_ids; // schema_id plus the inherited ones // For operator_view tables param_list *op_properties; std::vector qspec_list; param_list *selpush; + std::vector key_flds; // keys of a watchlist public: // for unpacking function group specs. @@ -343,10 +348,26 @@ public: // get the PROTOCOL-wide unpack functions. table_def(const char *name, param_list *plist, param_list *ufcn_l, field_entry_list *fel, int sch_t){ int f; - if(plist == NULL) + schema_id = -1; base_tables = new param_list(); - else - base_tables = plist; + if(plist != NULL){ + std::vector pkeys = plist->get_key_vec(); + for(int p=0;pval_of(pkeys[p]); + if(val!=""){ + if(pkeys[p] == "schema_id" || pkeys[p] == "schemaId"){ + schema_id = atoi(val.c_str()); + if(schema_id <= 0){ + fprintf(stderr,"Error, Protocol %s has a schema_id value of %d, must be larger than 0.\n",name, schema_id); + exit(1); + } + all_schema_ids.insert(schema_id); + } + }else{ + base_tables->append(pkeys[p]); + } + } + } table_name =name; fields = fel->get_list(); schema_type = sch_t; @@ -400,6 +421,13 @@ public: return op_properties->val_of(s); }; + void set_keys(const std::vector &kf){ + key_flds = kf; + } + std::vector get_keys(){ + return key_flds; + } + // Used in generating the LFTA prefilter std::string get_field_basetable(std::string f); @@ -416,6 +444,14 @@ public: int get_schema_type(){return schema_type;}; + int get_schema_id(){return schema_id;}; + + std::set get_all_schema_ids(){ return all_schema_ids;} + void add_to_all_schema_ids(int sid){ + all_schema_ids.insert(sid); + } + + std::vector get_subqueryspecs(){return qspec_list;}; std::string to_string(); @@ -426,6 +462,10 @@ public: schema_type = tmp_sch; return ret; } + + bool is_stream(){ + return(schema_type == PROTOCOL_SCHEMA || schema_type == STREAM_SCHEMA || schema_type == OPERATOR_VIEW_SCHEMA); + } }; @@ -525,6 +565,14 @@ public: return(tbl_list[t]->get_schema_type()); }; + int get_schema_id(int t){ + return(tbl_list[t]->get_schema_id()); + }; + + bool is_stream(int t){ + return tbl_list[t]->is_stream(); + } + std::string get_op_prop(int t, std::string s){ return(tbl_list[t]->get_op_prop(s)); };