From 8c5759fb87e31d44e6617bce6c40d34c186bbcce Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Thu, 16 Nov 2006 14:19:07 +0000 Subject: [PATCH] New job state flags. --- org.glite.lb.client-interface/interface/consumer.h | 2 ++ org.glite.lb.common/src/xml_conversions.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/org.glite.lb.client-interface/interface/consumer.h b/org.glite.lb.client-interface/interface/consumer.h index ed2084d..225206f 100644 --- a/org.glite.lb.client-interface/interface/consumer.h +++ b/org.glite.lb.client-interface/interface/consumer.h @@ -241,6 +241,8 @@ int edg_wll_QueryJobsExtProxy( #define EDG_WLL_STAT_CLASSADS 1 /**< various job description fields */ #define EDG_WLL_STAT_CHILDREN 2 /**< list of subjob JobId's */ #define EDG_WLL_STAT_CHILDSTAT 4 /**< apply the flags recursively to subjobs */ +#define EDG_WLL_STAT_CHILDHIST_FAST 8 /**< partially complete histogram of child job states */ +#define EDG_WLL_STAT_CHILDHIST_THOROUGH 16 /**< full and up-to date histogram of child job states */ /* starting from bit 10 private flags begins - do not add 1024 and more! */ /** Return status of a single job. diff --git a/org.glite.lb.common/src/xml_conversions.c b/org.glite.lb.common/src/xml_conversions.c index bbf833b..1701722 100644 --- a/org.glite.lb.common/src/xml_conversions.c +++ b/org.glite.lb.common/src/xml_conversions.c @@ -720,6 +720,24 @@ char *edg_wll_stat_flags_to_string(int flags) else asprintf(&cflags,"%s","no_states"); } + if (flags & EDG_WLL_STAT_CHILDHIST_FAST) { + if (cflags) { + asprintf(&temp_cflags,"%s+%s",cflags,"childhist_fast"); + free(cflags); + cflags=temp_cflags; + } + else asprintf(&cflags,"%s","childhist_fast"); + } + + if (flags & EDG_WLL_STAT_CHILDHIST_THOROUGH) { + if (cflags) { + asprintf(&temp_cflags,"%s+%s",cflags,"childhist_thorough"); + free(cflags); + cflags=temp_cflags; + } + else asprintf(&cflags,"%s","childhist_thorough"); + } + if (!cflags) cflags = strdup(""); return(cflags); @@ -740,6 +758,8 @@ int edg_wll_string_to_stat_flags(char *cflags) if (!strcmp(sflag,"childstat")) flags = flags | EDG_WLL_STAT_CHILDSTAT; if (!strcmp(sflag,"no_jobs")) flags = flags | EDG_WLL_STAT_NO_JOBS; if (!strcmp(sflag,"no_states")) flags = flags | EDG_WLL_STAT_NO_STATES; + if (!strcmp(sflag,"childhist_fast")) flags = flags | EDG_WLL_STAT_CHILDHIST_FAST; + if (!strcmp(sflag,"childhist_thorough")) flags = flags | EDG_WLL_STAT_CHILDHIST_THOROUGH; sflag = strtok_r(NULL, "+", &last); } -- 1.8.2.3