edg_wll_FreeAcl(edg_wll_Acl);
extern int
-edg_wll_UpdateACL(edg_wll_Context, edg_wlc_JobId, char *, int, int, int, int);
+edg_wll_UpdateACL(edg_wll_Context, glite_jobid_const_t, char *, int, int, int, int);
extern int
edg_wll_CheckACL(edg_wll_Context, edg_wll_Acl, int);
extern int
-edg_wll_GetACL(edg_wll_Context, edg_wlc_JobId, edg_wll_Acl *);
+edg_wll_GetACL(edg_wll_Context, glite_jobid_const_t, edg_wll_Acl *);
extern int
edg_wll_SetVomsGroups(edg_wll_Context, edg_wll_GssConnection *, char *, char *, char *, char *);
int /* IN (boolean) */
);
-/* update stored job state according to new event */
-
-edg_wll_ErrorCode edg_wll_StepIntState(
- edg_wll_Context, /* INOUT */
- edg_wlc_JobId, /* IN */
- edg_wll_Event *, /* IN */
- int, /* IN */
- edg_wll_JobStat *
-);
-
-/* create embriotic job state for DAGs' subjob */
-
-edg_wll_ErrorCode edg_wll_StepIntStateEmbriotic(
- edg_wll_Context ctx, /* INOUT */
- edg_wll_Event *e /* IN */
-);
-
int db_store(edg_wll_Context, char *);
int db_parent_store(edg_wll_Context, edg_wll_Event *, intJobStat *);
int handle_request(edg_wll_Context,char *);
+int handle_il_message(edg_wll_Context,char *);
int create_reply(const edg_wll_Context,char **);
int is_job_local(edg_wll_Context, glite_jobid_const_t jobId);
int store_job_server_proxy(edg_wll_Context ctx, edg_wll_Event *event, int *register_to_JP);
if ((retval = glite_lbu_Transaction(ctx->dbctx)) != 0) edg_wll_SetErrorDB(ctx);
-printf("edg_wll_Transaction(%d)\n", retval);
+// printf("edg_wll_Transaction(%d)\n", retval);
return retval;
}
int retval;
if ((retval = glite_lbu_Commit(ctx->dbctx)) != 0) edg_wll_SetErrorDB(ctx);
-printf("edg_wll_Commit(%d)\n", retval);
+// printf("edg_wll_Commit(%d)\n", retval);
return retval;
}
int retval;
if ((retval = glite_lbu_Rollback(ctx->dbctx)) != 0) edg_wll_SetErrorDB(ctx);
-printf("edg_wll_Rollback(%d)\n", retval);
+// printf("edg_wll_Rollback(%d)\n", retval);
return retval;
}
#include "server_state.h"
#include "purge.h"
#include "db_supp.h"
+#include "lb_proto.h"
static char *time_to_string(time_t t, char **ptr);
static int handle_specials(edg_wll_Context,time_t *);
#include "glite/lb/events.h"
#include "glite/lb/context-int.h"
#include "glite/lb/intjobstat.h"
+#include "glite/lb/process_event.h"
#include "get_events.h"
#include "store.h"
#endif
whole_cycle = 1;
-commit:
rollback:
if (!whole_cycle) {
edg_wll_FreeStatus(&jobstat.pub);
jqr[0].attr = EDG_WLL_QUERY_ATTR_JOBID;
jqr[0].op = EDG_WLL_QUERY_OP_EQUAL;
- jqr[0].value.j = job;
+ jqr[0].value.j = (glite_jobid_t)job;
jqr[1].attr = EDG_WLL_QUERY_ATTR_UNDEF;
jqra = (edg_wll_QueryRec **) malloc (2 * sizeof(edg_wll_QueryRec **));
edg_wll_ErrorCode edg_wll_StoreIntStateEmbryonic(edg_wll_Context ctx,
- edg_wlc_JobId jobid,
+ glite_jobid_const_t jobid,
char *icnames,
char *values,
glite_lbu_bufInsert *bi)
*/
edg_wll_ErrorCode edg_wll_LoadIntState(edg_wll_Context ctx,
- edg_wlc_JobId jobid,
+ glite_jobid_const_t jobid,
int lock,
int seq,
intJobStat **stat)
/* checks whether parent jobid would generate the same sem.num. */
/* as children jobid */
-static int dependent_parent_lock(edg_wll_Context ctx, edg_wlc_JobId p,edg_wlc_JobId c)
+static int dependent_parent_lock(edg_wll_Context ctx, glite_jobid_const_t p,glite_jobid_const_t c)
{
int p_id, c_id;
*/
edg_wll_ErrorCode edg_wll_StepIntStateParent(edg_wll_Context ctx,
- edg_wlc_JobId job,
+ glite_jobid_const_t job,
edg_wll_Event *e,
int seq,
intJobStat *ijsp,
*/
edg_wll_ErrorCode edg_wll_StepIntState(edg_wll_Context ctx,
- edg_wlc_JobId job,
+ glite_jobid_const_t job,
edg_wll_Event *e,
int seq,
edg_wll_JobStat *stat_out)
else destroy_intJobStat(&jobstat);
}
-err:
return edg_wll_Error(ctx, NULL, NULL);
}
-edg_wll_ErrorCode edg_wll_GetSubjobHistogram(edg_wll_Context ctx, edg_wlc_JobId parent_jobid, int *hist)
+edg_wll_ErrorCode edg_wll_GetSubjobHistogram(edg_wll_Context ctx, glite_jobid_const_t parent_jobid, int *hist)
{
char *stmt = NULL,*out = NULL, *rest = NULL;
/* Make a histogram of all subjobs belonging to the parent job */
-edg_wll_ErrorCode edg_wll_StoreSubjobHistogram(edg_wll_Context ctx, edg_wlc_JobId parent_jobid, intJobStat *ijs)
+edg_wll_ErrorCode edg_wll_StoreSubjobHistogram(edg_wll_Context ctx, glite_jobid_const_t parent_jobid, intJobStat *ijs)
{
char *stat_enc = NULL;
char *stmt;
int edg_wll_intJobStatus( edg_wll_Context, glite_jobid_const_t, int, intJobStat *, int, int);
edg_wll_ErrorCode edg_wll_StoreIntState(edg_wll_Context, intJobStat *, int);
-edg_wll_ErrorCode edg_wll_StoreIntStateEmbryonic(edg_wll_Context, edg_wlc_JobId, char *icnames, char *values, glite_lbu_bufInsert *bi);
-edg_wll_ErrorCode edg_wll_LoadIntState(edg_wll_Context , edg_wlc_JobId , int, int, intJobStat **);
+edg_wll_ErrorCode edg_wll_StoreIntStateEmbryonic(edg_wll_Context, glite_jobid_const_t, char *icnames, char *values, glite_lbu_bufInsert *bi);
+edg_wll_ErrorCode edg_wll_LoadIntState(edg_wll_Context , glite_jobid_const_t , int, int, intJobStat **);
-edg_wll_ErrorCode edg_wll_StepIntState(edg_wll_Context ctx, edg_wlc_JobId job, edg_wll_Event *e, int seq, edg_wll_JobStat *stat_out);
-edg_wll_ErrorCode edg_wll_StepIntStateParent(edg_wll_Context,edg_wlc_JobId,edg_wll_Event *,int,intJobStat *,edg_wll_JobStat *);
+/* update stored job state according to new event */
+edg_wll_ErrorCode edg_wll_StepIntState(edg_wll_Context ctx, glite_jobid_const_t job, edg_wll_Event *e, int seq, edg_wll_JobStat *stat_out);
+
+edg_wll_ErrorCode edg_wll_StepIntStateParent(edg_wll_Context,glite_jobid_const_t,edg_wll_Event *,int,intJobStat *,edg_wll_JobStat *);
+
+/* create embriotic job state for DAGs' subjob */
+
+edg_wll_ErrorCode edg_wll_StepIntStateEmbriotic(
+ edg_wll_Context ctx, /* INOUT */
+ edg_wll_Event *e /* IN */
+);
int add_stringlist(char ***, const char *);
-edg_wll_ErrorCode edg_wll_GetSubjobHistogram(edg_wll_Context, edg_wlc_JobId parent_jobid, int *hist);
-edg_wll_ErrorCode edg_wll_StoreSubjobHistogram(edg_wll_Context, edg_wlc_JobId parent_jobid, intJobStat *ijs);
+edg_wll_ErrorCode edg_wll_GetSubjobHistogram(edg_wll_Context, glite_jobid_const_t parent_jobid, int *hist);
+edg_wll_ErrorCode edg_wll_StoreSubjobHistogram(edg_wll_Context, glite_jobid_const_t parent_jobid, intJobStat *ijs);
#endif /* GLITE_LB_LBS_JOBSTAT_H*/
}
int
-edg_wll_UpdateACL(edg_wll_Context ctx, edg_wlc_JobId job,
+edg_wll_UpdateACL(edg_wll_Context ctx, glite_jobid_const_t job,
char *user_id, int user_id_type,
int permission, int perm_type, int operation)
{
return ret;
}
-int edg_wll_GetACL(edg_wll_Context ctx, edg_wlc_JobId jobid, edg_wll_Acl *acl)
+int edg_wll_GetACL(edg_wll_Context ctx, glite_jobid_const_t jobid, edg_wll_Acl *acl)
{
char *q = NULL;
char *acl_id = NULL;
void edg_wll_FreeAcl(edg_wll_Acl acl) { }
int edg_wll_HandleCounterACL(edg_wll_Context ctx, edg_wll_Acl acl,
char *aclid, int incr) { return 0; }
-int edg_wll_UpdateACL(edg_wll_Context ctx, edg_wlc_JobId job,
+int edg_wll_UpdateACL(edg_wll_Context ctx, glite_jobid_const_t job,
char *user_id, int user_id_type,
int permission, int perm_type, int operation) { return 0; }
-int edg_wll_GetACL(edg_wll_Context ctx, edg_wlc_JobId jobid, edg_wll_Acl *acl) { return 0; }
+int edg_wll_GetACL(edg_wll_Context ctx, glite_jobid_const_t jobid, edg_wll_Acl *acl) { return 0; }
#endif
if ( ctx->isProxy ) err = edg_wll_http_recv_proxy(ctx,&req,&hdr,&body);
else err = edg_wll_http_recv(ctx,&req,&hdr,&body,ctx->connections->serverConnection);
- if (req) dprintf(("[%d] request: %s\n",getpid(),req));
- else dprintf(("no request\n"));
+ if (req) {
+ dprintf(("[%d] request: %s\n",getpid(),req));
+ } else {
+ dprintf(("no request\n"));
+ }
if (body) dprintf(("request body:\n%s\n\n",body));
if (!err) {
#include "lb_proto.h"
#include "lb_html.h"
#include "stats.h"
+#include "jobstat.h"
#include "get_events.h"
#include "purge.h"
#include "lb_xml_parse.h"
extern char *edg_wll_HTTPErrorMessage(int);
+extern int edg_wll_UserJobsServer(edg_wll_Context ctx, edg_wlc_JobId **jobs, edg_wll_JobStat **states);
+
+extern int edg_wll_QuerySequenceCodeServer(edg_wll_Context ctx, edg_wlc_JobId jobid, const char *source, char **seqcode);
+
#endif /* GLITE_LB_PROTO_H */
#include "get_events.h"
#include "server_state.h"
#include "db_supp.h"
+#include "lb_proto.h"
static int read_line(char **buff, size_t *maxsize, int fd);
char *cols[20];
glite_lbu_Statement stmt;
- if (glite_lbu_InitDBContext(&ctx->dbctx) != 0) {
+ if (glite_lbu_InitDBContext((glite_lbu_DBContext*) &ctx->dbctx) != 0) {
char *ed;
glite_lbu_DBError(ctx->dbctx, NULL, &ed);
char **fname
);
+extern int edg_wll_DumpEventsServer(edg_wll_Context ctx,const edg_wll_DumpRequest *req,edg_wll_DumpResult *result);
+
+extern int edg_wll_LoadEventsServer(edg_wll_Context ctx,const edg_wll_LoadRequest *req,edg_wll_LoadResult *result);
+
#define edg_wll_CreateTmpDumpFile(ctx, f) edg_wll_CreateTmpFileStorage(ctx,ctx->dumpStorage,f)
#define edg_wll_CreateTmpPurgeFile(ctx, f) edg_wll_CreateTmpFileStorage(ctx,ctx->purgeStorage,f)
while(conditions[i][j].attr) {
if(conditions[i][j].attr == EDG_WLL_QUERY_ATTR_JOBID) {
- dbjob = edg_wlc_JobIdGetUnique(conditions[i][j].value.j);
- prefix = glite_jobid_getServer(conditions[i][j].value.c);
+ dbjob = glite_jobid_getUnique(conditions[i][j].value.j);
+ prefix = glite_jobid_getServer(conditions[i][j].value.j);
trio_asprintf(&zomb_where_temp,"%s%s((p.prefix = '%|Ss') AND (j.jobid = '%|Ss'))",
zomb_where,
first_or ? " OR " : "",
#include "lb_authz.h"
*/
#include "db_supp.h"
-
+#include "lb_proto.h"
int edg_wll_QuerySequenceCodeServer(edg_wll_Context ctx, edg_wlc_JobId jobid, const char *source, char **seqcode)
return edg_wll_Error(ctx,NULL,NULL);
}
+/* FIXME: defined but not used */
+#if 0
static void unlock_and_check(edg_wll_Context ctx,edg_wlc_JobId job)
{
char *job_s,*et,*ed;
free(et); free(ed); free(job_s);
}
}
+#endif
static int dump_events(edg_wll_Context ctx, glite_jobid_const_t job, int dump, char **res)
{
#include <assert.h>
#include <stdio.h>
#include <errno.h>
+#include <time.h>
#include "glite/lb/events.h"
#include "glite/lb/jobstat.h"
static int store_user(edg_wll_Context,const char *,const char *);
static int store_job(edg_wll_Context,glite_jobid_const_t,const char *, int, int, int, int);
+/* FIXME: 'set_job_grey' defined but not used */
static int set_job_grey(edg_wll_Context ctx, char *jobid);
static int store_flesh(edg_wll_Context,edg_wll_Event *,const char *ulm, char *,int);
+/* FIXME: 'check_dup' defined but not used */
static int check_dup(edg_wll_Context,edg_wll_Event *);
static int check_auth(edg_wll_Context,edg_wll_Event *e);
static void lowercase_usertag(edg_wll_Event *ev);
static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,char *jobid,int no)
{
+#ifndef LB_EVENTS_BLOB
struct {
char *key;
char *val;
} f[20];
+ unsigned int i;
+#endif
char *stmt;
- unsigned int i;
int err = 0;
assert(ulm || e);
}
-// XXX: for easier merge with RC31_3
+// XXX: for easier merge from RC31_3
// after merge, it would be possible to glue
// edg_wll_StoreProtoProxy and edg_wll_StoreProtoServer together
int edg_wll_StoreProto(edg_wll_Context ctx)
#include "jobstat.h"
#include "db_supp.h"
#include "query.h"
+#include "lb_proto.h"
int edg_wll_UserJobsServer(
edg_wll_Context ctx,
free(ed);
}
+/* FIXME: assignment from incompatible pointer type */
detail = soap_faultdetail(soap);
detail->__type = GFNUM;
#if GSOAP_VERSION >= 20700
#include "get_events.h"
#include "ws_fault.h"
#include "ws_typeref.h"
+#include "lb_proto.h"
#if GSOAP_VERSION <= 20602
#define __lb__GetVersion __ns1__GetVersion
install -m 644 lb-job-attrs2.xsd ${PREFIX}/interface
install -m 644 ${top_srcdir}/interface/lb-job-record.xsd ${PREFIX}/interface
install -m 644 ${top_srcdir}/interface/intjobstat.h ${PREFIX}/include/glite/lb
+ install -m 644 ${top_srcdir}/interface/process_event.h ${PREFIX}/include/glite/lb
install -m 644 ${top_srcdir}/interface/seqcode_aux.h ${PREFIX}/include/glite/lb
install -m 644 job_attrs.h ${PREFIX}/include/glite/lb
install -m 644 job_attrs2.h ${PREFIX}/include/glite/lb
--- /dev/null
+#ifndef GLITE_LB_PROCESS_EVENT_H
+#define GLITE_LB_PROCESS_EVENT_H
+
+int processEvent(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, char **errstring);
+int add_stringlist(char ***lptr, const char *new_item);
+
+#endif
#include "intjobstat.h"
#include "seqcode_aux.h"
+#include "process_event.h"
/* TBD: share in whole logging or workload */
}
#define rep(a,b) { free(a); a = (b == NULL) ? NULL : strdup(b); }
+#define rep_null(a) { free(a); a = NULL; }
#define rep_cond(a,b) { if (b) { free(a); a = strdup(b); } }
static void free_stringlist(char ***lptr)
free_stringlist(&js->pub.possible_ce_nodes);
free_branch_state(&js->branch_states);
js->pub.payload_running = 0;
- rep(js->branch_tag_seqcode, NULL);
+ rep_null(js->branch_tag_seqcode);
rep(js->deep_resubmit_seqcode, e->any.seqcode);
}
js->last_seqcode &&
after_enter_wm(e->any.seqcode,js->last_seqcode))
{
- rep(js->branch_tag_seqcode,NULL);
- rep(js->deep_resubmit_seqcode,NULL);
- rep(js->last_branch_seqcode,NULL);
+ rep_null(js->branch_tag_seqcode);
+ rep_null(js->deep_resubmit_seqcode);
+ rep_null(js->last_branch_seqcode);
}
if (js->deep_resubmit_seqcode &&
if (js->pub.state != EDG_WLL_JOB_RUNNING) {
js->pub.suspended = 0;
- rep(js->pub.suspend_reason, NULL);
+ rep_null(js->pub.suspend_reason);
}
if (fine_res == RET_GOODBRANCH) {