\begin{algorithm}[htp!] %htp! 禁止浮动
\caption{CPU load detection.}
\label{al:cld}
\begin{algorithmic}[1]
\Require
$L{r_{n,[{t_s},{t_e}]}}$, $v_{i,k}$, ${L_{{v_{i,k}}}}$, $r(n_i)$, $B_n$;
\Ensure
$minv_{i,k} \rightarrow tn$;
\State Declare migration target nodes $tn$
\State $minv_{i,k}$ denotes the minimum communication load with other vertex instances on node $n_i$
\For{ $l_i$ being the CPU load ratio for nodes in set $Gn$ }
\State Determine whether the CPU of each node is overloaded or not
\If{${l_i} > {B_n}$}
\State Fetch the $minv_{i,k}$ downstream nodes $D(v_{i,k})$ and upstream nodes $U(v_{i,k})$ and assign them to $M(n)$
\For{$n_i \in M(n)$}
\If{$DL{r_{{n_i}}} + {L_{\min {v_{i,j}}}} > {B_{{n_i}}}$}
\State $Remove(M(n_i)) $
\EndIf
\EndFor
\If{$M(n_i)$ is empty}
\State $tn=max(r(n_i),n_i \in Dn(n_i))$
\EndIf
\State $tn=max(r(n_i),n_i \in M(n_i))$
\EndIf
\EndFor \\
\Return $minv_{i,j} \rightarrow tn$
\end{algorithmic}
\end{algorithm}
\begin{algorithm}[h]
\SetAlgoLined
\caption{Data Buffer Pool When Runtime}
\KwData{Signal from Snapshot $S$, Tuple Upstream $T_u$, Control Tuple $T_c$}
\uIf{$S$ hasn't received and $T_c$ hasn't received}{
\tcp{meaning $T_u$ has received}
Store $T_u$\;
output $T_u$\;
}
\uElseIf{$S$ hasn't received and $T_c$ has received}{
Mark the set of $T_u$ before $T_c$\;
Output $T_c$\;
}
\Else{
\tcp{meaning $S$ and $T_u$ has received}
Deleted the marked tuple\;
Output $T_u$\;
}
\end{algorithm}