Maintainer | Ziyang Liu <free@cofree.io> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Hadoop streaming makes it possible to write Hadoop jobs in Haskell. See the official documentation for how Hadoop streaming works. See HadoopStreaming.Text for a word count example.
Synopsis
- data Mapper i o e m = Mapper (i -> Either e j) (k -> v -> o) (ConduitT j (k, v) m ())
- data Reducer i o e m = Eq k => Reducer (i -> Either e (k, v)) (r -> o) (k -> v -> ConduitT v r m ())
- runMapper :: MonadIO m => ConduitT () i m () -> ConduitT o Void m () -> (i -> e -> m ()) -> Mapper i o e m -> m ()
- runReducer :: MonadIO m => ConduitT () i m () -> ConduitT o Void m () -> (i -> e -> m ()) -> Reducer i o e m -> m ()
- println :: MonadIO m => Text -> m ()
- incCounter :: MonadIO m => Text -> Text -> m ()
- incCounterBy :: MonadIO m => Int -> Text -> Text -> m ()
Documentation
A Mapper
consists of a decoder, an encoder, and a stream transforming
input into (key, value)
pairs.
A Reducer
consists of a decoder, an encoder, and a stream transforming
each key and all values associated with the key into some result values.
Eq k => Reducer | |
|
:: MonadIO m | |
=> ConduitT () i m () | Mapper source. The source should generally stream from An example is |
-> ConduitT o Void m () | Mapper sink. It should generally stream to |
-> (i -> e -> m ()) | An action to be executed for each input that cannot be decoded. The first parameter
is the input and the second parameter is the decoding error. One may choose to, for instance,
increment a counter and |
-> Mapper i o e m | |
-> m () |
Run a Mapper
.
:: MonadIO m | |
=> ConduitT () i m () | Reducer source |
-> ConduitT o Void m () | Reducer sink |
-> (i -> e -> m ()) | An action to be executed for each input that cannot be decoded. |
-> Reducer i o e m | |
-> m () |
Run a Reducer
.