From: Zdeněk Šustr Date: Fri, 4 Jan 2008 15:53:02 +0000 (+0000) Subject: Modifications in handling the JDL query attribute. Needs more work, however. X-Git-Tag: merge_313_3_dst~3 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=14ee633cb43966a8554ca8a9f667a7b4987dabae;p=jra1mw.git Modifications in handling the JDL query attribute. Needs more work, however. --- diff --git a/org.glite.lb.client/examples/query_ext.c b/org.glite.lb.client/examples/query_ext.c index 96de829..48879a9 100644 --- a/org.glite.lb.client/examples/query_ext.c +++ b/org.glite.lb.client/examples/query_ext.c @@ -286,6 +286,7 @@ static void free_QueryRec(edg_wll_QueryRec *qr) case EDG_WLL_QUERY_ATTR_OWNER: case EDG_WLL_QUERY_ATTR_LOCATION: case EDG_WLL_QUERY_ATTR_DESTINATION: + case EDG_WLL_QUERY_ATTR_JDL_ATTR: free(qr->value.c); break; @@ -433,6 +434,7 @@ static char *get_job_condition(char *src, edg_wll_QueryRec *cond) case EDG_WLL_QUERY_ATTR_LOCATION: case EDG_WLL_QUERY_ATTR_DESTINATION: case EDG_WLL_QUERY_ATTR_USERTAG: + case EDG_WLL_QUERY_ATTR_JDL_ATTR: if ( !(cond->value.c = strdup(tmps)) ) return 0; break; @@ -560,6 +562,7 @@ static char *get_event_condition(char *src, edg_wll_QueryRec *cond) case EDG_WLL_QUERY_ATTR_USERTAG: case EDG_WLL_QUERY_ATTR_HOST: case EDG_WLL_QUERY_ATTR_INSTANCE: + case EDG_WLL_QUERY_ATTR_JDL_ATTR: if ( !(cond->value.c = strdup(tmps)) ) return 0; break; @@ -780,6 +783,7 @@ static void printconds(edg_wll_QueryRec **cond) case EDG_WLL_QUERY_ATTR_HOST: case EDG_WLL_QUERY_ATTR_INSTANCE: case EDG_WLL_QUERY_ATTR_USERTAG: + case EDG_WLL_QUERY_ATTR_JDL_ATTR: printf("%s", cond[i][j].value.c); break; case EDG_WLL_QUERY_ATTR_STATUS: diff --git a/org.glite.lb.server/src/bkindex.c b/org.glite.lb.server/src/bkindex.c index 23d3463..fa087f9 100644 --- a/org.glite.lb.server/src/bkindex.c +++ b/org.glite.lb.server/src/bkindex.c @@ -299,6 +299,7 @@ static char *db_col_type(const edg_wll_QueryRec *r) case EDG_WLL_QUERY_ATTR_HOST: case EDG_WLL_QUERY_ATTR_CHKPT_TAG: case EDG_WLL_QUERY_ATTR_NETWORK_SERVER: + case EDG_WLL_QUERY_ATTR_JDL_ATTR: /* XXX: 255 may not be enough for location or destination */ return "varchar(255) binary null"; diff --git a/org.glite.lb.server/src/query.c b/org.glite.lb.server/src/query.c index 156654b..d123efe 100644 --- a/org.glite.lb.server/src/query.c +++ b/org.glite.lb.server/src/query.c @@ -627,6 +627,15 @@ static char *ec_to_head_where(edg_wll_Context ctx,const edg_wll_QueryRec **ec) ct++; break; + case EDG_WLL_QUERY_ATTR_JDL_ATTR: + if ( ec[m][n].op != EDG_WLL_QUERY_OP_EQUAL && ec[m][n].op != EDG_WLL_QUERY_OP_UNEQUAL ) + { + edg_wll_SetError(ctx, EINVAL, "only `=' and '!=' supported with jdl_attr"); + return NULL; + } + ct++; + break; + case EDG_WLL_QUERY_ATTR_INSTANCE: if ( ec[m][n].op != EDG_WLL_QUERY_OP_EQUAL && ec[m][n].op != EDG_WLL_QUERY_OP_UNEQUAL ) {