From 6c720ae04b2888bcfa178725b9efa38d71a6e382 Mon Sep 17 00:00:00 2001 From: Tale152 Date: Mon, 17 Oct 2022 23:59:32 +0200 Subject: [PATCH] written 6.3.3 --- .vscode/ltex.dictionary.en-US.txt | 1 + .../chapter_6/sections/3_mapreduce_service.tex | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.vscode/ltex.dictionary.en-US.txt b/.vscode/ltex.dictionary.en-US.txt index 794f45f..33dccfb 100644 --- a/.vscode/ltex.dictionary.en-US.txt +++ b/.vscode/ltex.dictionary.en-US.txt @@ -2,3 +2,4 @@ PDAs MapReduce subsequential Athmosferical +IRs diff --git a/document/chapters/chapter_6/sections/3_mapreduce_service.tex b/document/chapters/chapter_6/sections/3_mapreduce_service.tex index 77b36fb..3da08ef 100644 --- a/document/chapters/chapter_6/sections/3_mapreduce_service.tex +++ b/document/chapters/chapter_6/sections/3_mapreduce_service.tex @@ -82,8 +82,7 @@ \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} @@ -91,6 +90,13 @@ \subsection{MapReduce Master} \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} @@ -98,6 +104,8 @@ \subsection{MapReduce Master} \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} @@ -105,6 +113,10 @@ \subsection{MapReduce Master} \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} @@ -112,6 +124,8 @@ \subsection{MapReduce Master} \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}