Safe Haskell | None |
---|
Ganeti lock structure
Synopsis
- data GanetiLocks
- = ClusterLockSet
- | BGL
- | InstanceLockSet
- | Instance String
- | NodeGroupLockSet
- | NodeGroup String
- | NodeLockSet
- | Node String
- | NodeResLockSet
- | NodeRes String
- | NetworkLockSet
- | Network String
- | ConfigLock
- lockName :: GanetiLocks -> String
- lockFromName :: String -> Result GanetiLocks
- data LockLevel
- lockLevelName :: LockLevel -> String
- lockLevelFromName :: String -> Result LockLevel
- lockLevel :: GanetiLocks -> LockLevel
- data ClientType
- = ClientOther String
- | ClientJob JobId
- data ClientId = ClientId {
- ciIdentifier :: ClientType
- ciLockFile :: FilePath
- ciPid :: ProcessID
- clientIdFromJSON :: JSValue -> Result ClientId
- type GanetiLockWaiting = LockWaiting GanetiLocks ClientId Integer
Documentation
data GanetiLocks Source #
The type of Locks available in Ganeti. The order of this type is the lock oder.
ClusterLockSet | |
BGL | |
InstanceLockSet | |
Instance String | |
NodeGroupLockSet | |
NodeGroup String | |
NodeLockSet | |
Node String | |
NodeResLockSet | |
NodeRes String | |
NetworkLockSet | |
Network String | |
ConfigLock | A lock used for a transitional period when WConfd keeps the state of the configuration, but all the operations are still performed on the Python side. |
Instances
lockName :: GanetiLocks -> String Source #
Provide the String representation of a lock
lockFromName :: String -> Result GanetiLocks Source #
Obtain a lock from its name.
The levels, the locks belong to.
LevelCluster | |
LevelInstance | |
LevelNodeGroup | |
LevelNode | |
LevelNodeRes | |
LevelNetwork | |
LevelConfig | A transitional level for internal configuration locks |
Instances
Enum LockLevel # | |
Defined in Ganeti.Locking.Locks | |
Eq LockLevel # | |
Show LockLevel # | |
JSON LockLevel # | |
Arbitrary LockLevel | |
lockLevelName :: LockLevel -> String Source #
Provide the names of the lock levels.
lockLevelFromName :: String -> Result LockLevel Source #
Obtain a lock level from its name/
lockLevel :: GanetiLocks -> LockLevel Source #
For a lock, provide its level.
data ClientType Source #
Type of entities capable of owning locks. Usually, locks are owned by jobs. However, occassionally other tasks need locks (currently, e.g., to lock the configuration). These are identified by a unique name, reported to WConfD as a strig.
ClientOther String | |
ClientJob JobId |
Instances
Eq ClientType # | |
Defined in Ganeti.Locking.Locks (==) :: ClientType -> ClientType -> Bool (/=) :: ClientType -> ClientType -> Bool | |
Ord ClientType # | |
Defined in Ganeti.Locking.Locks compare :: ClientType -> ClientType -> Ordering (<) :: ClientType -> ClientType -> Bool (<=) :: ClientType -> ClientType -> Bool (>) :: ClientType -> ClientType -> Bool (>=) :: ClientType -> ClientType -> Bool max :: ClientType -> ClientType -> ClientType min :: ClientType -> ClientType -> ClientType | |
Show ClientType # | |
Defined in Ganeti.Locking.Locks showsPrec :: Int -> ClientType -> ShowS show :: ClientType -> String showList :: [ClientType] -> ShowS | |
JSON ClientType # | |
Defined in Ganeti.Locking.Locks readJSON :: JSValue -> Result ClientType showJSON :: ClientType -> JSValue readJSONs :: JSValue -> Result [ClientType] showJSONs :: [ClientType] -> JSValue | |
Arbitrary ClientType | |
Defined in Test.Ganeti.Locking.Locks arbitrary :: Gen ClientType shrink :: ClientType -> [ClientType] |
A client is identified as a job id, thread id, a path to its process identifier file, and its process id.
The JobId isn't enough to identify a client as the master daemon also handles client calls that aren't jobs, but which use the configuration. These taks are identified by a unique name, reported to WConfD as a string.
ClientId | |
|
clientIdFromJSON :: JSValue -> Result ClientId Source #
Obtain the ClientID from its JSON representation.
type GanetiLockWaiting = LockWaiting GanetiLocks ClientId Integer Source #
The type of lock Allocations in Ganeti. In Ganeti, the owner of locks are jobs.