flux.job.kvslookup module

class flux.job.kvslookup.JobInfoLookupRPC(*args, **kwargs)

Bases: RPC

get()
get_decode()
class flux.job.kvslookup.JobKVSLookup(flux_handle, ids=[], keys=['jobspec'], decode=True, original=False, base=False)

Bases: object

User friendly class to lookup job KVS data

Some keys such as "jobspec" or "R" may be altered based on update events in the eventlog. Set 'base' to True to skip these updates and read exactly what is in the KVS.

Flux_handle

A Flux handle obtained from flux.Flux()

Ids

List of jobids to get data for

Keys

Optional list of keys to fetch. (default is "jobspec")

Decode

Optional flag to decode special data into Python data structures currently decodes "jobspec" and "R" into dicts (default True)

Original

For 'jobspec', return the original submitted jobspec

Base

For 'jobspec' or 'R', get base value, do not apply updates from eventlog

data()

Synchronously fetch a list of data responses

If the Future object returned by JobKVSLookup.fetch_data has not yet been fulfilled (e.g. is_ready() returns False), then this call may block. Otherwise, returns a list of responses for all job ids returned.

fetch_data()

Initiate the job info lookup to the Flux job-info module

JobKVSLookup.fetch_data() returns a JobKVSLookupFuture, which will be fulfilled when the job data is available.

Once the Future has been fulfilled, a list of objects can be obtained via JobKVSLookup.data(). If JobKVSLookupFuture.errors is non-empty, then it will contain a list of errors returned via the query.

class flux.job.kvslookup.JobKVSLookupFuture

Bases: WaitAllFuture

Wrapper Future for multiple jobids

get()

get all successful results, appending errors into self.errors

get_decode()

get all successful results, appending errors into self.errors. Decode special data into Python data structures

flux.job.kvslookup.decode_special_data(data)
flux.job.kvslookup.job_info_lookup(flux_handle, jobid, keys=['jobspec'], flags=0)
flux.job.kvslookup.job_kvs_lookup(flux_handle, jobid, keys=['jobspec'], decode=True, original=False, base=False)

Lookup job kvs data based on a jobid

Some keys such as "jobspec" or "R" may be altered based on update events in the eventlog. Set 'base' to True to skip these updates and read exactly what is in the KVS.

Flux_handle

A Flux handle obtained from flux.Flux()

Jobid

jobid to lookup info for

Keys

Optional list of keys to fetch. (default is "jobspec")

Decode

Optional flag to decode special data into Python data structures currently decodes "jobspec" and "R" into dicts (default True)

Original

For 'jobspec', return the original submitted jobspec

Base

For 'jobspec' or 'R', get base value, do not apply updates from eventlog