Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Public Attributes | Private Attributes
Arc::Job Class Reference

Job. More...

#include <Job.h>

Collaboration diagram for Arc::Job:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Job ()
 Create a Job object.
 ~Job ()
void Print (bool longlist) const
 Print the Job information to std::cout.
 Job (void)
 Job (JobRequest &d, JobSchedMetaData &m)
 Job (ByteArray &buf)
ByteArrayserialize (void)
 ~Job (void)
const std::string & getID (void)
void setFailure (const std::string &f)
const std::string & getFailure (void)
void setStatus (SchedJobStatus s)
SchedJobStatus getStatus (void)
Arc::XMLNodegetJSDL (void)
JobSchedMetaDatagetJobSchedMetaData (void)
 operator bool (void)
bool operator! (void)
 operator std::string (void) const

Public Attributes

std::string Flavour
URL JobID
URL Cluster
URL SubmissionEndpoint
URL InfoEndpoint
URL ISB
URL OSB
URL AuxURL
std::string AuxInfo
std::string Name
std::string Type
URL IDFromEndpoint
std::string LocalIDFromManager
std::string JobDescription
JobState State
std::string RestartState
std::map< std::string,
std::string > 
AuxStates
std::map< std::string,
std::string > 
RestartStates
int ExitCode
std::string ComputingManagerExitCode
std::list< std::string > Error
int WaitingPosition
std::string UserDomain
std::string Owner
std::string LocalOwner
Period RequestedTotalWallTime
Period RequestedTotalCPUTime
int RequestedMainMemory
int RequestedSlots
std::list< std::string > RequestedApplicationEnvironment
std::string StdIn
std::string StdOut
std::string StdErr
std::string LogDir
std::list< std::string > ExecutionNode
std::string ExecutionCE
std::string Queue
Period UsedTotalWallTime
Period UsedTotalCPUTime
int UsedMainMemory
std::list< std::string > UsedApplicationEnvironment
int UsedSlots
Time LocalSubmissionTime
Time SubmissionTime
Time ComputingManagerSubmissionTime
Time StartTime
Time ComputingManagerEndTime
Time EndTime
Time WorkingAreaEraseTime
Time ProxyExpirationTime
std::string SubmissionHost
std::string SubmissionClientName
Time CreationTime
Period Validity
std::list< std::string > OtherMessages
URL JobManagementEndpoint
URL DataStagingEndpoint
std::list< std::string > ActivityOldId
bool VirtualMachine
std::string UsedCPUType
std::string UsedOSFamily
std::string UsedPlatform

Private Attributes

std::string id_
JobRequestrequest_
JobSchedMetaDatasched_meta_
SchedJobStatus status_
ByteArray buffer_

Detailed Description

Job.

This class describe a Grid job. Most of the members contained in this class are directly linked to the ComputingActivity defined in the GLUE Specification v. 2.0 (GFD-R-P.147).

Definition at line 20 of file Job.h.


Constructor & Destructor Documentation

Arc::Job::Job ( void  )

Create a Job object.

Default constructor. Takes no arguments.

Definition at line 13 of file Job.cpp.

Arc::Job::~Job ( void  )

Definition at line 35 of file Job.cpp.

{}
Arc::Job::Job ( void  )

Definition at line 15 of file job.cpp.

                                          :buffer_(0)
{
    id_ = Arc::UUID();
    request_ = new JobRequest(r);
    sched_meta_ = new JobSchedMetaData(m);
    status_ = JOB_STATUS_SCHED_NEW;
}

Here is the call graph for this function:

Definition at line 23 of file job.cpp.

{
    size_t buf_len = 0;
    char *buf = buffer.data();
    
    // get id
    id_ = buf;
    buf_len = id_.size() + 1;
    // get status
    status_ = *((SchedJobStatus *)(buf + buf_len));
    buf_len += sizeof(SchedJobStatus);
    // get request class
    size_t bs = *((size_t *)(buf + buf_len));
    buf_len += sizeof(size_t);
    ByteArray a1(bs);
    a1.append(buf + buf_len, bs);
    buf_len += bs;
    request_ = new JobRequest(a1);
    // get sched meta class
    bs = *((size_t *)(buf + buf_len));
    buf_len += sizeof(size_t);
    ByteArray a2(bs);
    a2.append(buf + buf_len, bs);
    buf_len += bs;
    sched_meta_ = new JobSchedMetaData(a2);
}

Here is the call graph for this function:

Arc::Job::~Job ( void  )

Member Function Documentation

const std::string& Arc::Job::getFailure ( void  ) [inline]

Definition at line 31 of file job.h.

{ return sched_meta_->getFailure(); };

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string& Arc::Job::getID ( void  ) [inline]

Definition at line 29 of file job.h.

{ return id_; };

Here is the caller graph for this function:

Definition at line 35 of file job.h.

