Modifications in handling the JDL query attribute. Needs more work, however.
authorZdeněk Šustr <sustr4@cesnet.cz>
Fri, 4 Jan 2008 15:53:02 +0000 (15:53 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Fri, 4 Jan 2008 15:53:02 +0000 (15:53 +0000)
org.glite.lb.client/examples/query_ext.c
org.glite.lb.server/src/bkindex.c
org.glite.lb.server/src/query.c

index 96de829..48879a9 100644 (file)
@@ -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:
index 23d3463..fa087f9 100644 (file)
@@ -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"; 
 
index 156654b..d123efe 100644 (file)
@@ -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 )
                        {