purge/dump/load moved to lb.utils
authorJan Pospíšil <honik@ntc.zcu.cz>
Sun, 10 Jun 2007 21:18:13 +0000 (21:18 +0000)
committerJan Pospíšil <honik@ntc.zcu.cz>
Sun, 10 Jun 2007 21:18:13 +0000 (21:18 +0000)
- builds fine but probably not functional, remaining FIXMEs in server

org.glite.lb.client/Makefile
org.glite.lb.client/interface/query.h [deleted file]
org.glite.lb.server/Makefile
org.glite.lb.server/interface/query.h [moved from org.glite.lb.server/src/query.h with 78% similarity]
org.glite.lb.server/src/srv_purge.c
org.glite.lb.utils/Makefile
org.glite.lb.utils/src/dump.c
org.glite.lb.utils/src/load.c
org.glite.lb.utils/src/purge.c

index 6b30ad9..6cfae71 100644 (file)
@@ -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 (file)
index e8ea2f2..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef __GLITE_LB_QUERY_H__
-#define __GLITE_LB_QUERY_H__
-
-#ident "$Header$"
-
-#include <glite/lb/query_rec.h>
-#include <glite/lb/context.h>
-
-/** 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__ */
index a9938e0..7c2d68e 100644 (file)
@@ -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=)
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 (file)
@@ -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__ */
index f0a00c0..0931a6d 100644 (file)
@@ -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:
index 2db2051..7564095 100644 (file)
@@ -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} 
index 5e87516..c82e9e8 100644 (file)
@@ -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)
index efc453b..1878b2c 100644 (file)
@@ -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)
index e791d0a..2ed6839 100644 (file)
@@ -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)