ganeti

Safe HaskellSafe-Infered

Ganeti.Locking.Locks

Description

Ganeti lock structure

Synopsis

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 
NodeAllocLockSet 
NAL 
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 -> StringSource

Provide the String representation of a lock

lockFromName :: String -> Result GanetiLocksSource

data LockLevel Source

The levels, the locks belong to.

Constructors

LevelCluster 
LevelInstance 
LevelNodeAlloc 
LevelNodeGroup 
LevelNode 
LevelNodeRes 
LevelNetwork 
LevelConfig

A transitional level for internal configuration locks

Instances

Enum LockLevel 
Eq LockLevel 
Show LockLevel 
Arbitrary LockLevel 
JSON LockLevel 

lockLevel :: GanetiLocks -> LockLevelSource

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 
Ord ClientType 
Show ClientType 
Arbitrary ClientType 
JSON ClientType 

data ClientId Source

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

ciIdentifier :: ClientType
 
ciLockFile :: FilePath
 
ciPid :: ProcessID
 

Instances

Eq ClientId 
Ord ClientId 
Show ClientId 
Arbitrary ClientId 
JSON ClientId 

clientIdFromJSON :: JSValue -> Result ClientIdSource

type GanetiLockWaiting = LockWaiting GanetiLocks ClientId IntegerSource

The type of lock Allocations in Ganeti. In Ganeti, the owner of locks are jobs.