Safe Haskell | Safe-Infered |
---|
Implementation of the iallocator interface.
- type IAllocResult = (String, JSValue, List, List)
- parseBaseInstance :: String -> JSRecord -> Result (String, Instance)
- parseInstance :: NameAssoc -> String -> JSRecord -> Result (String, Instance)
- parseNode :: NameAssoc -> String -> JSRecord -> Result (String, Node)
- parseGroup :: String -> JSRecord -> Result (String, Group)
- parseData :: ClockTime -> String -> Result ([String], Request)
- formatResponse :: Bool -> String -> JSValue -> String
- describeSolution :: AllocSolution -> String
- formatAllocate :: List -> AllocSolution -> Result IAllocResult
- formatMultiAlloc :: (List, List, AllocSolutionList) -> Result IAllocResult
- formatNodeEvac :: List -> List -> List -> (List, List, EvacSolution) -> Result IAllocResult
- processRelocate :: List -> List -> List -> Idx -> Int -> [Ndx] -> Result (List, List, [Ndx])
- formatRelocate :: (List, List, [Ndx]) -> Result IAllocResult
- processRequest :: Request -> Result IAllocResult
- readRequest :: FilePath -> IO Request
- runIAllocator :: Request -> (Maybe (List, List), String)
- loadData :: FilePath -> IO (Result ClusterData)
Documentation
type IAllocResult = (String, JSValue, List, List)Source
parseBaseInstance :: String -> JSRecord -> Result (String, Instance)Source
parseGroup :: String -> JSRecord -> Result (String, Group)Source
formatResponse :: Bool -> String -> JSValue -> StringSource
describeSolution :: AllocSolution -> StringSource
formatNodeEvac :: List -> List -> List -> (List, List, EvacSolution) -> Result IAllocResultSource
:: List | The group list |
-> List | The node list |
-> List | The instance list |
-> Idx | The index of the instance to move |
-> Int | The number of nodes required |
-> [Ndx] | Nodes which should not be used |
-> Result (List, List, [Ndx]) | Solution list |
Runs relocate for a single instance.
This is wrapper over the tryNodeEvac
function that is run
with a single instance (ours), and further it checks that the
result it got (in the nodes field) is actually consistent, as
tryNodeEvac is designed to output primarily an opcode list, not a
node list.
formatRelocate :: (List, List, [Ndx]) -> Result IAllocResultSource
readRequest :: FilePath -> IO RequestSource
Reads the request from the data file(s).
runIAllocator :: Request -> (Maybe (List, List), String)Source
Main iallocator pipeline.
:: FilePath | The path to the file |
-> IO (Result ClusterData) |
Load the data from an iallocation request file