From 25f256d6d9f7a068fe228cdbd8c5a68b440fd7a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Posp=C3=AD=C5=A1il?= Date: Sun, 10 Jun 2007 21:18:13 +0000 Subject: [PATCH] purge/dump/load moved to lb.utils - builds fine but probably not functional, remaining FIXMEs in server --- org.glite.lb.client/Makefile | 2 +- org.glite.lb.client/interface/query.h | 39 -------------------------- org.glite.lb.server/Makefile | 2 +- org.glite.lb.server/{src => interface}/query.h | 6 ++-- org.glite.lb.server/src/srv_purge.c | 2 +- org.glite.lb.utils/Makefile | 9 +++--- org.glite.lb.utils/src/dump.c | 14 ++++++--- org.glite.lb.utils/src/load.c | 16 ++++++++--- org.glite.lb.utils/src/purge.c | 16 ++++++++--- 9 files changed, 44 insertions(+), 62 deletions(-) delete mode 100644 org.glite.lb.client/interface/query.h rename org.glite.lb.server/{src => interface}/query.h (78%) diff --git a/org.glite.lb.client/Makefile b/org.glite.lb.client/Makefile index 6b30ad9..6cfae71 100644 --- a/org.glite.lb.client/Makefile +++ b/org.glite.lb.client/Makefile @@ -107,7 +107,7 @@ FAKELIBOBJS:=consumer_fake.o producer_fake.o PLUSOBJS:=Event.o Job.o JobStatus.o Notification.o ServerConnection.o -HDRS:=consumer.h notification.h query.h statistics.h \ +HDRS:=consumer.h notification.h statistics.h \ Job.h Notification.h ServerConnection.h FAKE_HDRS:=consumer_fake.h producer_fake.h GEN_HDRS:=JobStatus.h producer.h interface_version.h diff --git a/org.glite.lb.client/interface/query.h b/org.glite.lb.client/interface/query.h deleted file mode 100644 index e8ea2f2..0000000 --- a/org.glite.lb.client/interface/query.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __GLITE_LB_QUERY_H__ -#define __GLITE_LB_QUERY_H__ - -#ident "$Header$" - -#include -#include - -/** Client side purge - * \retval EAGAIN only partial result returned, call repeatedly to get all - * output data - */ -int edg_wll_Purge( - edg_wll_Context ctx, - edg_wll_PurgeRequest *request, - edg_wll_PurgeResult *result -); - -/** Dump events in a given time interval - */ - -int edg_wll_DumpEvents( - edg_wll_Context, - const edg_wll_DumpRequest *, - edg_wll_DumpResult * -); - -/** Load events from a given file into the database - * \retval EPERM operation not permitted - * \retval ENOENT file not found - */ - -int edg_wll_LoadEvents( - edg_wll_Context, - const edg_wll_LoadRequest *, - edg_wll_LoadResult * -); - -#endif /* __GLITE_LB_QUERY_H__ */ diff --git a/org.glite.lb.server/Makefile b/org.glite.lb.server/Makefile index a9938e0..7c2d68e 100644 --- a/org.glite.lb.server/Makefile +++ b/org.glite.lb.server/Makefile @@ -230,7 +230,7 @@ WS_CLIENT_LIBS:= ${GSOAP_LIB} -lglite_lb_common_${nothrflavour} \ # ${EXT_LIBS} # -HDRS=index.h lb_authz.h lbs_db.h store.h +HDRS=index.h lb_authz.h lbs_db.h store.h query.h MAN_GZ:=glite-lb-mon-db.1.gz MAN = $(MAN_GZ:.gz=) diff --git a/org.glite.lb.server/src/query.h b/org.glite.lb.server/interface/query.h similarity index 78% rename from org.glite.lb.server/src/query.h rename to org.glite.lb.server/interface/query.h index 46419de..c717b6d 100644 --- a/org.glite.lb.server/src/query.h +++ b/org.glite.lb.server/interface/query.h @@ -1,5 +1,5 @@ -#ifndef __GLITE_LB_SERVER_QUERY_H__ -#define __GLITE_LB_SERVER_QUERY_H__ +#ifndef __GLITE_LB_QUERY_H__ +#define __GLITE_LB_QUERY_H__ #ident "$Header$" @@ -14,4 +14,4 @@ int match_status(edg_wll_Context, const edg_wll_JobStat *stat,const edg_wll_Quer #define NOTIF_ALL_JOBS "all_jobs" -#endif /* __GLITE_LB_SERVER_QUERY_H__ */ +#endif /* __GLITE_LB_QUERY_H__ */ diff --git a/org.glite.lb.server/src/srv_purge.c b/org.glite.lb.server/src/srv_purge.c index f0a00c0..0931a6d 100644 --- a/org.glite.lb.server/src/srv_purge.c +++ b/org.glite.lb.server/src/srv_purge.c @@ -287,7 +287,7 @@ int edg_wll_PurgeServer(edg_wll_Context ctx,const edg_wll_PurgeRequest *request) } memset(&stat,0,sizeof stat); - if (edg_wll_JobStatus(ctx,job,0,&stat)) goto abort; /* XXX: memory leak */ + if (edg_wll_JobStatus(ctx,job,0,&stat)) goto abort; /* FIXME: replace by intJobStatus + fix memory leak */ switch (stat.state) { case EDG_WLL_JOB_CLEARED: diff --git a/org.glite.lb.utils/Makefile b/org.glite.lb.utils/Makefile index 2db2051..7564095 100644 --- a/org.glite.lb.utils/Makefile +++ b/org.glite.lb.utils/Makefile @@ -8,7 +8,6 @@ package=glite-lb-utils version=0.0.0 PREFIX=/opt/glite -glite_location=/opt/glite globus_prefix=/opt/globus nothrflavour=gcc32 thrflavour=gcc32pthr @@ -66,7 +65,7 @@ CLIENT_LIB:=-lglite_lb_client_${nothrflavour} BKSERVER_LIB:=-lglite_lb_bkserver JP_LIBS:=-lglite_jp_common_${nothrflavour} -lglite_jp_trio -UTILS:=statistics mon +UTILS:=mon purge dump load dump_exporter MAN_GZ:=glite-lb-mon.1.gz MAN = $(MAN_GZ:.gz=) @@ -74,13 +73,13 @@ MAN = $(MAN_GZ:.gz=) default: all -compile all: ${UTILS} ${MAN_GZ} +compile all: ${UTILS} ${MAN_GZ} statistics %.o: %.c ${CC} ${CFLAGS} ${GLOBUSINC} -c $< -mon: mon.o - ${LINK} -o $@ $< ${COMMON_LIB} ${CLIENT_LIB} ${EXT_LIBS} +${UTILS}: %: %.o + ${LINK} -o $@ $< ${COMMON_LIB} ${CLIENT_LIB} ${BKSERVER_LIB} ${EXT_LIBS} statistics: statistics.o ${LINK} -rdynamic -o $@ $< ${COMMON_LIB} ${JP_LIBS} ${EXT_LIBS} diff --git a/org.glite.lb.utils/src/dump.c b/org.glite.lb.utils/src/dump.c index 5e87516..c82e9e8 100644 --- a/org.glite.lb.utils/src/dump.c +++ b/org.glite.lb.utils/src/dump.c @@ -16,9 +16,8 @@ #include "glite/lb/ulm_parse.h" #include "glite/lb/xml_parse.h" #include "glite/lb/mini_http.h" - -#include "query.h" -#include "consumer.h" +#include "glite/lb/consumer.h" +#include "glite/lb/query.h" /* from server */ #define dprintf(x) { if (debug) printf x; } @@ -26,6 +25,10 @@ static const char rcsid[] = "@(#)$Id$"; static int debug=0; +static int edg_wll_DumpEvents( + edg_wll_Context ctx, + const edg_wll_DumpRequest *request, + edg_wll_DumpResult *result); static void printerr(edg_wll_Context ctx); static struct option opts[] = { @@ -193,7 +196,10 @@ static const char* const request_headers[] = { NULL }; -int edg_wll_DumpEvents( +/** Dump events in a given time interval + */ + +static int edg_wll_DumpEvents( edg_wll_Context ctx, const edg_wll_DumpRequest *request, edg_wll_DumpResult *result) diff --git a/org.glite.lb.utils/src/load.c b/org.glite.lb.utils/src/load.c index efc453b..1878b2c 100644 --- a/org.glite.lb.utils/src/load.c +++ b/org.glite.lb.utils/src/load.c @@ -16,9 +16,8 @@ #include "glite/lb/ulm_parse.h" #include "glite/lb/xml_parse.h" #include "glite/lb/mini_http.h" - -#include "query.h" -#include "consumer.h" +#include "glite/lb/consumer.h" +#include "glite/lb/query.h" /* from server */ #define dprintf(x) { if (debug) printf x; } @@ -26,6 +25,10 @@ static const char rcsid[] = "@(#)$Id$"; static int debug=0; +static int edg_wll_LoadEvents( + edg_wll_Context ctx, + const edg_wll_LoadRequest *request, + edg_wll_LoadResult *result); static void printerr(edg_wll_Context ctx); static struct option opts[] = { @@ -171,7 +174,12 @@ static const char* const request_headers[] = { NULL }; -int edg_wll_LoadEvents( +/** Load events from a given file into the database + * \retval EPERM operation not permitted + * \retval ENOENT file not found + */ + +static int edg_wll_LoadEvents( edg_wll_Context ctx, const edg_wll_LoadRequest *request, edg_wll_LoadResult *result) diff --git a/org.glite.lb.utils/src/purge.c b/org.glite.lb.utils/src/purge.c index e791d0a..2ed6839 100644 --- a/org.glite.lb.utils/src/purge.c +++ b/org.glite.lb.utils/src/purge.c @@ -15,9 +15,9 @@ #include "glite/lb/context-int.h" #include "glite/lb/xml_parse.h" #include "glite/lb/mini_http.h" - -#include "query.h" -#include "consumer.h" +#include "glite/lb/query_rec.h" +#include "glite/lb/consumer.h" +#include "glite/lb/query.h" /* from server */ #define dprintf(x) { if (debug) printf x; } @@ -35,6 +35,10 @@ static const char rcsid[] = "@(#)$Id$"; static int debug=0; static char *file; +static int edg_wll_Purge( + edg_wll_Context ctx, + edg_wll_PurgeRequest *request, + edg_wll_PurgeResult *result); static int read_jobIds(const char *file, char ***jobs_out); static int get_timeout(const char *arg, int *timeout); static void printerr(edg_wll_Context ctx); @@ -347,7 +351,11 @@ static const char* const request_headers[] = { NULL }; -int edg_wll_Purge( +/** Client side purge + * \retval EAGAIN only partial result returned, call repeatedly to get all + * output data + */ +static int edg_wll_Purge( edg_wll_Context ctx, edg_wll_PurgeRequest *request, edg_wll_PurgeResult *result) -- 1.8.2.3