qmaster

This module provides a Python API for interfacing with Apple’s Qmaster distributed transcode engine. It provides capabilities for fallback from the specified Qmaster cluster controller to local processing via “This Computer”, should the Qmaster cluster be down or unavailable. This module also provides timeout facilities to provide graceful fail operation in the event that a job submission hangs the Qmaster system.

qmaster.QmasterBatch

class qmaster.QmasterBatch(sourceFile='', destinationFile='', destinationDirectory='', cluster='', priority='', compressorSettingFile='', batchID='', batchName='')

Our main qmaster batch class, used to submit and monitor qmaster batches.

Parameters:
  • sourceFile (str) – Specify the source file to be submitted
  • destinationFile – Specify the destination file
  • destinationDirectory – Specify the destination directory (the original filename will be used with a .mov extension)
  • cluster (str) – Specify the Qmaster Cluster name
  • priority (str) – Specify the batch priority
  • compressorSettingFile (str) – Specify the full path to the compressor setting file
  • batchID (str) – Specify the batchID (used for checking batch status)
  • batchName (str) – Specify the batch name to use for submission
getStatus()

Returns the status of a running job.

Returns:(str) – The job status
Possible Status  
Processing  
Waiting  
PostProcessing  
Hold  
Cancelled  
Successful  
lastError()

Returns last error

logger(logMSG, logLevel='normal')

(very) Basic Logging Function, we’ll probably migrate to msg module

logs(logLevel='')

Returns an array of logs matching logLevel

submitBatch()

Submits the currently provided batch to compressor/qmaster for transcoding

Raises :qmaster.SourceFileError, qmaster.DestinationError, qmaster.QmasterSubmissionError, qmaster.ClusterNotFound, QmasterSubmissionTimeoutError
submitBatchAndWait()

This method will submit a running job and will block until the job has completed successfully or failed entirely

Raises :qmaster.SourceFileError, qmaster.DestinationError, qmaster.QmasterSubmissionError, qmaster.ClusterNotFound, qmaster.QmasterSubmissionTimeoutError, qmaster.QmasterJobCancelled, qmaster.QmasterJobFailed
class qmaster.batchmonitorParser(data)[source]

HTMLParser subclass to parse batch monitor output

Parameters:data (str) – Provide the data output by batch monitor

This object will set value for member status to the parsed status upon execution.

Sample Code

Use the qmaster module to get the status of a currently running job.

>>> myBatch = qmaster.QmasterBatch(
        batchID='B58B0883-3912-4109-8C8E-EB50C3F52C78',
        cluster='FCS Cluster')
>>> myBatch.getStatus()
'Processing'
>>> myBatch.getStatus()
'Successful'

Submit a file to compress and wait exit when it finishes.

>>> myBatch = qmaster.QmasterBatch()
>>> myBatch.cluster='FCS Cluster'
>>> myBatch.compressorSettingFile='/Users/hunterbj/Desktop/myH.264.setting'
>>> myBatch.sourceFile = '/Users/hunterbj/Desktop/mymov.mov'
>>> myBatch.destinationFile = '/Users/hunterbj/Desktop/myfileout.mov'
>>> myBatch.submitBatchAndWait()

Table Of Contents

Previous topic

fcsArchiver.archiveSet

Next topic

fcsxml

This Page