XRootD
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
"
37
#include "
XrdSys/XrdSysPthread.hh
"
38
#include "
XrdOuc/XrdOucTable.hh
"
39
40
class
XrdOucProg
;
41
class
XrdLink
;
42
class
XrdScheduler
;
43
class
XrdXrootdJob2Do
;
44
class
XrdXrootdResponse
;
45
46
// Definition of options that can be passed to Schedule()
47
//
48
#define JOB_Sync 0x0001
49
#define JOB_Unique 0x0002
50
51
class
XrdXrootdJob
:
public
XrdJob
52
{
53
friend
class
XrdXrootdJob2Do
;
54
public
:
55
56
int
Cancel
(
const
char
*jkey=0,
XrdXrootdResponse
*resp=0);
57
58
void
DoIt
();
59
60
// List() returns a list of all jobs in xml format
61
//
62
XrdOucTList
*
List
(
void
);
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
//
68
int
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
77
~XrdXrootdJob
();
78
79
private
:
80
void
CleanUp(
XrdXrootdJob2Do
*jp);
81
int
sendResult(
XrdXrootdResponse
*resp,
82
const
char
*rpfx,
83
XrdXrootdJob2Do
*job);
84
85
static
const
int
reScan = 15*60;
86
87
XrdSysMutex
myMutex;
88
XrdScheduler
*
Sched
;
89
XrdOucTable<XrdXrootdJob2Do>
JobTable;
90
XrdOucProg
*theProg;
91
char
*JobName;
92
int
maxJobs;
93
int
numJobs;
94
};
95
#endif
XrdJob.hh
XrdOucTList.hh
XrdOucTable.hh
XrdSysPthread.hh
XrdJob
Definition:
XrdJob.hh:43
XrdLink
Definition:
XrdLink.hh:52
XrdOucProg
Definition:
XrdOucProg.hh:38
XrdOucTList
Definition:
XrdOucTList.hh:42
XrdOucTable< XrdXrootdJob2Do >
XrdScheduler
Definition:
XrdScheduler.hh:46
XrdSysMutex
Definition:
XrdSysPthread.hh:165
XrdXrootdJob2Do
Definition:
XrdXrootdJob.cc:54
XrdXrootdJob
Definition:
XrdXrootdJob.hh:52
XrdXrootdJob::XrdXrootdJob
XrdXrootdJob(XrdScheduler *schp, XrdOucProg *pgm, const char *jname, int maxjobs=4)
Definition:
XrdXrootdJob.cc:454
XrdXrootdJob::Schedule
int Schedule(const char *jkey, const char **args, XrdXrootdResponse *resp, int Opts=0)
Definition:
XrdXrootdJob.cc:598
XrdXrootdJob::DoIt
void DoIt()
Definition:
XrdXrootdJob.cc:542
XrdXrootdJob::Cancel
int Cancel(const char *jkey=0, XrdXrootdResponse *resp=0)
Definition:
XrdXrootdJob.cc:494
XrdXrootdJob::List
XrdOucTList * List(void)
Definition:
XrdXrootdJob.cc:569
XrdXrootdJob::~XrdXrootdJob
~XrdXrootdJob()
Definition:
XrdXrootdJob.cc:482
XrdXrootdResponse
Definition:
XrdXrootdResponse.hh:49
XrdGlobal::Sched
XrdScheduler Sched
Definition:
XrdLinkCtl.cc:54
XrdMpx::Opts
int Opts
Definition:
XrdMpxStats.cc:58
XrdXrootd
XrdXrootdJob.hh
Generated by
1.9.1