X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/00b157522469058680f231f51880e720ee48d12c..e4c5beaf3ee5cf16fd40573e3afe9a708b58bb4f:/Ganeti/HTools/Node.hs diff --git a/Ganeti/HTools/Node.hs b/Ganeti/HTools/Node.hs index 8dffd58..c5856fb 100644 --- a/Ganeti/HTools/Node.hs +++ b/Ganeti/HTools/Node.hs @@ -26,6 +26,9 @@ module Ganeti.HTools.Node , setSec -- * Formatting , list + -- * Misc stuff + , AssocList + , noSecondary ) where import Data.List @@ -35,8 +38,6 @@ import qualified Ganeti.HTools.Container as Container import qualified Ganeti.HTools.Instance as Instance import qualified Ganeti.HTools.PeerMap as PeerMap -import Ganeti.HTools.Utils - data Node = Node { t_mem :: Double -- ^ total memory (MiB) , n_mem :: Int -- ^ node memory (MiB) , f_mem :: Int -- ^ free memory (MiB) @@ -58,6 +59,13 @@ data Node = Node { t_mem :: Double -- ^ total memory (MiB) -- score computations } deriving (Show) +-- | A simple name for the int, node association list +type AssocList = [(Int, Node)] + +-- | Constant node index for a non-moveable instance +noSecondary :: Int +noSecondary = -1 + {- | Create a new node. The index and the peers maps are empty, and will be need to be update