{ return sched_meta_; };

Here is the caller graph for this function:

Arc::XMLNode& Arc::Job::getJSDL ( void  ) [inline]

Definition at line 34 of file job.h.

{ return request_->getJSDL(); };

Here is the call graph for this function:

Here is the caller graph for this function:

SchedJobStatus Arc::Job::getStatus ( void  ) [inline]

Definition at line 33 of file job.h.

{ return status_; };

Here is the caller graph for this function:

Arc::Job::operator bool ( void  ) [inline]

Definition at line 36 of file job.h.

{ return (id_.empty() ? false : true ); };
Arc::Job::operator std::string ( void  ) const

Definition at line 68 of file job.cpp.

{
    std::string out =   "ID: " + id_ + "\n"
                      + "Status: " + sched_status_to_string(status_) + "\n"
                      + (std::string)*request_ 
                      + (std::string)*sched_meta_;
    return out;
}

Here is the call graph for this function:

bool Arc::Job::operator! ( void  ) [inline]

Definition at line 37 of file job.h.

{ return (id_.empty() ? true : false ); };
void Arc::Job::Print ( bool  longlist) const

Print the Job information to std::cout.

Method to print the Job attributes to std::cout

Parameters:
longlistis boolean for long listing (more details).

Definition at line 37 of file Job.cpp.

                                     {

    std::cout << IString("Job: %s", JobID.str()) << std::endl;
    if (!Name.empty())
      std::cout << IString(" Name: %s", Name) << std::endl;
    if (!State().empty())
      std::cout << IString(" State: %s (%s)", State.GetGeneralState(), State())
                << std::endl;
    if (ExitCode != -1)
      std::cout << IString(" Exit Code: %d", ExitCode) << std::endl;
    if (!Error.empty()) {
      std::list<std::string>::const_iterator iter;
      for (iter = Error.begin(); iter != Error.end(); iter++)
        std::cout << IString(" Error: %s", *iter) << std::endl;
    }
    if (longlist) {
      if (!Owner.empty())
        std::cout << IString(" Owner: %s", Owner) << std::endl;
      if (!OtherMessages.empty())
        for (std::list<std::string>::const_iterator iter = OtherMessages.begin();
             iter != OtherMessages.end(); iter++)
          std::cout << IString(" Other Messages: %s", *iter)
                    << std::endl;
      if (!ExecutionCE.empty())
        std::cout << IString(" ExecutionCE: %s", ExecutionCE)
                  << std::endl;
      if (!Queue.empty())
        std::cout << IString(" Queue: %s", Queue) << std::endl;
      if (UsedSlots != -1)
        std::cout << IString(" Used Slots: %d", UsedSlots) << std::endl;
      if (WaitingPosition != -1)
        std::cout << IString(" Waiting Position: %d", WaitingPosition)
                  << std::endl;
      if (!StdIn.empty())
        std::cout << IString(" Stdin: %s", StdIn) << std::endl;
      if (!StdOut.empty())
        std::cout << IString(" Stdout: %s", StdOut) << std::endl;
      if (!StdErr.empty())
        std::cout << IString(" Stderr: %s", StdErr) << std::endl;
      if (!LogDir.empty())
        std::cout << IString(" Grid Manager Log Directory: %s", LogDir)
                  << std::endl;
      if (SubmissionTime != -1)
        std::cout << IString(" Submitted: %s",
                             (std::string)SubmissionTime) << std::endl;
      if (EndTime != -1)
        std::cout << IString(" End Time: %s", (std::string)EndTime)
                  << std::endl;
      if (!SubmissionHost.empty())
        std::cout << IString(" Submitted from: %s", SubmissionHost)
                  << std::endl;
      if (!SubmissionClientName.empty())
        std::cout << IString(" Submitting client: %s",
                             SubmissionClientName) << std::endl;
      if (RequestedTotalCPUTime != -1)
        std::cout << IString(" Requested CPU Time: %s",
                             RequestedTotalCPUTime.istr())
                  << std::endl;
      if (UsedTotalCPUTime != -1)
        std::cout << IString(" Used CPU Time: %s",
                             UsedTotalCPUTime.istr()) << std::endl;
      if (UsedTotalWallTime != -1)
        std::cout << IString(" Used Wall Time: %s",
                             UsedTotalWallTime.istr()) << std::endl;
      if (UsedMainMemory != -1)
        std::cout << IString(" Used Memory: %d", UsedMainMemory)
                  << std::endl;
      if (WorkingAreaEraseTime != -1)
        std::cout << IString((State == JobState::DELETED) ?
                             istring(" Results were deleted: %s") :
                             istring(" Results must be retrieved before: %s"),
                             (std::string)WorkingAreaEraseTime)
                  << std::endl;
      if (ProxyExpirationTime != -1)
        std::cout << IString(" Proxy valid until: %s",
                             (std::string)ProxyExpirationTime)
                  << std::endl;
      if (CreationTime != -1)
        std::cout << IString(" Entry valid from: %s",
                             (std::string)CreationTime) << std::endl;
      if (Validity != -1)
        std::cout << IString(" Entry valid for: %s",
                             Validity.istr()) << std::endl;
    }

    std::cout << std::endl;

  } // end Print

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 50 of file job.cpp.

