ganeti
Safe HaskellNone

Ganeti.HTools.Container

Description

Module abstracting the node and instance container implementation.

This is currently implemented on top of an IntMap, which seems to give the best performance for our workload.

Synopsis

Documentation

type Key = Key Source #

Our key type.

type Container = IntMap Source #

Our container type.

find :: Key -> Container a -> a Source #

Locate a key in the map (must exist).

add :: Key -> a -> Container a -> Container a Source #

Add or update one element to the map.

addTwo :: Key -> a -> Key -> a -> Container a -> Container a Source #

Add or update two elements of the map.

nameOf :: Element a => Container a -> Key -> String Source #

Compute the name of an element in a container.

findByName :: (Element a, MonadFail m) => Container a -> String -> m a Source #

Find an element by name in a Container; this is a very slow function.