module Holumbus.MapReduce.MapReduce
(
MapReduceType(..)
, MapReduce(..)
)
where
import Holumbus.Common.Debug
import Holumbus.FileSystem.FileSystem
import Holumbus.MapReduce.Types
import Holumbus.Network.Site
data MapReduceType = MRTMaster | MRTWorker | MRTClient | MRTStandalone
deriving (Show, Eq, Ord, Enum)
class (Debug mr) => MapReduce mr where
closeMapReduce :: mr -> IO ()
getMySiteId :: mr -> IO SiteId
getMapReduceType :: mr -> IO MapReduceType
startControlling :: mr -> IO ()
stopControlling :: mr -> IO ()
isControlling :: mr -> IO Bool
doSingleStep :: mr -> IO ()
doMapReduceJob :: JobInfo -> mr -> IO JobResult
doMapReduce
:: ActionConfiguration a k1 v1 k2 v2 v3 v4
-> a
-> [(k1,v1)]
-> [FileId]
-> Int
-> Int
-> Int
-> Int
-> TaskOutputType
-> mr -> IO ([(k2,v4)],[FileId])
doMapReduce c o ls1 ls2 sc mc rc nor rt mr
= do
let ji = createJobInfoFromConfiguration c o ls1 ls2 sc mc rc nor rt
jr <- doMapReduceJob ji mr
let res = createListsFromJobResult c jr
return res