{
    buffer_.clean();
    buffer_.append(id_);
    buffer_.append(&status_, sizeof(SchedJobStatus));
    ByteArray &a1 = request_->serialize();
    buffer_.append(a1);
    ByteArray &a2 = sched_meta_->serialize();
    buffer_.append(a2);
    return buffer_;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::Job::setFailure ( const std::string &  f) [inline]

Definition at line 30 of file job.h.

Here is the call graph for this function:

void Arc::Job::setStatus ( SchedJobStatus  s) [inline]

Definition at line 32 of file job.h.

{ status_ = s; };

Here is the caller graph for this function:


Member Data Documentation

std::list<std::string> Arc::Job::ActivityOldId

Definition at line 94 of file Job.h.

std::string Arc::Job::AuxInfo

Definition at line 42 of file Job.h.

std::map<std::string, std::string> Arc::Job::AuxStates

Definition at line 52 of file Job.h.

Definition at line 41 of file Job.h.

Definition at line 22 of file job.h.

Definition at line 34 of file Job.h.

Definition at line 82 of file Job.h.

Definition at line 55 of file Job.h.

Definition at line 80 of file Job.h.

Definition at line 88 of file Job.h.

Definition at line 93 of file Job.h.

Definition at line 83 of file Job.h.

std::list<std::string> Arc::Job::Error

Definition at line 56 of file Job.h.

std::string Arc::Job::ExecutionCE

Definition at line 71 of file Job.h.

std::list<std::string> Arc::Job::ExecutionNode

Definition at line 70 of file Job.h.

Definition at line 54 of file Job.h.

std::string Arc::Job::Flavour

Definition at line 32 of file Job.h.

std::string Arc::Job::id_ [private]

Definition at line 17 of file job.h.

Definition at line 47 of file Job.h.

Definition at line 37 of file Job.h.

Definition at line 38 of file Job.h.

Definition at line 49 of file Job.h.

Definition at line 33 of file Job.h.

Definition at line 92 of file Job.h.

Definition at line 48 of file Job.h.

std::string Arc::Job::LocalOwner

Definition at line 60 of file Job.h.

Definition at line 78 of file Job.h.

std::string Arc::Job::LogDir

Definition at line 69 of file Job.h.

std::string Arc::Job::Name

Definition at line 45 of file Job.h.

Definition at line 39 of file Job.h.

std::list<std::string> Arc::Job::OtherMessages

Definition at line 90 of file Job.h.

std::string Arc::Job::Owner

Definition at line 59 of file Job.h.

Definition at line 85 of file Job.h.

std::string Arc::Job::Queue

Definition at line 72 of file Job.h.

Definition at line 18 of file job.h.

Definition at line 65 of file Job.h.

Definition at line 63 of file Job.h.

Definition at line 64 of file Job.h.

Definition at line 62 of file Job.h.

Definition at line 61 of file Job.h.

Definition at line 51 of file Job.h.

std::map<std::string, std::string> Arc::Job::RestartStates

Definition at line 53 of file Job.h.

Definition at line 19 of file job.h.

Definition at line 81 of file Job.h.

Definition at line 50 of file Job.h.

Definition at line 20 of file job.h.

std::string Arc::Job::StdErr

Definition at line 68 of file Job.h.

std::string Arc::Job::StdIn

Definition at line 66 of file Job.h.

std::string Arc::Job::StdOut

Definition at line 67 of file Job.h.

Definition at line 87 of file Job.h.

Definition at line 36 of file Job.h.

Definition at line 86 of file Job.h.

Definition at line 79 of file Job.h.

std::string Arc::Job::Type

Definition at line 46 of file Job.h.

std::list<std::string> Arc::Job::UsedApplicationEnvironment

Definition at line 76 of file Job.h.

std::string Arc::Job::UsedCPUType

Definition at line 97 of file Job.h.

Definition at line 75 of file Job.h.

Definition at line 98 of file Job.h.

Definition at line 99 of file Job.h.

Definition at line 77 of file Job.h.

Definition at line 74 of file Job.h.

Definition at line 73 of file Job.h.

std::string Arc::Job::UserDomain

Definition at line 58 of file Job.h.

Definition at line 89 of file Job.h.

Definition at line 96 of file Job.h.

Definition at line 57 of file Job.h.

Definition at line 84 of file Job.h.


The documentation for this class was generated from the following files: