xrootd
Loading...
Searching...
No Matches
XrdXrootdJob.hh
Go to the documentation of this file.
1#ifndef __XRDXROOTDJOB_HH_
2#define __XRDXROOTDJOB_HH_
3/******************************************************************************/
4/* */
5/* X r d X r o o t d J o b . h h */
6/* */
7/* (c) 2006 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
33#include <sys/types.h>
34
35#include "Xrd/XrdJob.hh"
36#include "XrdOuc/XrdOucTList.hh"
38#include "XrdOuc/XrdOucTable.hh"
39
40class XrdOucProg;
41class XrdLink;
42class XrdScheduler;
43class XrdXrootdJob2Do;
45
46// Definition of options that can be passed to Schedule()
47//
48#define JOB_Sync 0x0001
49#define JOB_Unique 0x0002
50
51class XrdXrootdJob : public XrdJob
52{
53friend class XrdXrootdJob2Do;
54public:
55
56int Cancel(const char *jkey=0, XrdXrootdResponse *resp=0);
57
58void DoIt();
59
60// List() returns a list of all jobs in xml format
61//
63
64// args[0] if not null if prefixes the response
65// args[1-n] are passed to the prgram
66// The return value is whatever resp->Send() returns
67//
68int Schedule(const char *jkey, // Job Identifier
69 const char **args, // Zero terminated arglist
70 XrdXrootdResponse *resp, // Response object
71 int Opts=0);// Options (see above)
72
73 XrdXrootdJob(XrdScheduler *schp, // -> Scheduler
74 XrdOucProg *pgm, // -> Program Object
75 const char *jname, // -> Job name
76 int maxjobs=4); // Maximum simultaneous jobs
78
79private:
82 const char *rpfx,
83 XrdXrootdJob2Do *job);
84
85static const int reScan = 15*60;
86
91char *JobName;
94};
95#endif
Definition XrdJob.hh:43
Definition XrdOucProg.hh:38
Definition XrdOucTList.hh:42
Definition XrdOucTable.hh:38
Definition XrdScheduler.hh:46
Definition XrdSysPthread.hh:165
Definition XrdXrootdJob.hh:52
static const int reScan
Definition XrdXrootdJob.hh:85
XrdXrootdJob(XrdScheduler *schp, XrdOucProg *pgm, const char *jname, int maxjobs=4)
int Schedule(const char *jkey, const char **args, XrdXrootdResponse *resp, int Opts=0)
int maxJobs
Definition XrdXrootdJob.hh:92
int numJobs
Definition XrdXrootdJob.hh:93
XrdScheduler * Sched
Definition XrdXrootdJob.hh:88
XrdSysMutex myMutex
Definition XrdXrootdJob.hh:87
friend class XrdXrootdJob2Do
Definition XrdXrootdJob.hh:53
int Cancel(const char *jkey=0, XrdXrootdResponse *resp=0)
void CleanUp(XrdXrootdJob2Do *jp)
XrdOucTList * List(void)
XrdOucProg * theProg
Definition XrdXrootdJob.hh:90
char * JobName
Definition XrdXrootdJob.hh:91
int sendResult(XrdXrootdResponse *resp, const char *rpfx, XrdXrootdJob2Do *job)
XrdOucTable< XrdXrootdJob2Do > JobTable
Definition XrdXrootdJob.hh:89
Definition XrdXrootdResponse.hh:49