| Copyright | © StrIoT maintainers 2021 |
|---|---|
| License | Apache 2.0 |
| Maintainer | StrIoT maintainers |
| Stability | experimental |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Striot.Orchestration
Description
The highest-level StrIoT interfaces, for transforming and partitioning
programs described as StreamGraphs.
Synopsis
- type Plan = (StreamGraph, PartitionMap)
- type Cost = Maybe Int
- distributeProgram :: GenerateOpts -> StreamGraph -> IO ()
- chopAndChange :: GenerateOpts -> StreamGraph -> Plan
- viableRewrites :: GenerateOpts -> StreamGraph -> [(Plan, Cost)]
- deriveRewritesAndPartitionings :: [RewriteRule] -> StreamGraph -> [Plan]
- allPartitionsPaired :: StreamGraph -> [Plan]
- planCost :: GenerateOpts -> Plan -> Cost
- simpleStream :: [(StreamOperator, [ExpQ], String, Double)] -> Graph StreamVertex
- partitionGraph :: StreamGraph -> PartitionMap -> GenerateOpts -> IO ()
- data GenerateOpts = GenerateOpts {
- imports :: [String]
- packages :: [String]
- preSource :: Maybe String
- rules :: [RewriteRule]
- maxNodeUtil :: Double
- bandwidthLimit :: Double
- defaultOpts :: GenerateOpts
Documentation
type Plan = (StreamGraph, PartitionMap) Source #
A Plan is a pairing of a StreamGraph with a PartitionMap that could
be used for its partitioning and deployment.
distributeProgram :: GenerateOpts -> StreamGraph -> IO () Source #
Apply rewrite rules to the supplied StreamGraph to possibly rewrite
it; partition it when a generated PartitionMap; generate and write out
Haskell source code files for each Partition, ready for deployment.
chopAndChange :: GenerateOpts -> StreamGraph -> Plan Source #
apply viableRewrites to the supplied StreamGraph.
Return the lowest-cost Plan.
If there are no pairings, throw an error.
TODO: rename this. It's a bad name! optimiseChoosePartitionMap?
viableRewrites :: GenerateOpts -> StreamGraph -> [(Plan, Cost)] Source #
Given a stream processing program encoded in a StreamGraph:
deriveRewritesAndPartitionings :: [RewriteRule] -> StreamGraph -> [Plan] Source #
given a StreamGraph, derives further graphs by applying rewrite
rules and pairs them with all their potential partitionings
allPartitionsPaired :: StreamGraph -> [Plan] Source #
given a StreamGraph, generate all partitionings of it and pair
them individually with the StreamGraph.
CompileIoT functions
Functions re-exported from CompileIoT.
simpleStream :: [(StreamOperator, [ExpQ], String, Double)] -> Graph StreamVertex Source #
Convenience function for specifying a simple path-style of stream
processing program, with no merge or join operations. The list of tuples are
converted into a series of connected Stream Vertices in a Graph. The tuple
arguments are the relevant StreamOperator for the node; the parameters;the
*output* type and the service time. The other parameters to StreamVertex
are inferred from the neighbouring tuples. Unique and ascending vertexId
values are assigned.
partitionGraph :: StreamGraph -> PartitionMap -> GenerateOpts -> IO () Source #
Partitions the supplied StreamGraph according to the supplied PartitionMap;
invokes generateCode for each derived sub-graph; writes out the resulting
source code to individual source code files, one per node.
- TODO*: move GenerateOpts to first parameter?
data GenerateOpts Source #
Options for source code generation are captured in instances of the
GenerateOpts data-type.
Constructors
| GenerateOpts | |
Fields
| |
defaultOpts :: GenerateOpts Source #
Sensible default values for GenerateOpts. Users who wish to customise
options in GenerateOpts are encouraged to derive from defaultOpts.