Commit 038538c3 authored by Niklas Hambuechen's avatar Niklas Hambuechen Committed by Petr Pudlak

Scheduler: Move types into own module

So that we can access them from modules that will be imported into JQScheduler
(such as job queue filters).
Signed-off-by: default avatarNiklas Hambuechen <niklash@google.com>
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 73abebda
......@@ -135,6 +135,7 @@ HS_DIRS = \
src/Ganeti/HTools/Program \
src/Ganeti/Hypervisor \
src/Ganeti/Hypervisor/Xen \
src/Ganeti/JQScheduler \
src/Ganeti/JQueue \
src/Ganeti/Locking \
src/Ganeti/Logging \
......@@ -822,6 +823,7 @@ HS_LIB_SRCS = \
src/Ganeti/Hs2Py/GenOpCodes.hs \
src/Ganeti/Hs2Py/OpDoc.hs \
src/Ganeti/JQScheduler.hs \
src/Ganeti/JQScheduler/Types.hs \
src/Ganeti/JQueue.hs \
src/Ganeti/JQueue/Lens.hs \
src/Ganeti/JQueue/Objects.hs \
......
{-# LANGUAGE TemplateHaskell, RankNTypes #-}
{-# LANGUAGE RankNTypes #-}
{-| Implementation of a reader for the job queue.
-}
......@@ -53,6 +53,7 @@ import System.INotify
import Ganeti.BasicTypes
import Ganeti.Constants as C
import Ganeti.Errors
import Ganeti.JQScheduler.Types
import Ganeti.JQueue as JQ
import Ganeti.Lens hiding (chosen)
import Ganeti.Logging
......@@ -63,21 +64,6 @@ import Ganeti.Utils
import Ganeti.Utils.Livelock
import Ganeti.Utils.MVarLock
data JobWithStat = JobWithStat { jINotify :: Maybe INotify
, jStat :: FStat
, jJob :: QueuedJob
}
$(makeCustomLenses' ''JobWithStat ['jJob])
data Queue = Queue { qEnqueued :: [JobWithStat]
, qRunning :: [JobWithStat]
, qManipulated :: [JobWithStat] -- ^ running jobs that are
-- being manipulated by
-- some thread
}
$(makeCustomLenses ''Queue)
{-| Representation of the job queue
......
{-# LANGUAGE TemplateHaskell #-}
{-| Types for the JQScheduler.
-}
{-
Copyright (C) 2013 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
-}
module Ganeti.JQScheduler.Types where
import System.INotify
import Ganeti.JQueue as JQ
import Ganeti.Lens hiding (chosen)
import Ganeti.Utils
data JobWithStat = JobWithStat { jINotify :: Maybe INotify
, jStat :: FStat
, jJob :: QueuedJob
}
$(makeCustomLenses' ''JobWithStat ['jJob])
data Queue = Queue { qEnqueued :: [JobWithStat]
, qRunning :: [JobWithStat]
, qManipulated :: [JobWithStat] -- ^ running jobs that are
-- being manipulated by
-- some thread
}
$(makeCustomLenses ''Queue)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment