root / src / Ganeti / Locking / Locks.hs @ 80004e70
History | View | Annotate | Download (1.3 kB)
1 | 95eb97c8 | Klaus Aehlig | {-| Ganeti lock structure |
---|---|---|---|
2 | 95eb97c8 | Klaus Aehlig | |
3 | 95eb97c8 | Klaus Aehlig | -} |
4 | 95eb97c8 | Klaus Aehlig | |
5 | 95eb97c8 | Klaus Aehlig | {- |
6 | 95eb97c8 | Klaus Aehlig | |
7 | 95eb97c8 | Klaus Aehlig | Copyright (C) 2014 Google Inc. |
8 | 95eb97c8 | Klaus Aehlig | |
9 | 95eb97c8 | Klaus Aehlig | This program is free software; you can redistribute it and/or modify |
10 | 95eb97c8 | Klaus Aehlig | it under the terms of the GNU General Public License as published by |
11 | 95eb97c8 | Klaus Aehlig | the Free Software Foundation; either version 2 of the License, or |
12 | 95eb97c8 | Klaus Aehlig | (at your option) any later version. |
13 | 95eb97c8 | Klaus Aehlig | |
14 | 95eb97c8 | Klaus Aehlig | This program is distributed in the hope that it will be useful, but |
15 | 95eb97c8 | Klaus Aehlig | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | 95eb97c8 | Klaus Aehlig | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | 95eb97c8 | Klaus Aehlig | General Public License for more details. |
18 | 95eb97c8 | Klaus Aehlig | |
19 | 95eb97c8 | Klaus Aehlig | You should have received a copy of the GNU General Public License |
20 | 95eb97c8 | Klaus Aehlig | along with this program; if not, write to the Free Software |
21 | 95eb97c8 | Klaus Aehlig | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
22 | 95eb97c8 | Klaus Aehlig | 02110-1301, USA. |
23 | 95eb97c8 | Klaus Aehlig | |
24 | 95eb97c8 | Klaus Aehlig | -} |
25 | 95eb97c8 | Klaus Aehlig | |
26 | 95eb97c8 | Klaus Aehlig | module Ganeti.Locking.Locks |
27 | 95eb97c8 | Klaus Aehlig | ( GanetiLocks(..) |
28 | 95eb97c8 | Klaus Aehlig | , GanetiLockAllocation |
29 | 95eb97c8 | Klaus Aehlig | ) where |
30 | 95eb97c8 | Klaus Aehlig | |
31 | 95eb97c8 | Klaus Aehlig | import Ganeti.Locking.Allocation |
32 | 75033afd | Klaus Aehlig | import Ganeti.Locking.Types |
33 | 95eb97c8 | Klaus Aehlig | import Ganeti.Types |
34 | 95eb97c8 | Klaus Aehlig | |
35 | 95eb97c8 | Klaus Aehlig | -- | The type of Locks available in Ganeti. The order of this type |
36 | 95eb97c8 | Klaus Aehlig | -- is the lock oder. |
37 | 95eb97c8 | Klaus Aehlig | data GanetiLocks = BGL deriving (Ord, Eq, Show) |
38 | 95eb97c8 | Klaus Aehlig | -- TODO: add the remaining locks |
39 | 95eb97c8 | Klaus Aehlig | |
40 | 75033afd | Klaus Aehlig | instance Lock GanetiLocks where |
41 | 75033afd | Klaus Aehlig | lockImplications BGL = [] |
42 | 75033afd | Klaus Aehlig | |
43 | 95eb97c8 | Klaus Aehlig | -- | The type of lock Allocations in Ganeti. In Ganeti, the owner of |
44 | 95eb97c8 | Klaus Aehlig | -- locks are jobs. |
45 | 95eb97c8 | Klaus Aehlig | type GanetiLockAllocation = LockAllocation GanetiLocks JobId |