extern int edg_wll_DoLogEvent(edg_wll_Context context, edg_wll_LogLine logline);
extern int edg_wll_DoLogEventProxy(edg_wll_Context context, edg_wll_LogLine logline);
+extern int edg_wll_DoLogEventDirect(edg_wll_Context context, edg_wll_LogLine logline);
static const char *me;
static void usage()
{
- fprintf(stderr,"usage: %s -m bkserver [-x] [-N numjobs] [-n subjobs (each)] -f file_name \n", me);
+ fprintf(stderr,"usage: %s -m bkserver [-x|-y] [-N numjobs] [-n subjobs (each)] -f file_name \n", me);
+ fprintf(stderr," - event file not containing DG.JOBID and without -x or -z not containing DG.USER\n");
}
int main(int argc, char *argv[])
{
char *job = NULL,*server = NULL,*seq = NULL,*filename = NULL;
char buf[MAXMSGSIZE];
- int lbproxy = 0, num_subjobs = 0;
+ int lbproxy = 0, num_subjobs = 0, lbdirect = 0;
int done = 0, njobs = 1,i,j;
edg_wll_Context ctx;
edg_wlc_JobId jobid,*subjobs;
me = strdup(argv[0]);
do {
- switch (getopt(argc,argv,"m:xN:n:f:")) {
+ switch (getopt(argc,argv,"m:xyN:n:f:")) {
case 'm': server = strdup(optarg); break;
case 'x': lbproxy = 1; break;
+ case 'y': lbdirect = 1; break;
case 'N': njobs = atoi(optarg); break;
case 'n': num_subjobs = atoi(optarg); break;
case 'f': filename = (char *) strdup(optarg); break;
case -1: done = 1; break;
}
} while (!done);
+
+ if (lbproxy && lbdirect) {
+ fprintf(stderr,"%s: only one of -x or -y options may be specified \n",me);
+ usage();
+ exit(1);
+ }
if (!server) {
fprintf(stderr,"%s: -m required\n",me);
fprintf(stderr,"edg_wll_DoLogEventProxy(): %s (%s)\n",et,ed);
exit(1);
}
+ } else if (lbdirect) {
+ if (edg_wll_DoLogEventDirect(ctx,logline)) {
+ char *et,*ed;
+ edg_wll_Error(ctx,&et,&ed);
+ fprintf(stderr,"edg_wll_DoLogEvent(): %s (%s)\n",et,ed);
+ exit(1);
+ }
} else {
if (edg_wll_DoLogEvent(ctx,logline)) {
char *et,*ed;
exit(1);
}
}
+
if (logline) free(logline);
}
}