Safe Haskell | None |
---|
Ganeti.Locking.Locks
Description
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.
Constructors
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
Eq GanetiLocks # | |
Defined in Ganeti.Locking.Locks | |
Ord GanetiLocks # | |
Defined in Ganeti.Locking.Locks Methods compare :: GanetiLocks -> GanetiLocks -> Ordering (<) :: GanetiLocks -> GanetiLocks -> Bool (<=) :: GanetiLocks -> GanetiLocks -> Bool (>) :: GanetiLocks -> GanetiLocks -> Bool (>=) :: GanetiLocks -> GanetiLocks -> Bool max :: GanetiLocks -> GanetiLocks -> GanetiLocks min :: GanetiLocks -> GanetiLocks -> GanetiLocks | |
Show GanetiLocks # | |
Defined in Ganeti.Locking.Locks Methods showsPrec :: Int -> GanetiLocks -> ShowS show :: GanetiLocks -> String showList :: [GanetiLocks] -> ShowS | |
JSON GanetiLocks # | |
Defined in Ganeti.Locking.Locks Methods readJSON :: JSValue -> Result GanetiLocks showJSON :: GanetiLocks -> JSValue readJSONs :: JSValue -> Result [GanetiLocks] showJSONs :: [GanetiLocks] -> JSValue | |
Lock GanetiLocks # | |
Defined in Ganeti.Locking.Locks Methods lockImplications :: GanetiLocks -> [GanetiLocks] Source # | |
Arbitrary GanetiLocks | |
Defined in Test.Ganeti.Locking.Locks |
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.
Constructors
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.
Constructors
ClientOther String | |
ClientJob JobId |
Instances
Eq ClientType # | |
Defined in Ganeti.Locking.Locks | |
Ord ClientType # | |
Defined in Ganeti.Locking.Locks Methods 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 Methods showsPrec :: Int -> ClientType -> ShowS show :: ClientType -> String showList :: [ClientType] -> ShowS | |
JSON ClientType # | |
Defined in Ganeti.Locking.Locks Methods readJSON :: JSValue -> Result ClientType showJSON :: ClientType -> JSValue readJSONs :: JSValue -> Result [ClientType] showJSONs :: [ClientType] -> JSValue | |
Arbitrary ClientType | |
Defined in Test.Ganeti.Locking.Locks |
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.
Constructors
ClientId | |
Fields
|
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.