Safe Haskell | None |
---|
Implementation of the job queue.
- type Timestamp = (Int, Int)
- noTimestamp :: Timestamp
- data InputOpCode
- = ValidOpCode MetaOpCode
- | InvalidOpCode JSValue
- invalidOp :: String
- extractOpSummary :: InputOpCode -> String
- data QueuedOpCode = QueuedOpCode {
- qoInput :: InputOpCode
- qoStatus :: OpStatus
- qoResult :: JSValue
- qoLog :: [(Int, Timestamp, ELogType, JSValue)]
- qoPriority :: Int
- qoStartTimestamp :: Maybe Timestamp
- qoExecTimestamp :: Maybe Timestamp
- qoEndTimestamp :: Maybe Timestamp
- loadQueuedOpCode :: JSValue -> Result QueuedOpCode
- saveQueuedOpCode :: QueuedOpCode -> JSValue
- toDictQueuedOpCode :: QueuedOpCode -> [(String, JSValue)]
- data QueuedJob = QueuedJob {
- qjId :: JobId
- qjOps :: [QueuedOpCode]
- qjReceivedTimestamp :: Maybe Timestamp
- qjStartTimestamp :: Maybe Timestamp
- qjEndTimestamp :: Maybe Timestamp
- loadQueuedJob :: JSValue -> Result QueuedJob
- saveQueuedJob :: QueuedJob -> JSValue
- toDictQueuedJob :: QueuedJob -> [(String, JSValue)]
- jobFilePrefix :: String
- jobFileName :: JobId -> FilePath
- parseJobFileId :: Monad m => FilePath -> m JobId
- liveJobFile :: FilePath -> JobId -> FilePath
- archivedJobFile :: FilePath -> JobId -> FilePath
- opStatusToJob :: OpStatus -> JobStatus
- calcJobStatus :: QueuedJob -> JobStatus
- opStatusFinalized :: OpStatus -> Bool
- calcJobPriority :: QueuedJob -> Int
- ignoreIOError :: a -> Bool -> String -> IOError -> IO a
- allArchiveDirs :: FilePath -> IO [FilePath]
- determineJobDirectories :: FilePath -> Bool -> IO [FilePath]
- sequencer :: [Either IOError [JobId]] -> Either IOError [[JobId]]
- seqFolder :: Either IOError [[JobId]] -> Either IOError [JobId] -> Either IOError [[JobId]]
- getJobIDs :: [FilePath] -> IO (Either IOError [JobId])
- sortJobIDs :: [JobId] -> [JobId]
- getDirJobIDs :: FilePath -> IO (Either IOError [JobId])
- readJobDataFromDisk :: FilePath -> Bool -> JobId -> IO (Maybe (String, Bool))
- noSuchJob :: Result (QueuedJob, Bool)
- loadJobFromDisk :: FilePath -> Bool -> JobId -> IO (Result (QueuedJob, Bool))
Data types
noTimestamp :: TimestampSource
Missing timestamp type.
data InputOpCode Source
An input opcode.
ValidOpCode MetaOpCode | OpCode was parsed successfully |
InvalidOpCode JSValue | Invalid opcode |
Eq InputOpCode | |
Show InputOpCode | |
JSON InputOpCode | JSON instance for |
extractOpSummary :: InputOpCode -> StringSource
Tries to extract the opcode summary from an InputOpCode
. This
duplicates some functionality from the opSummary
function in
Ganeti.OpCodes.
data QueuedOpCode Source
QueuedOpCode | |
|
Eq QueuedOpCode | |
Show QueuedOpCode | |
JSON QueuedOpCode |
loadQueuedOpCode :: JSValue -> Result QueuedOpCodeSource
saveQueuedOpCode :: QueuedOpCode -> JSValueSource
toDictQueuedOpCode :: QueuedOpCode -> [(String, JSValue)]Source
QueuedJob | |
|
loadQueuedJob :: JSValue -> Result QueuedJobSource
saveQueuedJob :: QueuedJob -> JSValueSource
toDictQueuedJob :: QueuedJob -> [(String, JSValue)]Source
jobFilePrefix :: StringSource
jobFileName :: JobId -> FilePathSource
Computes the filename for a given job ID.
parseJobFileId :: Monad m => FilePath -> m JobIdSource
liveJobFile :: FilePath -> JobId -> FilePathSource
Computes the full path to a live job.
archivedJobFile :: FilePath -> JobId -> FilePathSource
Computes the full path to an archives job. BROKEN.
calcJobStatus :: QueuedJob -> JobStatusSource
Computes a queued job's status.
opStatusFinalized :: OpStatus -> BoolSource
Determine whether an opcode status is finalized.
calcJobPriority :: QueuedJob -> IntSource
Compute a job's priority.
ignoreIOError :: a -> Bool -> String -> IOError -> IO aSource
allArchiveDirs :: FilePath -> IO [FilePath]Source
determineJobDirectories :: FilePath -> Bool -> IO [FilePath]Source
Build list of directories containing job files. Note: compared to the Python version, this doesn't ignore a potential lost+found file.
getJobIDs :: [FilePath] -> IO (Either IOError [JobId])Source
Computes the list of all jobs in the given directories.
sortJobIDs :: [JobId] -> [JobId]Source
Sorts the a list of job IDs.
getDirJobIDs :: FilePath -> IO (Either IOError [JobId])Source
readJobDataFromDisk :: FilePath -> Bool -> JobId -> IO (Maybe (String, Bool))Source
loadJobFromDisk :: FilePath -> Bool -> JobId -> IO (Result (QueuedJob, Bool))Source
Loads a job from disk.