Skip to content

Commit

Permalink
written 6.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tale152 committed Oct 17, 2022
1 parent 181be91 commit 6c720ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions .vscode/ltex.dictionary.en-US.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ PDAs
MapReduce
subsequential
Athmosferical
IRs
18 changes: 16 additions & 2 deletions document/chapters/chapter_6/sections/3_mapreduce_service.tex
Original file line number Diff line number Diff line change
Expand Up @@ -82,36 +82,50 @@ \subsection{Reduce Worker}
\end{figure}

\subsection{MapReduce Master}
TODO

The Petri Net describing the process performed by the MapReduce Master focuses only on a single region, meaning that this operation needs to be performed (concurrently) for every data region.
\begin{figure}[!ht]
\centering
\includegraphics[width=\linewidth]{document/chapters/chapter_6/images/master_petri_net_1.png}
\caption{MapReduce Master - Recruitment}
\label{fig:master_petri_net_1}
\end{figure}

For this particular example, the region is constituted by 4 splits and the Customer required a quantity of Resources that resulted in the Contribution of 5 Map Workers; a region is handled by a single Reduce Worker, so there is only one token representing it.

Initially, the Map and Reduce Workers are required but not connected (Requested MWs and Requested RW places); they can transition to a connected state but, if something goes wrong, they can also disconnect. \textit{Figure \ref{fig:master_petri_net_1}} shows a situation where 3 Map Workers and the Reduce Worker have joined. Workers can continue to join and leave until the MapReduce computation for the region is completed, removing the execution token.

Having at least one MW available, the mapping process can begin (\textit{figure \ref{fig:master_petri_net_2}}). A split belonging to the region is assigned to an available MW which will perform the Map operation on it (it is assumed that the Worker possesses the map function, abstracted for simplicity). If the mapping happens successfully, the region's IRs are accumulated; in case that a Map Worker is lost during the map execution, the split needs to be computed by another worker and is placed back in the regions splits place (and the another token in the requested MWs is also placed).
It can also happen that a region IR is lost due to the disconnection of the Map Worker that is still keeping the result in memory; this occurrence also adds again said split in the region splits that still needs to be mapped (since its IR is unreachable).

\begin{figure}[!ht]
\centering
\includegraphics[width=\linewidth]{document/chapters/chapter_6/images/master_petri_net_2.png}
\caption{MapReduce Master - Mapping process}
\label{fig:master_petri_net_2}
\end{figure}

Once all the region's split are mapped to intermediate results (\textit{figure \ref{fig:master_petri_net_3}}), the reduce process can start (assuming that a RW is connected).

\begin{figure}[!ht]
\centering
\includegraphics[width=\linewidth]{document/chapters/chapter_6/images/master_petri_net_3.png}
\caption{MapReduce Master - Region Mapping completed}
\label{fig:master_petri_net_3}
\end{figure}

While the reduce function is being applied, the region token is removed due to the fact that no more splits for this region needs to be mapped (\textit{figure \ref{fig:master_petri_net_4}}). A failure can also happen here, since the Reduce Worker can disconnect during the reduce function execution; in this case, the region token is restored and a new Reduce Worker is required.

\vspace{5mm}

\begin{figure}[!ht]
\centering
\includegraphics[width=\linewidth]{document/chapters/chapter_6/images/master_petri_net_4.png}
\caption{MapReduce Master - Reducing process}
\label{fig:master_petri_net_4}
\end{figure}

If the reduce function is completed successfully (as shown in \textit{figure \ref{fig:master_petri_net_5}}), the result for the considered region is obtained. As stated before, the overall MapReduce execution will end once every region is computed, providing to the Customer all the regional results.

\begin{figure}[!ht]
\centering
\includegraphics[width=\linewidth]{document/chapters/chapter_6/images/master_petri_net_5.png}
Expand Down

0 comments on commit 6c720ae

Please sign in to comment.