Package gavo :: Package votable :: Module tapquery :: Class ADQLTAPJob
[frames] | no frames]

Class ADQLTAPJob

source code

   object --+    
            |    
_WithEndpoint --+
                |
               ADQLTAPJob

A facade for an ADQL-based async TAP job.

Construct it with the URL of the async endpoint and a query.

Alternatively, you can give the endpoint URL and a jobId as a keyword parameter. This only makes sense if the service has handed out the jobId before (e.g., when a different program takes up handling of a job started before).

Instance Methods
 
__init__(self, endpointURL, query=None, jobId=None, lang='ADQL', userParams={}, timeout=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
delete(self, usePOST=False)
removes the job on the remote side.
source code
 
start(self)
asks the remote side to start the job.
source code
 
abort(self)
asks the remote side to abort the job.
source code
 
raiseIfError(self)
raises an appropriate error message if job has thrown an error or has been aborted.
source code
 
waitForPhases(self, phases, pollInterval=1, increment=1.189207115, giveUpAfter=None)
waits for the job's phase to become one of the set phases.
source code
 
run(self, pollInterval=1)
runs the job and waits until it has finished.
source code
 
makeJobURL(self, jobPath) source code
 
getResultURL(self, simple=True)
returns the URL of the ADQL result table.
source code
 
openResult(self, simple=True)
returns a file-like object you can read the default TAP result off.
source code
 
setParameter(self, key, value) source code
 
getErrorFromServer(self)
returns the error message the server gives, verbatim.
source code
 
addUpload(self, name, data)
adds uploaded tables, either from a file or as a remote URL.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  executionDuration
  destruction
  info
returns a dictionary of much job-related information.
  phase
returns the phase the job is in according to the server.
  quote
returns the estimate the server gives for the run time of the job.
  owner
returns the owner of the job.
  parameters
returns a dictionary mapping passed parameters to server-provided string representations.
  allResults
returns a list of UWSResult instances.

Inherited from object: __class__

Method Details

__init__(self, endpointURL, query=None, jobId=None, lang='ADQL', userParams={}, timeout=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

delete(self, usePOST=False)

source code 

removes the job on the remote side.

usePOST=True can be used for servers that do not support the DELETE HTTP method (a.k.a. "are broken").

waitForPhases(self, phases, pollInterval=1, increment=1.189207115, giveUpAfter=None)

source code 

waits for the job's phase to become one of the set phases.

This method polls. Initially, it does increases poll times exponentially with increment until it queries every two minutes.

The magic number in increment is 2**(1/4.).

giveUpAfter, if given, is the number of iterations this method will do. If none of the desired phases have been found until then, raise a ProtocolError.

run(self, pollInterval=1)

source code 

runs the job and waits until it has finished.

The function raises an exception with an error message gleaned from the server.

openResult(self, simple=True)

source code 

returns a file-like object you can read the default TAP result off.

To have the embedded VOTable returned, say votable.load(job.openResult()).

If you pass simple=False, the URL will be taken from the service's result list (the first one given there). Otherwise (the default), results/result is used.

addUpload(self, name, data)

source code 

adds uploaded tables, either from a file or as a remote URL.

You should not try to change UPLOAD yourself (e.g., using setParameter).

Data is either a string (i.e. a URI) or a file-like object (an upload).


Property Details

executionDuration

Get Method:
unreachable.getter(self)
Set Method:
unreachable.setter(self, value)

destruction

Get Method:
unreachable.getter(self)
Set Method:
unreachable.setter(self, value)

info

returns a dictionary of much job-related information.

Get Method:
unreachable.info(self) - returns a dictionary of much job-related information.

phase

returns the phase the job is in according to the server.

Get Method:
unreachable.phase(self) - returns the phase the job is in according to the server.

quote

returns the estimate the server gives for the run time of the job.

Get Method:
unreachable.quote(self) - returns the estimate the server gives for the run time of the job.

owner

returns the owner of the job.

Get Method:
unreachable.owner(self) - returns the owner of the job.

parameters

returns a dictionary mapping passed parameters to server-provided string representations.

To set a parameter, use the setParameter function. Changing the dictionary returned here will have no effect.

Get Method:
unreachable.parameters(self) - returns a dictionary mapping passed parameters to server-provided string representations.

allResults

returns a list of UWSResult instances.

Get Method:
unreachable.allResults(self) - returns a list of UWSResult instances.