Safe Haskell | Safe-Infered |
---|
Implementation of functions specific to configuration management.
- loadConfigFromFile :: FilePath -> ResultG (ConfigData, FStat)
- writeConfigToFile :: (MonadBase IO m, MonadError GanetiException m, MonadLog m) => ConfigData -> FilePath -> FStat -> m FStat
- readConfig :: WConfdMonad ConfigData
- writeConfig :: ConfigData -> WConfdMonad ()
- finishOrLog :: (Show e, MonadLog m) => Priority -> String -> (a -> m ()) -> GenericResult e a -> m ()
- mkStatelessAsyncTask :: (MonadBaseControl IO m, MonadLog m, Show e, Monoid i) => Priority -> String -> (i -> ResultT e m ()) -> m (AsyncWorker i ())
- mkStatefulAsyncTask :: (MonadBaseControl IO m, MonadLog m, Show e, Monoid i) => Priority -> String -> s -> (s -> i -> ResultT e m s) -> m (AsyncWorker i ())
- saveConfigAsyncTask :: FilePath -> FStat -> IO ConfigState -> [AsyncWorker () ()] -> ResultG (AsyncWorker Any ())
- execRpcCallAndLog :: Rpc a b => [Node] -> a -> ResultG ()
- distMCsAsyncTask :: RuntimeEnts -> FilePath -> IO ConfigState -> ResultG (AsyncWorker () ())
- distSSConfAsyncTask :: IO ConfigState -> ResultG (AsyncWorker () ())
Documentation
loadConfigFromFile :: FilePath -> ResultG (ConfigData, FStat)Source
Loads the configuration from the file, if it hasn't been loaded yet. The function is internal and isn't thread safe.
writeConfigToFile :: (MonadBase IO m, MonadError GanetiException m, MonadLog m) => ConfigData -> FilePath -> FStat -> m FStatSource
writeConfig :: ConfigData -> WConfdMonad ()Source
Asynchronous tasks
finishOrLog :: (Show e, MonadLog m) => Priority -> String -> (a -> m ()) -> GenericResult e a -> m ()Source
mkStatelessAsyncTask :: (MonadBaseControl IO m, MonadLog m, Show e, Monoid i) => Priority -> String -> (i -> ResultT e m ()) -> m (AsyncWorker i ())Source
mkStatefulAsyncTask :: (MonadBaseControl IO m, MonadLog m, Show e, Monoid i) => Priority -> String -> s -> (s -> i -> ResultT e m s) -> m (AsyncWorker i ())Source
:: FilePath | Path to the config file |
-> FStat | The initial state of the config. file |
-> IO ConfigState | An action to read the current config |
-> [AsyncWorker () ()] | Workers to be triggered afterwards |
-> ResultG (AsyncWorker Any ()) |
Construct an asynchronous worker whose action is to save the
configuration to the master file.
The worker's action reads the configuration using the given IO
action
and uses FStat
to check if the configuration hasn't been modified by
another process.
If Any
of the input requests is true, given additional worker
will be executed synchronously after sucessfully writing the configuration
file. Otherwise, they'll be just triggered asynchronously.
execRpcCallAndLog :: Rpc a b => [Node] -> a -> ResultG ()Source
:: RuntimeEnts | |
-> FilePath | Path to the config file |
-> IO ConfigState | An action to read the current config |
-> ResultG (AsyncWorker () ()) |
Construct an asynchronous worker whose action is to distribute the configuration to master candidates.
:: IO ConfigState | An action to read the current config |
-> ResultG (AsyncWorker () ()) |
Construct an asynchronous worker whose action is to construct SSConf
and distribute it to master candidates.
The worker's action reads the configuration using the given IO
action,
computes the current SSConf, compares it to the previous version, and
if different, distributes it.