Commit af3803e4 authored by Omran Saleh's avatar Omran Saleh
Browse files

minor changes

parent 854eabea
To provide a higher abstraction level, we have developed a Web application called \textbf{AutoStudio}. It is a user friendly and easy to use browser-based application to run cross-platform using HTML5, Draw2D touch\footnote{\url{http://www.draw2d.org/draw2d/index.html}}, and node.js\footnote{\url{http://www.nodejs.org}}. AutoStudio has several functionalities:
\begin{itemize}
\item It enables users to leverage the emerging \PipeFlow language graphically via a collection of operators (represented by icons) which could be simply ``dragged and dropped'' onto a drawing canvas. The user can assemble the operators in order to create a dataflow graph in a logical way and visually show how they are related, and from this graph, equivalent \PipeFlow script can be generated. By clicking on the operator icon, a pop-up window appears to let the user specify the parameters of \PipeFlow operators, which are required. Moreover, the user can display the help contents for each operator.
\item Contacting the \PipeFlow system to generate the right script (e.g., Storm, Spark Streaming, or PipeFabric scripts) based upon the user's selection of language from the dashboard page. This makes the user to be not aware of any of stream-processing languages syntax including \PipeFlow and their constructs. By this application, the user can trigger the execution of the script through the \PipeFlow system via calling the respective engine. Moreover, it handles real-time stats including execution and performance results sent by \PipeFlow system when the script is in execution. When the execution is complete, the application can send an email to the user.
\item Contacting the \PipeFlow system to generate the right script (e.g., Storm, Spark Streaming, or PipeFabric scripts) based upon the user's selection of language from the dashboard page. This makes the user to be not aware of any of stream-processing language syntax and their constructs including \PipeFlow. By this application, the user can trigger the execution of the script through the \PipeFlow system via calling the respective engine. Moreover, it handles real-time stats including execution and performance results sent by the \PipeFlow system when the script is in execution. When the execution is complete, the application can send an email to the user.
\item It provides the options of saving the generated scripts or flow-designs for future reference, loading the saved script and executing it whenever required.
\item An evaluation tool for the generated scripts where the user is interested in comparing as well as evaluating the performance of stream- processing systems in terms of throughput, latency, and resource consumption such as CPU and memory. The evaluation can be performed online using dynamic figures or offline using static figures.
\end{itemize}
......
In this section we provide a description of our \PipeFlow language and the system architecture as well as providing an example of mapping between a \PipeFlow script to PipeFabric and Storm scripts.
In this section, we provide a description of our \PipeFlow language and the system architecture in addition to providing an example of mapping between a \PipeFlow script to PipeFabric and Storm scripts.
\subsection{\PipeFlow Language}
\PipeFlow language is a dataflow language inspired by Hadoop's Pig Latin \cite{Olston2008}. In general, a \PipeFlow script describes a directed acyclic graph of dataflow operators, which are connected by named pipes. A single statement is given by:
\begin{alltt}
......@@ -61,16 +61,16 @@ where \texttt{limit} parameter limits the number of results returned.
\caption{\PipeFlow architecture}
\label{fig:arch}
\end{figure}
In our approach, we have adopted the automated code translation (ACT) technique by taking an input source script written in \PipeFlow language and converting it into an output source script in another language. In general, \PipeFlow system is written in Java and depends heavily on ANTLR\footnote{\url{http://www.antlr.org}} and StringTemplate\footnote{\url{http://www.stringtemplate.org}} libraries. The former libraries generates a \PipeFlow language parser that can build and walk parse trees whereas the latter generates code using pre-defined templates. Basically, the following components are used to achieve the translation of \PipeFlow source script to equivalent target scripts (PipeFabric, Spark Streaming, or Storm): \emph{(1)} parser \emph{(2)} flow graph \emph{(3)} template file and \emph{(4)} code generator. The latter two components are specific to target scripts and differ from each other depending on the target code to be generated. And thus for every target language we need to create a separate template file and code generator to generate its code.
In our approach, we have adopted the automated code translation (ACT) technique by taking an input source script written in \PipeFlow language and converting it into an output source script in another language. In general, \PipeFlow system is written in Java and depends heavily on ANTLR\footnote{\url{http://www.antlr.org}} and StringTemplate\footnote{\url{http://www.stringtemplate.org}} libraries. The former generates a \PipeFlow language parser that can build and walk parse trees whereas the latter generates code using pre-defined templates. Basically, the following components are used to achieve the translation of \PipeFlow source script to equivalent target scripts (PipeFabric, Spark Streaming, or Storm): \emph{(1)} parser \emph{(2)} flow graph \emph{(3)} template file and \emph{(4)} code generator. The latter two components are specific to target scripts and differ from each other depending on the target code to be generated. Therefore, for every target language a separate template file and code generator are created.
\textbf{Role of Components}: The roles and functionalities of each above-mentioned components are described below and shown in Fig. \ref{fig:arch}.
\begin{description}
\item[Parser:] This component simply does the lexical analysis by parsing the input program written in \PipeFlow and identifying the dataflow graph instances from the program. Initially, ANTLR generates a parser for the \PipeFlow language automatically based on the \PipeFlow grammar. This parser creates a parse tree which is the data structures representing how the grammar matches the \PipeFlow script. Additionally, ANTLR automatically generates a tree walker interface which can be used to visit the nodes of the parse tree. A new listener interface, which implements the parent interface, is used to visit the nodes in order to construct the corresponding flow node instances during the tree traversal. From flow node instances, the flow graph object can be created.
\item[Parser:] This component simply does the lexical analysis by parsing the input program written in \PipeFlow language and identifying the dataflow graph instances from the program. Initially, ANTLR generates a parser for the \PipeFlow language automatically based on the \PipeFlow grammar. This parser creates a parse tree which is the data structures representing how the grammar matches the \PipeFlow script. Additionally, ANTLR automatically generates a tree walker interface which can be used to visit the nodes of the parse tree. A new listener interface, which implements the parent interface, is used to visit the nodes in order to construct the corresponding flow node instances during the tree traversal. From these flow node instances, the flow graph object can be created.
\item[Flow graph: ] A logical representation of the input program which comprises nodes (flow nodes) and edges (pipes). A flow node instance represents an operator in the data-flow program. It is the intermediate mean between the parser and the code generator to build up a graph of nodes and generate the target code, respectively. Pipe instance represents the edge between two nodes of the dataflow graph. Therefore, each pipe contains the input node (the node producing tuples which are sent via the pipe) and the output node (the node consuming these tuples from the pipe). This component is mainly used to generate the target code in a specific language. And Irrespective of target language program to be generated this component remains same.
\item[Code generator:] Once the flow graph is generated from the input \PipeFlow source program, the code generator generates the target code based on this graph. The code generator takes the flow graph generated by the parser and a template file, processes all nodes and pipes iteratively, and creates the equivalent code using the StringTemplate library. There are separate code generators for each specific target language depending on the target code to be generated.
\item[Template file:] It is also defined as a string template group file (stg). We can imagine this file as string with holes which has to be filled by the code generator. Inside this file, the rules with its arguments should be defined to specify how to format the operators code and which part in it has to render. Therefore, some parts will be rendered as it is whereas other parts contain place-holders will be replaced with the provided arguments. Template file is different for each specific target code to be generated as the format and syntax of each target language to be generated is different. The template file contains the library files to be included, packages to be imported, or the code blocks for operators, etc.
\item[Template file:] It is also defined as a string template group file (stg). We can imagine this file as string with holes which has to be filled by the code generator. Inside this file, the rules with their arguments should be defined to specify how to format the operators code and which part in it has to render. Therefore, some parts will be rendered as it is whereas other parts contain place-holders where they will be replaced with the provided arguments. Template file is different for each specific target code to be generated as the format and syntax of each target language to be generated is different. The template file contains the library files to be included, packages to be imported, or the code blocks for operators, etc.
\end{description}
\subsection{An Example of Translation}
Consider below a simple\footnote{Because of the limitation in the number of pages.} sample script written in \PipeFlow that needs to be translated to PipeFabric and Storm by our system. This script reads a stream that contains \texttt{x} and \texttt{y} fields. Later, the \texttt{x} field is filtered and aggregated to find the sum of all \texttt{y} fields for a particular \texttt{x}. Note that the \PipeFlow construct is simpler than other engine constructs.
......
Supports Markdown
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