text:
\section{Introduction and Model}
\noindent\textbf{Motivation:}
Distributed (computing) systems aim to attain scalability through parallel execution of multiple tasks constituting a job. Each task is run on a separate node, and the job is completed only when the slowest task is finished. It has been observed that task execution times have significant variability, e.g., because of multiple job resource sharing, power management \cite{dean2013tail}. The slowest tasks that determine the job execution time are known as "stragglers''.

Two common performance metrics for distributed job execution are 1) \emph{Latency,} measuring the execution time, and 2) \emph{Cost,} measuring the resource usage. Job execution is desired to be fast and with low cost, but these are conflicting objectives. Replicating tasks and running the replicas over separate nodes has been shown to be effective in mitigating the effect of stragglers on latency \cite{ananthanarayanan2013effective}, and is used in practice \cite{dean2008mapreduce}. Recent research proposes to delay replication in order to reduce the cost \cite{wang2015using}, and clone only the tasks that at some point appear to be straggling.

Erasure coding is a more general form of redundancy than simple replication, and it has been considered for straggler mitigation in both data download \cite{joshi2015queues} and, more recently, in distributed computing context \cite{dutta2016short, CodedGradientDescent:HalbawiAS17}.
We took this line of work further by analyzing the effect of coding and replication on the tradeoff between cost and latency as in \cite{ourmamapaper}. We examined whether the redundancy should be simple replication or coding, and when it should be introduced. We here extend the cost and latency analysis in \cite{ourmamapaper} for systems that use redundancy together with task relaunch.
\\[1ex]
\noindent\textbf{System Model:}
In our system, a job is split into $k$ tasks. Job execution starts with launching all its $k$ tasks, and the redundancy is introduced only if the job is not completed by some time $\Delta$. Note that we don't consider queueing of jobs or tasks; all tasks start service together.

In replicated-redundancy $(k, c, \Delta)$-system, if the job still runs at time $\Delta$, then $c$ replicas for each remaining task are launched. In coded-redundancy $(k, n, \Delta)$-system, if the job still runs at time $\Delta$, $n-k$ redundant parity tasks are launched where completion of any $k$ of all launched tasks results in total job completion (see Fig.~\ref{fig:fig_delayed_red}). Note that this assumption does not impose severe restrictions. Any linear computing algorithm can be implemented with this $k$-out-of-$n$ structure simply by using linear erasure codes. Particular examples can be found in e.g., \cite{dutta2016short, CodedGradientDescent:HalbawiAS17} and references therein. If system implements task relaunch, then tasks that remain running at time $\Delta$ are canceled, and fresh  copies are launched in their place immediately together with the redundant tasks.
\begin{figure}[t]
  \centering
  \includegraphics[width=0.5\textwidth, keepaspectratio=true]{fig_delayed_red.pdf}
  \caption{A job with four tasks is executed with delayed redundancy. Check marks represents task completion and crosses represents task cancellation. (With replication,  exact clones of the straggler tasks are introduced, while with coding parity tasks can be used as a ``clone'' for any task, therefore, stragglers do not have to be tracked down.)}
  \label{fig:fig_delayed_red}
\end{figure}

\begin{figure*}[t]
  \centering
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{pplot_task_lifetime_hist_k_15.png}
  \end{subfigure}
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{pplot_task_lifetime_hist_k_400.png}
  \end{subfigure}
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{pplot_task_lifetime_hist_k_1050.png}
  \end{subfigure}
  \caption{Empirical tail distribution of task completion times for Google cluster jobs with number of tasks $k=15, 400, 1050$.}
  \label{fig:plot_google_empiricaltail}
\end{figure*}

We assume that task execution times are iid and follow one of the two canonical distributions: 1)
shifted exponential  ${\it SExp}(D, \mu)$ modeling tasks that take some positive minimum time $D$ and have an exponential tail with decaying rate $\mu$ modeling the randomness inherent in the system and 2) $\textit{Pareto}(\lambda, \alpha)$ with positive minimum value $\lambda$ and  a power law tail index $\alpha$. Pareto is a canonical heavy tailed distribution that is observed to fit task execution times in real computing systems \cite{dean2013tail, reiss2012towards}.

Fig.~\ref{fig:plot_google_empiricaltail} plots the empirical tail distribution of task completion times\footnote{Task lifetimes are calculated as the difference between timestamps for SCHEDULE and FINISH events in \cite{reiss2011google}.} for jobs with $15$, $400$, and $1050$ tasks in the Google Trace data \cite{reiss2011google}. Note that the $x$ and $y$ axes are in log scale, and thus an exponential tail would have appeared as a curve decaying exponentially while a true power law tail (e.g., Pareto) would have pronounced a linear decay at a constant rate. Empirical tail distributions in the figure exhibit exponential decay at small values and a trend similar to linear decay at larger values. Note that the steep decay at the far right edge is due to bounded support of the distributions. Even though we cannot conclude that these empirical distributions are distributed as Pareto, they clearly exhibit more variability and have heavier tail than an Exponential.

We define the cost of job execution as the sum of the lifetimes of all tasks (including redundant ones) involved in the job execution. This definition reflects ``pay for resources'' pricing, which is the most commonly used model in cloud services offered by Amazon, Google App Engine, Windows Azure \cite{al2013cloud}. There are two main setups that define cost: 1) Cost with task cancellation $C^c$; remaining outstanding tasks are canceled upon the job completion, which is a viable option for distributed computing with redundancy, 2) Cost without task cancellation $C$; tasks remaining after job completion run until they complete, which for instance is the only option for data transmission over multi-path network with redundancy.

In this paper, we analyze the effect of replicated and coded redundancy on cost and latency tradeoff. Specifically, we present exact expressions for expected latency and cost for redundancy with and without task relaunch. Using these expressions, we show the correlation of pain and gain of redundancy with the tail heaviness of the task execution times.
\\[1ex]
\textbf{Summary of Observations:} Coding allows us to increase degree of redundancy with finer steps than replication, which translates into greater achievable cost vs.\ latency region. Delaying redundancy is not effective in trading off latency for cost. Therefore, primarily the degree of redundancy should be tuned for the desired cost and latency values. Coding is shown to outperform replication in terms of cost and latency together. When the task execution times are heavy tailed, redundancy can reduce cost and latency simultaneously, where the reduction depends on the tail heaviness. For heavy tailed tasks, we show that relaunching tasks, even without any redundancy, is sufficient to return significant reduction in cost and latency.

\vspace{1ex}
\noindent\textbf{Notation:}
$T$ and $C$ denote latency and cost of job execution.
$H_n$ is the $n$th harmonic number defined as $\sum_{i=1}^n \frac{1}{i}$ for $n \in Z^+$ or equivalently as $\int_0^1 \frac{1-x^n}{1-x} dx$ for $n \in R$. $H_{n^2}$ denotes the generalized harmonic number of order $n$ of two defined as $\sum_{i=1}^n \frac{1}{i^2}$. Incomplete Beta function $B(q;m,n)$ is defined for $q \in [0,1]$, $m, n \in R^+$ as $\int_0^q u^{m-1}(1-u)^{n-1} du$, and Beta function as $B(m,n) = B(1;m,n)$. Gamma function $\Gamma(x)$ is defined as $\int_0^{\infty} u^{x-1}e^{-u}du$ for $x \in R$ and as $(x-1)!$ for $x \in Z^+$.

\section{Latency and Cost Analysis}
In a previous work \cite{ourmamapaper}, we concluded that delaying replicated or coded redundancy is not effective to reduce cost. This conclusion is based on the observation that delaying redundancy can bring reduction in cost (gain) only after significant increase (pain) in latency, at which point one can achieve less latency for the same cost by simply reducing the level of redundancy. This section gives cost vs.\ latency analysis of zero-delay redundancy systems, where cost and latency are expressed in terms of level of redundancy $c$ or $n$ and parameters of task execution time distribution.

\begin{figure*}[t]
  \centering
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_zerodelay_reped_vs_coded_SExp_k_10.pdf}
  \end{subfigure}
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_zerodelay_reped_vs_coded_Pareto_k_10_a_1_5.pdf}
  \end{subfigure}
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_zerodelay_reped_vs_coded_Pareto_k_10_a_1_2.pdf}
  \end{subfigure}
  \caption{Expected cost vs.\ latency for zero-delay redundancy where redundancy levels $c$ and $n$ vary along the curves. Tail heaviness increases from left to right. The heavier the tail is, the higher the maximum reduction in expected cost and latency is.}
  \label{fig:plot_zerodelay_reped_vs_coded_k_10}
\end{figure*}

Thm.~\ref{thm_zerodelay_red_E_T__E_C} gives exact expressions for the expected cost and latency under zero-delay redundancy, and Fig.~\ref{fig:plot_zerodelay_reped_vs_coded_k_10} shows comparison between replication and coding for varying level of redundancy. Under both $SExp$ and $Pareto$ task execution times, coding always achieves better expected cost and latency than replication.
\begin{theorem}
  Let expected latency and cost with task cancellation be $T_{(k,c)}$, $C_{(k,c)}$ for zero-delay replicated redundancy, and $T_{(k,n)}$, $C_{(k,n)}$ for zero-delay coded redundancy. Under task execution time $X \sim SExp(\frac{D}{k}, \mu)$, we have
  \begin{equation*}
  \begin{split}
    E[T_{(k,c)}] &= \frac{D}{k} + \frac{H_k}{(c+1)\mu}, \quad\quad E[C_{(k,c)}] = (c+1)D + \frac{k}{\mu}, \\
    E[T_{(k,n)}] &= \frac{D}{k} + \frac{1}{\mu}(H_n-H_{n-k}), \quad E[C_{(k,n)}] = \frac{nD}{k} + \frac{k}{\mu}.
  \end{split}
  \label{eq:eq_zerodelay_reped_SExp_E_T__E_C}
  \end{equation*}

  Under task execution time $X \sim Pareto(\lambda, \alpha)$, we have
  \begin{equation*}
  \begin{split}
    E[T_{(k,c)}] &= \lambda k!\frac{\Gamma(1-((c+1)\alpha)^{-1})}{\Gamma(k+1-((c+1)\alpha)^{-1})}, \\
    E[C_{(k,c)}] &= \lambda k(c+1)\frac{(c+1)\alpha}{(c+1)\alpha-1}, \\
    E[T_{(k,n)}] &= \lambda\frac{n!}{(n-k)!}\frac{\Gamma(n-k+1-\alpha^{-1})}{\Gamma(n+1-\alpha^{-1})}, \\
    E[C_{(k,n)}] &= \lambda\frac{n}{\alpha-1}\Bigl[\alpha - \frac{\Gamma(n)}{\Gamma(n-k)}\frac{\Gamma(n-k+1-\alpha^{-1})}{\Gamma(n+1-\alpha^{-1})}
    \Bigr].
  \end{split}
  \label{eq:eq_zerodelay_reped_Pareto_E_T__E_C}
  \end{equation*}
  \label{thm_zerodelay_red_E_T__E_C}
\end{theorem}
\begin{proof}[Sketch]
  For replicated redundancy, lifetime of each task is $X_{c+1:1} \sim Pareto(\lambda, (c+1)\alpha)$. Then the expected values of latency $(X_{c+1:1})_{k:k}$ and cost $\sum_{i=1}^k (X_{c+1:1})_{k:i}$ follow from first principles of order statistics.
  Same calculations apply for expectation of latency $X_{n:k}$ and cost $\sum_{i=1}^k X_{n:i} + (n-k)X_{n:k}$ of execution with coded redundancy.
\end{proof}

Under exponential tail, adding redundancy reduces latency but increases cost. In \cite{wang2015using}, replicated redundancy is demonstrated to reduce both cost and latency under heavy tailed task execution time. Fig.~\ref{fig:plot_zerodelay_reped_vs_coded_k_10} plots latency and cost reduction for exponential and heavy tailed task execution times using the expressions given in Thm.~\ref{thm_zerodelay_red_E_T__E_C}. It illustrates the intuitive conclusion that redundancy can yield greater reduction in cost and latency under heavier tailed task execution times.

It is worth to discuss how and why cost reduction matters. Cost, as is defined here, reflects the amount of resource time used to execute a job. Reduction in cost then means running the same job by occupying less area in the space of overall system capacity, which then allows fitting more jobs per area, and hence higher system throughput. To illustrate with a simple example, consider a First-Come First-Served queue with single server under heavy traffic, that is, server never goes idle since there always exists a job to be served. Then, average throughput is the reciprocal of average job service time. In this case, cost of serving a job is simply its service time and system throughput increases with reduced average cost. In the case of systems with many servers that serve jobs with multiple tasks, same principles apply and cost reduction opens up space to execute more jobs per time unit.

Although exact expressions are formidable to derive, second moments of latency and cost can be computed as described in Thm.~\ref{thm_zerodelay_red_E_T_2__E_C_2}. Second moments enable us to compute the standard deviation of latency and cost. Fig.~\ref{fig:plot_zerodelay_reped_vs_coded_wstdev_k_15} plots expected cost and latency with error bars of width equal to the standard deviation in respective dimensions. Standard deviation, hence the variability of cost and latency decreases with increasing level of redundancy as expected. Reduction in variability for the same level of redundancy is greater with coding compared to using replication.

\begin{theorem}
  For $X \sim Exp(\mu)$ and $j \geq i$
  \begin{equation*}
    E[X_{n:i}X_{n:j}] = \frac{1}{\mu^2}[H_{n^2} - H_{(n-i)^2} + (H_n - H_{n-i})(H_n - H_{n-j})].
  \label{eq:eq_Exp_orderstat_joint_moment}
  \end{equation*}
  Then, under task execution time $X \sim SExp(D/k, \mu)$, second moments of latency and cost for zero-delay replicated and coded redundancy systems can be computed as
  \begin{equation*}
  \begin{split}
	E[T_{(k,c)}^2] &= \left(\frac{D}{k} + \frac{H_k}{(c+1)\mu}\right)^2 + \frac{H_{k^2}}{(c+1)^2\mu^2}, \\
    E[C_{(k,c)}^2] &= ((c+1)D)^2 + 2D(c+1)\frac{k}{\mu} \\
    &\quad + (c+1)^2 \sum_{i,j=1}^k E[Y_{n:i}Y_{n:j}] \\
    E[T_{(k,n)}^2] &= \frac{H_{n^2} - H_{(n-k)^2}}{\mu^2} + \left(\frac{D}{k} + \frac{H_n - H_{n-k}}{\mu}\right)^2, \\
    E[C_{(k,n)}^2] &= \left(n\frac{D}{k}\right)^2 + 2n\frac{D}{\mu} + (n-k)^2 E[X_{n:k}^2] \\
    &\quad + 2(n-k)\sum_{i=1}^k E[X_{n:i}X_{n:k}] + \sum_{i,j=1}^k E[X_{n:i}X_{n:j}].
  \end{split}
  \label{eq:eq_zerodelay_reped_red_E_T_2__E_C_2}
  \end{equation*}
  where $Y \sim Exp((c+1)\mu)$.

  \vspace{2ex}
  For $X \sim Pareto(\lambda, \alpha)$, given $\alpha > \max\{2(n-i+1)^{-1}, (n-j+1)^{-1}\}$ and $j \geq i$
  \begin{equation*}
  \begin{split}
    E[X_{n:i}X_{n:j}] = &\lambda^2\frac{n!}{\Gamma(n+1-2/\alpha)} \\
    &\times \frac{\Gamma(n-i+1-2/\alpha)}{\Gamma(n-i+1-1/\alpha)} \frac{\Gamma(n-j+1-2/\alpha)}{\Gamma(n-j+1)}.
  \end{split}
  \label{eq:eq_Pareto_orderstat_joint_moment}
  \end{equation*}
  Then, under task execution time $X \sim Pareto(\lambda, \alpha)$, second moments of latency and cost for zero-delay replicated and coded redundancy systems can be computed as
  \begin{equation*}
  \begin{split}
	E[T_{(k,c)}^2] &= E[Y_{k:k}^2], \\
    E[C_{(k,c)}^2] &= (c+1)^2 \sum_{i,j=1}^k E[Y_{k:i}Y_{k:j}], \\
    E[T_{(k,n)}^2] &= E[X_{n:k}^2] \\
    E[C_{(k,n)}^2] &= (n-k)^2 E[X_{n:k}^2] + 2(n-k)\sum_{i=1}^k E[X_{n:i}X_{n:k}] \\
    &\quad + \sum_{i,j=1}^k E[X_{n:i}X_{n:j}].
  \end{split}
  \label{eq:eq_zerodelay_red_Pareto_E_T_2__E_C_2}
  \end{equation*}
  where $Y \sim Pareto(\lambda, (c+1)\alpha)$.
  \label{thm_zerodelay_red_E_T_2__E_C_2}
\end{theorem}
\begin{proof}[Sketch]
  Derivations follow from latency and cost expressions given in the proof of Thm.~\ref{thm_zerodelay_red_E_T__E_C}. Expressions of $E[X_{n:i}X_{n:j}]$ can be found for $X \sim {\it Exp}$ in Pg. 73 of \cite{OrderStat:Arnold08}, and for $X \sim {\it Pareto}$ in Pg. 62 of \cite{Pareto:Arnold15}.
\end{proof}

Under heavy tail, it is possible to reduce latency by adding redundancy and still pay for the baseline cost of running with no redundancy. Corollary \ref{cor_zerodelay_red_pareto_reduc_in_E_T_for_baseline_E_C} gives expressions for the minimum achievable expected latency $E[T_{\min}]$ without exceeding the baseline cost of running with no redundancy.

\begin{figure}[t]
  \centering
  \includegraphics[width=0.36\textwidth, keepaspectratio=true]{plot_zerodelay_reped_vs_coded_Pareto_k_15_a_2_5.pdf}
  \caption{Expected cost vs.\ latency for zero-delay redundancy systems. Widths of horizontal error bars are equal to standard deviation of latency and widths of vertical bars are equal to standard deviation of cost.}
  \label{fig:plot_zerodelay_reped_vs_coded_wstdev_k_15}
\end{figure}

\begin{corollary}
  Under task execution time $X \sim \textit{Pareto}(\lambda, \alpha)$ in zero-delay replicated redundancy system, minimum latency $E[T_{\min}]$ that can be achieved without exceeding the baseline cost is,
  \begin{equation}
    E[T_{\min}] = \lambda k!\frac{\Gamma(1-(\alpha(c_{\max}+1))^{-1})}{\Gamma(k+1-(\alpha(c_{\max}+1))^{-1})}.
  \label{eq:eq_zerodelay_reped_pareto_reduc_in_E_T_for_base_E_C}
  \end{equation}
  where $c_{\max} = \max\{\floor*{\frac{1}{\alpha-1}}-1, 0\}$ and any reduction in latency without exceeding the baseline cost is possible only if $\alpha < 1.5$.
  For coded redundancy system,
  \begin{equation}
  \begin{split}
    E[T_{\min}] = E[T(n_{\max})].
  \end{split}
  \label{eq:eq_zerodelay_coded_pareto_reduc_in_E_T_for_base_E_C}
  \end{equation}
  where
  \begin{equation}
  \begin{split}
    n_{\max} &= \max\{n | E[T(n_{\max})] - \frac{E[T(k)]}{(n_{\max}-k)} - \alpha \leq 0 \}, \\
    E[T(n)] &= \lambda\frac{n!}{(n-k)!}\frac{\Gamma(n-k+1-\alpha^{-1})}{\Gamma(n+1-\alpha^{-1})}.
  \end{split}
  \end{equation}
  or an upper bound on $E[T_{\min}]$ is
  \begin{equation}
    E[T_{\min}] < \lambda\alpha + \lambda k!\frac{\Gamma(1-\alpha^{-1})}{\Gamma(k+1-\alpha^{-1})}.
  \label{eq:eq_zerodelay_coded_pareto_reduc_in_E_T_for_base_E_C__ineq}
  \end{equation}
\label{cor_zerodelay_red_pareto_reduc_in_E_T_for_baseline_E_C}
\end{corollary}
\begin{proof}

  First consider replicated redundancy $(k,c)$-system. Latency is a decreasing function of $c$, while cost may decrease up to $c_{\max}$ beyond which it increases with $c$. We would like to find $c_{\max}$ such that $E[C_{c=c_{\max}}] < E[C_{c=0}] < E[C_{c=c_{\max}+1}]$, then $E[T_{\min}]$ is simply $E[T_{c=c_{\max}}]$. We next obtain the range of $c$ for which $E[C_c] < E[C_{c=0}]$.
  \begin{equation*}
  \begin{split}
    E[C_c] < E[C_{c=0}] = \lambda k(\frac{(c+1)^2\alpha}{(c+1)\alpha-1} - \frac{\alpha}{\alpha-1}) < 0.
  \end{split}
  \end{equation*}
  which holds only when $c < \frac{1}{\alpha-1}-1$, and since $c$ is a non-negative integer, $c_{\max} = \max\{\floor*{\frac{1}{\alpha-1}}-1, 0\}$, from which  \eqref{eq:eq_zerodelay_reped_pareto_reduc_in_E_T_for_base_E_C} follows.

  Next consider a coded redundancy $(k,n)$-system. Expressions for the expected cost in this case do not allow to find $n_{\max}$ such that $E[C_{n=n_{\max}}] < E[C_{n=k}] < E[C_{n=n_{\max}+1}]$. Instead we can express $E[C]$ as a function of $E[T]$ as $E[C] = \lambda\frac{n}{\alpha-1}(\alpha - \frac{n-k}{n\lambda}E[T])$. We can then find an approximation for $E[T_{\min}]$ directly by relating $E[C_{n_{\max}}]$ to $E[C_{n=k}]$.\\ $E[C_{n_{\max}}] < E[C_{n=k}]$ holds only if $E[T_{n_{\max}}] < \lambda\alpha + \frac{E[T_{n=k}]}{n_{\max}-k}$, from which \eqref{eq:eq_zerodelay_coded_pareto_reduc_in_E_T_for_base_E_C} follows. Upper bound \eqref{eq:eq_zerodelay_coded_pareto_reduc_in_E_T_for_base_E_C__ineq} follows from this by setting $n_{\max} = k+1$.
\end{proof}

Fig.~\ref{fig:plot_zerodelay_red_pareto_reduc_in_E_T_for_baseline_E_C} illustrates that the maximum percentage reduction in latency (i.e., $\frac{E[T_0]-E[T_{\min}]}{E[T_0]}$; $E[T_{\min}]$ is latency without exceeding the baseline cost, $E[T_0]$ is the latency with no redundancy) depends on the tail of task execution time. As stated in Corollary \ref{cor_zerodelay_red_pareto_reduc_in_E_T_for_baseline_E_C}, this reduction is possible under replicated redundancy only when the tail index is less than $1.5$, in other words when the tail is quite heavy, while coding relaxes this constraint. Moreover, the threshold on $\alpha$ under replication is independent of the number of tasks $k$, while threshold increases with $k$ under coding, meaning that jobs with larger number of tasks can get reduction in latency at no cost even for lighter tailed task execution times.
\begin{figure}[h]
  \centering
  \includegraphics[width=0.35\textwidth, keepaspectratio=true]{plot_zerodelay_red_pareto_reduc_in_E_T_for_baseline_E_C.pdf}
  \caption{Maximum percentage reduction in expected latency without exceeding the baseline cost of running with no redundancy depends on the tail of task execution time. Latency reduction at no cost is possible for replicated redundancy only if the tail index is below $1.5$ while this constraint is relaxed under coding.}
  \label{fig:plot_zerodelay_red_pareto_reduc_in_E_T_for_baseline_E_C}
\end{figure}

\vspace{1ex}
\noindent\textbf{Demonstration using Google traces:} We simulated expected cost and latency of redundancy systems by using the empirical task execution time distributions that we constructed using Google Trace data \cite{reiss2011google}. Fig.~\ref{fig:plot_reped_vs_coded_Google} plots cost and latency curves using the three empirical distributions plotted in Fig.~\ref{fig:plot_google_empiricaltail} for jobs with $k=15, 400, 1050$ tasks.

For all three distributions, coding is doing better than replication in cost vs. latency tradeoff. Cost and latency can be reduced together with redundancy for all distributions because they pronounce a tail heavier than Exponential at large values. Note that although replication cannot reduce cost below the baseline cost of running with no redundancy, coding can achieve this for $k=15, 1050$. Also for $k=400$, although replication seems to achieve less cost and latency for low redundancy levels, coding outperforms replication beyond a certain level of redundancy.
\begin{figure*}[t]
  \centering
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_zerodelay_reped_vs_coded_Google_k_15.pdf}
  \end{subfigure}
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_zerodelay_reped_vs_coded_Google_k_400.pdf}
  \end{subfigure}
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_zerodelay_reped_vs_coded_Google_k_1050.pdf}
  \end{subfigure}
  \caption{Expected cost vs.\ latency in zero-delay redundancy systems using empirical task execution time distribution for jobs with number of tasks $k=15, 400, 1050$ from Google Trace data.}
  \label{fig:plot_reped_vs_coded_Google}
\end{figure*}

\section{Straggler Relaunch}
There are two properties of heavy tailed distributions (e.g., {\it Pareto}) that greatly affect the latency of distributed job computation \cite{crovella2001performance}. First, if task execution times are heavy tailed, the longer a task has taken to execute, the longer its residual lifetime is expected to be. Second, majority of the mass in a set of sample observations drawn from a heavy tailed distribution is contributed by only a few samples. This suggests that among many heavy tailed tasks, very few of them are expected to be stragglers with very long completion time compared to the non-stragglers.

When task execution times are heavy tailed, after non-straggler tasks finish, we are expected to wait even longer for job completion since the remaining straggler tasks are expected to take at least as much more time as the non-stragglers have. This suggests that killing straggler tasks and launching fresh replacements can reduce the job completion time.

In this section, we study relaunching remaining tasks after some delay, and show that it can yield significant reduction in cost and latency when the tail of task execution time is heavy enough. We discuss about the level of tail heaviness required for relaunching to be useful. In the system we study, selection of tasks to relaunch is decided by the time relaunching is performed. Untimely relaunch may cause reduction in gain or even pain by either late relaunch and delayed cancellation of stragglers or early relaunch and killing non-stragglers. We present an approximate optimal relaunch time given the distribution of task execution times. Lastly, cost and latency of adding redundancy together with task relaunch is discussed.

\vspace{1ex}
\noindent
\textbf{No redundancy with relaunch:}
Thm.~\ref{thm_k_wrelaunch_E_T} gives exact expressions for expected latency and cost in no-redundancy systems, in which tasks that did not complete by time $\Delta$ are relaunched without introducing any redundancy. Note that we assume that relaunching takes place instantly upon cancellation and thus, it does not incur additional delay or cost. Fig.~\ref{fig:fig_k_wrelaunch_E_T__E_C_a} compares the latency with and without relaunch in a no-redundancy system. Relaunching tasks before the minimum task completion time $\lambda$ causes work loss and increases latency, while relaunching at the right time gives significant reduction in job completion time. Since cost is a direct function of latency in the absence of redundancy, reduction in latency will certainly reduce cost, as plotted in Fig.~\ref{fig:fig_k_wrelaunch_E_T__E_C_b}. Notice that relaunching all tasks at the beginning ($\Delta=0$) or not relaunching at all ($\Delta \rightarrow \infty$) implements the identical behavior and gives the identical cost and latency.
\begin{theorem}
  Under task execution time $X \sim Pareto(\lambda, \alpha)$ in a no-redundancy system (i.e., $c=0$ or $n=k$) with relaunch, the tail probability  of a job completion time is

  \begin{align}
    Pr\{T > t\} &= 1 - \Bigl\{\mathbbm{1}(t > \lambda)\Bigl[1 - \Bigl(\frac{\lambda}{t}\Bigl)^{\alpha}\Bigr]\Bigr\}^k
    \nonumber \\
    &+ \Bigl\{q + \mathbbm{1}(t > \Delta)\Bigl[1 - \Bigl(\frac{\Delta}{t}\Bigr)^{\alpha}\Bigr](1-q)\Bigr\}^k \label{eq:eq_k_wrelaunch_Pr_T_g_t}\\
    &+ \Bigl\{q + \mathbbm{1}(t > \Delta+\lambda)\Bigl[1 -\Bigl (\frac{\lambda}{t-\Delta}\Bigl)^{\alpha}\Bigr](1-q)\Bigr\}^k.
    \nonumber
  \end{align}

  The expected job completion time is
  \begin{equation}
  \begin{split}
    E[T] =
    \begin{cases}
      \Delta + g(k,\alpha) & \Delta \leq \lambda, \\
      \begin{split}
        & \Delta(1-q^k) + \\
        & g(k,\alpha)\Bigr[\Bigl(\frac{\lambda}{\Delta}-1)I(1-q;1-\alpha^{-1},k\Bigr) + 1\Bigr]
      \end{split} & o.w.
    \end{cases}
  \end{split}
  \label{eq:eq_k_wrelaunch_E_T}
  \end{equation}

  The expected cost with ($E[C^c]$) and without ($E[C]$) task cancellation is
  \begin{equation}
  \begin{split}
    E[C] &=
    \begin{cases}
      k\Delta + \frac{k\lambda}{1-\alpha^{-1}} & \Delta \leq \lambda, \\
      \frac{\alpha}{\alpha-1}[k\lambda(2-q)] - \frac{k\Delta(1-q)}{\alpha-1} & o.w.
    \end{cases} \\
    E[C^c] &=
    \begin{cases}
      k\Delta + \frac{1}{\alpha-1}[k\lambda\alpha - g(k,\alpha)] & \Delta \leq \lambda, \\
      \frac{\alpha}{\alpha-1}[k(1-q)(\lambda-\Delta) + k\lambda]+ k(1-q)\Delta & o.w.
    \end{cases}
  \end{split}
  \end{equation}
  where $q = \mathbbm{1}(\Delta > \lambda)(1 - (\frac{\lambda}{\Delta})^{\alpha})$ and $g(k,\alpha) = \lambda k!\frac{\Gamma(1-\alpha^{-1})}{\Gamma(k+1-\alpha^{-1})}$, which is the expected job completion time without relaunch.
  \label{thm_k_wrelaunch_E_T}
\end{theorem}
\begin{proof}[Sketch]
  Defining random variable $R$ as the number of tasks completed before $\Delta$, $R \sim Binomial(k, q)$ where $q = \mathbbm{1}(\Delta > \lambda)(1 - (\frac{\lambda}{\Delta})^{\alpha})$. Derivation of the tail, and expected latency and cost follows from the law of total probability or expectation by conditioning on $R$.
\end{proof}

An approximation for the optimal relaunch delay $\Delta^*$ that achieves the lowest latency and cost is given in Corollary \ref{cor_k_wrelaunch_E_T__opt_d_suff_a}. Convergence of this approximation to the true optimal is at a rate exponential with increasing $k$. Approximate $\Delta^*$ is very close to true optimal for $k=100$ as shown in Fig.~\ref{fig:fig_k_wrelaunch_E_T__E_C}. The optimal relaunch delay is an increasing function of minimum task execution time $\lambda$ and number of tasks, which intuitively makes sense. Also, it is a decreasing function of $\alpha$, meaning that it is better to relaunch earlier when the tail of task execution times is lighter, while for heavy tail, delaying relaunch further helps to identify stragglers and performs better in terms of cost and latency. This is because relaunching is a choice of canceling work that is already completed to get possibly lucky and execute fresh copies much faster than the canceled stragglers. Expected gain from relaunching under light tail is less than that under heavier tail since heavier tailed stragglers are expected to take much longer. Therefore, when the tail is light, it is better to try our chance with relaunch earlier and decrease amount of work loss with task cancellation.
\begin{corollary}
  Under task execution time $ Pareto(\lambda, \alpha)$ in a no-redundancy system, a sufficient condition on $\alpha$, which guarantees that expected cost and latency can be reduced by relaunching tasks at some time $\Delta$ is
  \begin{equation}
    \alpha < \frac{\ln(k+1)}{\ln(4)}.
  \label{eq:eq_k_wrelaunch_suff_a}
  \end{equation}
  Optimal relaunch time to achieve minimum cost and latency is approximated as
  \begin{equation}
    \Delta^* \approx \lambda\sqrt{\frac{k!\Gamma(1-\alpha^{-1})}{\Gamma(k+1-\alpha^{-1})}}
  \label{eq:eq_k_wrelaunch_optimal_d}
  \end{equation}
  which implies that optimal fraction of tasks to relaunch on average can be approximated as
  \begin{equation}
    p^* \approx \frac{\Gamma(1-\alpha^{-1})^{-\alpha/2}}{\sqrt{k+1}}.
  \label{eq:eq_k_wrelaunch_optimal_fraction}
  \end{equation}
  Upper bound on $\alpha$, and approximations for $\Delta^*$ and $p^*$ get tighter as the number of tasks $k$ increases.
  \label{cor_k_wrelaunch_E_T__opt_d_suff_a}
\end{corollary}
\begin{proof}

  Approximation for $\Delta^*$ follows from approximation $I(1-q, 1-\alpha^{-1}, k) \approx 1$ for large $k$ and then minimizing expected latency given in eq.~\eqref{eq:eq_k_wrelaunch_E_T} by taking derivative with respect to $\Delta$.

  Approximation for $p^*$ follows by observing that number of tasks completed before $\Delta^*$ is $R \sim Binomial(k, q^*)$ where $q^* = 1 - (\frac{\lambda}{\Delta^*})^{\alpha}$. Then, average fraction of tasks that are relaunched is $p^* = 1 - q^* = (\frac{\lambda}{\Delta^*})^{\alpha}$ in which we can use approximation $\Delta^* \approx \lambda\sqrt{\Gamma(1 - \alpha^{-1})(k+1)^{\alpha^{-1}}}$ for large $k$.

  Secondly, we show the sufficient condition on $\alpha$ to be able to reduce $E[T]$ with relaunch. Let $T_{norel}$ be job completion time in no-redundancy system with no relaunch, then $E[T_{norel}] = g(k,\alpha)$ where $g(k,\alpha) = \lambda\frac{k!\Gamma(1-\alpha^{-1})}{\Gamma(k+1-\alpha^{-1})}$.
  \begin{equation}
  \begin{split}
    E[T - T_{norel}] &= \Delta(1-q^k) \\
    &\quad - (1-\frac{\lambda}{\Delta})g(k,\alpha)I(1-q;1-\alpha^{-1},k) \\
    &\approx \Delta - (1-\frac{\lambda}{\Delta})g(k,\alpha).
  \end{split}
  \end{equation}
  This difference is smallest when $\Delta = \Delta^*$ for which we will use the approximate discussed above. We are interested in the maximum value of $\alpha$ that would allow maximum possible difference $E[T - T_{norel}]$ to be negative as
  \begin{equation*}
  \begin{split}
    \Delta^* - (1-\frac{\lambda}{\Delta^*})g(k,\alpha) &< 0 \\
    2\sqrt{\lambda g(k,\alpha)} - g(k,\alpha) &< 0 \\
    \frac{\Gamma(k+1)\Gamma(1-\alpha^{-1})}{\Gamma(k+1-\alpha^{-1})} &> 4 \\
    \ln(\frac{\Gamma(k+1)}{\Gamma(k+1-\alpha^{-1})}) + \ln(\Gamma(1-\alpha^{-1})) &> 4 \\
    \frac{\ln(k+1)}{\alpha} + \ln(\Gamma(1-\alpha^{-1})) &\stackrel{(a)}{>} \ln(4).
  \end{split}
  \end{equation*}
  where $(a)$ is by using the approximation $\frac{\Gamma(k+1)}{\Gamma(k+1-\alpha^{-1})} \approx (k+1)^{1/\alpha}$ for large $k$. For $\alpha \geq 1$, which is what we assume since it is a requirement for finite expected latency, $\ln(\Gamma(1-\alpha^{-1})) > 0$ holds, and so sufficient condition given in eq.~\eqref{eq:eq_k_wrelaunch_suff_a} follows.
\end{proof}

Expression for optimal delay $\Delta^*$ tells us that it is better to relaunch earlier when task execution times have lighter tail. However, relaunching earlier does not mean that more tasks will be relaunched. Fraction of tasks $p^*$ that are relaunched after optimal delay $\Delta^*$ monotonically decreases with $\alpha$~\footnote{$p^*$ is a monotonically decreasing function of $\alpha$. For very heavy tail i.e., $\lim_{\alpha \rightarrow 1} \Gamma(1-\alpha^{-1})^{-\alpha/2} = 1$, for very light tail i.e., $\lim_{\alpha \rightarrow \infty} \Gamma(1-\alpha^{-1})^{-\alpha/2} \approx 0.749$.}, i.e., as the tail gets lighter. Notice that $p^*$ decreases with $k$, which means for jobs with larger number of tasks, optimal strategy dictates relaunching smaller fraction of the tasks. For instance, suppose $\alpha=2$ and $k=100$, then $p^* \approx 0.06$, in other words, only $6\%$ of the tasks would need to be relaunched on average for optimal latency and cost.

Note that we assume relaunching takes place instantly and does not introduce any cost. Adding relaunch cost into the analysis, which we leave as a future work, could make the analysis more realistic and also give more insight in searching for optimal relaunch strategy in practice.

\captionsetup[subfigure]{labelformat=empty}
\begin{figure}[h]
  \centering
  \begin{subfigure}[]{.35\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_arepeat_k_wrelaunch_Pareto_k_100.pdf}
    \caption{}
    \label{fig:fig_k_wrelaunch_E_T__E_C_a}
  \end{subfigure}
  \begin{subfigure}[]{.35\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_arepeat_k_wrelaunch_E_C_vs_E_T_Pareto_k_100.pdf}
    \caption{}
    \label{fig:fig_k_wrelaunch_E_T__E_C_b}
  \end{subfigure}
  \caption{(Top) Expected latency in no-redundancy system with and without relaunch in terms of relaunch delay $\Delta$. (Bottom) Expected cost vs. latency curve for no-redundancy system with relaunch, along which the value of delay $\Delta$ is varied.}
  \label{fig:fig_k_wrelaunch_E_T__E_C}
\end{figure}

\begin{figure}[b]
  \centering
  \includegraphics[width=0.35\textwidth, keepaspectratio=true]{plot_arepeat_k_n_wrelaunch_Pareto_k_10__reduc_in_E_T_vs_a.pdf}
  \caption{Maximum percentage reduction in expected latency by task relaunch depends on the tail of the task execution time. $\alpha_u$ is the upper bound on $\alpha$ given as the sufficient condition in Corollary \ref{cor_k_wrelaunch_E_T__opt_d_suff_a}.}
  \label{fig:fig_k_wrelaunch__reduc_in_E_T_vs_a}
\end{figure}

\begin{figure*}[t]
  \centering
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_arepeat_k_n_wrelaunch_E_C_vs_E_T_Pareto_k_100_n_+2.pdf}
  \end{subfigure}
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_arepeat_k_n_wrelaunch_E_C_vs_E_T_Pareto_k_100_n_+10.pdf}
  \end{subfigure}
  \begin{subfigure}[]{.32\textwidth}
    \centering
    \includegraphics[width=1\textwidth, keepaspectratio=true]{plot_arepeat_k_c_wrelaunch_E_C_vs_E_T_Pareto_k_100.pdf}
  \end{subfigure}
  \caption{Expected cost vs.\ latency for coding $(k, n, \Delta)$ and replication $(k, c, \Delta)$ systems with relaunch. Each curve is plotted by interpolating between incremental steps of $\Delta$. Delaying redundancy is effective to reduce cost under low level of coded redundancy (Left) while it is not effective under higher level of coded redundancy (Middle) and not effective in replicated redundancy at all times (Right).}
  \label{fig:fig_k_nc_wrelaunch_E_C_vs_E_T}
\end{figure*}

Relaunching allows reducing the average number of stragglers by replacing tasks that appear to be straggling with fresh copies. For relaunching to be effective, loss incurred by starting fresh copies from scratch should be compensated by avoiding very long execution times of stragglers. In other words, for relaunching to be able to reduce latency and cost, task execution times must be heavy tailed beyond a threshold. If the tail is lighter than this threshold, relaunching actually hurts and increases cost and latency (e.g., relaunching always hurts when task execution times are light tailed). Corollary \ref{cor_k_wrelaunch_E_T__opt_d_suff_a} gives a sufficient condition on tail index $\alpha$ such that for any $\alpha$ less than $\frac{\ln(k+1)}{\ln(4)}$, relaunching helps to reduce cost and latency. Note that this upper bound does not depend on the minimum task completion time $\lambda$ and is only proportional to the logarithm of the number of tasks $k$, which we also validated by numerically computing the exact upper limit on $\alpha$. This upper bound given as the sufficient condition and the exact upper limit on $\alpha$ get closer as $k$ increases, which is illustrated in Fig.~\ref{fig:fig_k_wrelaunch__reduc_in_E_T_vs_a}.

\vspace{1ex}
\noindent
\textbf{Redundancy with relaunch:} Here we study the effect of adding redundancy together with relaunching remaining tasks at time $\Delta$. We modify the previously studied redundancy systems as the follows. In replication $(k, c, \Delta)$-system, each remaining task at time $\Delta$ is relaunched together with $c$ new replicas. In coding $(k, n, \Delta)$-system, each remaining task at time $\Delta$ is relaunched and overall $n-k$ new parity tasks are added.

Thm.~\ref{thm_k_cn_wrelaunch_E_T__E_C} state exact expressions for the expected cost and latency in respectively replicated and coded redundancy systems with relaunch. Fig.~\ref{fig:fig_k_nc_wrelaunch_E_C_vs_E_T} plots cost vs.\ latency curves for varying level of redundancy. When level of coded redundancy is low (e.g., $n-k = 1,2$), there is an optimum delay $\Delta$ that gives the minimum cost and latency as observed previously for no-redundancy system with relaunch. As the level of coded redundancy increases (e.g., $n-k \geq 10$), redundancy becomes a greater effect on cost and latency than relaunching stragglers, and delaying redundancy becomes not effective in reducing cost as observed previously for redundancy systems with no relaunch (see \cite{ourmamapaper}). In replication system, delaying redundancy is ineffective to reduce cost at all times. This is because replicating each remaining task even by one is enough to dominate relaunching stragglers in terms of the effect on cost and latency.

\begin{theorem}
  Suppose task execution time is $Pareto(\lambda, \alpha)$. In replication $(k, c, \Delta)$-system with relaunch, expected job execution time is
  \begin{equation*}
  \begin{split}
    E[T] =
    \begin{cases}
      \Delta + \lambda k!\frac{\Gamma(1-\tilde{\alpha}^{-1})}{\Gamma(k+1-\tilde{\alpha}^{-1})} & \Delta \leq \lambda, \\
      \begin{split}
        & \lambda\frac{\Gamma(1-\tilde{\alpha}^{-1})}{\Gamma(-\tilde{\alpha}^{-1})}B(k-kq+1, -\tilde{\alpha}^{-1}) \\
        & - \lambda\frac{\Gamma(1-\alpha^{-1})}{\Gamma(-\alpha^{-1})}B(k-kq+1, -\alpha^{-1}) \\
        &+ E[T_{no}].
      \end{split} & o.w.
    \end{cases}
  \end{split}
  \label{eq:eq_k_c_wrelaunch_E_T}
  \end{equation*}
  where $E[T_{no}]$ is the expected job completion time for no-redundancy system with relaunch as given in eq.~\eqref{eq:eq_k_wrelaunch_E_T}.

  Expected cost with ($C^c$) and without ($C$) task cancellation is
  \begin{equation*}
  \begin{split}
    E[C^c] &=
    \begin{cases}
      k\Delta + k\lambda(c+1)\frac{\tilde{\alpha}}{\tilde{\alpha}-1} & \Delta \leq \lambda, \\
      \begin{split}
        & \frac{k\alpha}{(\alpha-1)}(\lambda - \Delta(1-q)) \\
        &+ k(1-q)\Delta + k\lambda(c+1)(1-q)\frac{\tilde{\alpha}}{\tilde{\alpha}-1}
      \end{split}
      & o.w.
    \end{cases} \\
    E[C] &=
    \begin{cases}
      k\Delta + k\lambda(c+1)\frac{\alpha}{\alpha-1} & \Delta \leq \lambda, \\
      \begin{split}
        & \frac{k\alpha}{(\alpha-1)}(\lambda - \Delta(1-q)) + k(1-q)\Delta \\
        &+ k\lambda(c+1)(1-q)\frac{\alpha}{\alpha-1}
      \end{split}
      & o.w.
    \end{cases}
  \end{split}
  \label{eq:eq_k_c_wrelaunch_E_C}
  \end{equation*}
  where $\tilde{\alpha} = (c+1)\alpha$ and $q = \mathbbm{1}(\Delta > \lambda)(1 - (\frac{\lambda}{\Delta})^{\alpha})$.
  In coding $(k, n, \Delta)$-system with relaunch, expected job execution time is
  \begin{equation*}
  \begin{split}
    E[T] =
    \begin{cases}
      \Delta + \lambda \frac{n!}{(n-k)!}\frac{\Gamma(n-k+1-\alpha^{-1})}{\Gamma(n+1-\alpha^{-1})} & \Delta \leq \lambda, \\
      \begin{split}
        & \Delta(1-q^k) + \lambda(\frac{B(n-kq+1,-\alpha^{-1})}{B(n-k+1,-\alpha^{-1})} \\
        &+ kB(q;k,1-\alpha^{-1}) - q^k)
      \end{split} & o.w.
    \end{cases}
  \end{split}
  \label{eq:eq_k_n_wrelaunch_E_T}
  \end{equation*}

  Expected cost with ($C^c$) and without ($C$) task cancellation is
  \begin{equation}
  \begin{split}
    E[C^c] &=
    \begin{cases}
      k\Delta + \lambda\frac{n}{\alpha-1}(\alpha - \frac{\Gamma(n)}{\Gamma(n-k)}\frac{\Gamma(n-k+1-\alpha^{-1})}{\Gamma(n+1-\alpha^{-1})}) & \Delta \leq \lambda, \\
      \begin{split}
        & \frac{\alpha}{\alpha-1}(k(1-q)(\lambda-\Delta) + n\lambda) \\
        &+ k(1-q)\Delta - \lambda(n-k)q^k \\
        &- \frac{\lambda}{\alpha-1}(n-k)\frac{B(n-kq+1, -\alpha^{-1})}{B(n-k+1, -\alpha^{-1})}.
      \end{split} & o.w.
    \end{cases} \\
    E[C] &=
    \begin{cases}
      k\Delta + \frac{n\lambda}{1-\alpha^{-1}} & \Delta \leq \lambda, \\
      \begin{split}
      & \frac{\alpha}{\alpha-1}(k\lambda(1-q+q^k) + n\lambda(1-q^k)) \\
      &- \frac{k\Delta(1-q)}{\alpha-1}
      \end{split} & o.w.
    \end{cases}
  \end{split}
  \label{eq:eq_k_n_wrelaunch_E_Cnocancel}
  \end{equation}
  where $q = \mathbbm{1}(\Delta > \lambda)(1 - (\frac{\lambda}{\Delta})^{\alpha})$.

\label{thm_k_cn_wrelaunch_E_T__E_C}
\end{theorem}

\section{Open Problems}
In the analysis given here, we assumed that execution time of each task is iid  and does not depend on resources they run on. Main justification for this assumption is that computing systems usually have large number of nodes and each task can be placed on a separate node at random. In other words, we assumed that the task execution time is decoupled from resource scheduling. However, execution time of a task that exclusively runs on a node would have different distribution than a task that runs together with several others on the same node. There are two challenges in the analysis of latency and cost with resource scheduling in mind: 1) There is not enough experimental evidence to accurately model execution time with respect to resource load, 2) Order statistics of multiple distribution families are intractable.

Moreover, in reality, task execution times cannot be arbitrarily large, but modeling as {\it SExp} or {\it Pareto} does not implement this restriction. Another possible extension of the cost and latency analysis would be considering right truncated execution time models. Main challenge for this extension is that truncation renders the order statistics analysis tedious and often intractable.

redpajama_set_name: RedPajamaArXiv


text:
Cloudy skies. High near 50F. Winds light and variable..
Rain likely. Low 46F. Winds S at 5 to 10 mph. Chance of rain 90%. Rainfall near a quarter of an inch.
Dec. 28 — At 10:40 p.m. in Ilwaco, suspicious activity was reported after three people were allegedly seen hiding near a sport boat.
Dec. 30 — At 2:51 p.m., an intoxicated driver was driving in the wrong lane.
Dec. 31 — A suspicious van was reported in the parking lot of an Ilwaco business at 8 p.m.
The alleged theft of a scooter from a Long Beach business was reported at 10:44 p.m.
Jan. 1 — A domestic violence incident was reported at 12:10 a.m. in Long Beach.
Jan. 2 — At 2:10 p.m., in Long Beach, a two-vehicle accident was reported.
A hit-and-run accident in the parking lot of a Long Beach business was reported at 3:16 p.m.
At 5:20 p.m., an allegedly intoxicated driver was "all over the road" and "driving into oncoming traffic" in Long Beach.
In Long Beach at 8:23 p.m., a suspicious vehicle with fogged up windows was reported sitting outside a business.
Dec. 27 — At 9:53 a.m., in Naselle, an allegedly vicious pitbull dog was reported.
A domestic violence incident in progress in Menlo was reported at 12:19 p.m.
Suspicious activity at several homes in Surfside was reported at 1:31 p.m. The caller said one home had been entered.
In Raymond at 2:28 p.m., a domestic incident was reported.
At 4:35 p.m., occupants from an older pickup were alleged to have dumped an old toolbox on private property.
Dec. 28 — Suspicious activity in a Naselle home was reported at 12:02 a.m.
A one-vehicle accident in Ocean Park was reported at 9:56 a.m.
Repeated home burglaries were reported at 12:16 p.m. The caller said more than $3,700 was stolen from the home in the last couple of days.
At 1:15 p.m. in Surfside, people living on a lot who allegedly haven't paid rent were reported.
A burglary to a storage unit was reported at 3:21 p.m., with an urn, safe, tools, bow and arrow and more stolen.
A possible burglary was reported at 7:45 p.m.
At 10:59 p.m. in Seaview, someone was revving a car with no muffler.
Dec. 29 — A burglary to a maintenance building in Surfside was reported at 10:39 a.m.
Adult abuse was reported at 7:27 p.m. in Ocean Park.
Near Smith Creek at 10:58 p.m., a person was revving the motor of a vehicle.
Dec. 30 — At 10:13 a.m., it was reported that a large hound dog jumped on several vehicles possibly causing damage.
At 12:31 p.m. in Raymond, a suspicious situation was reported for door-to-door carpet cleaners.
"Sketchy people" were reported at 8:02 p.m. at a Seaview business.
Dec. 31 — A transient male was reported hanging out at a school near Lebam at 12:13 p.m.
Telephone harassment from scam callers was reported at 12:36 p.m. in Ocean Park.
At 11:11 p.m. in Seaview, a disorderly person was reported.
At 2:54 p.m. in Lebam, another call was received about a homeless person who had set up camp near the school.
A domestic violence incident in progress in Raymond was reported at 7:18 p.m.
Jan. 1, 2021 — Suspicious activity in Bay Center was reported at 5:44 a.m. The caller said a vehicle was being driven back and forth in a neighborhood and revving the engine repeatedly.
The theft of a deer skull from an Ocean Park home was reported at 1:36 p.m. The suspect was on security video.
At 2:24 p.m. it was reported that a garbage can had been blown up.
At 5:46 p.m., a large tree was down across the road near the Willapa Bay Wildlife Refuge.
Jan. 2 — The alleged theft of various items from an Ocean Park home was reported at 2:53 p.m. The caller said someone was hired to clean the home and didn't but instead took various items including china.
Criminal trespassing was reported at 3:08 p.m. in Ocean Park.
A homeless man was said to be staying at the back of a Raymond store at 5:09 p.m., and won't leave when asked.
Near Ocean Park, child abuse or neglect was alleged.

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: user-control to nested usercontrol communication in asp.net I have a ProductBox.ascx user control which I use as ItemTemplate for a DataList as i have to repeat it.Now that datalist in inside a seperate user control ProductGrid.ascx.There is a third usercontrol ProductPopUp.ascx.All these controls are on page User.aspx.
I want to access ProductBox.ascx from ProductPopUp.ascx. I want a loosely coupled solution to it.
Please mind ProductBox.ascx is inside other usercontrol

A: Create a Public property member on the nested control and set this as required for basic passing in data/values.
Edit: If these controls are repeated etc you can then set these new properties like setting other Controls using 'FindControl' and getting a reference to the UserControl.
Is this what you're after?

A: I understand your desire for loose coupling as user controls ideally should be solely responsible for their appearance.  However I can imagine circumstances where parent controls need to dictate their childrens' behavior.
You could bubble the DataList's data binding event up to the parent page and then manipulate each product.  Just try to minimize the complexity of the interface between the parents & kids putting as much business logic inside the product controls as you can.

redpajama_set_name: RedPajamaStackExchange


text:
Sports Management And Recreational Marketing- Final Exam- Dr. Anspaugh
Garrett V.
How many states regulate agents?
What is SPARTA?
A federal law signed by President George W. Bush regulating the conduct of sport agents

What is UAAA?
Uniform Athlete Agents Act
The MLBPA limits agent's fees to what percentage of the player's income?
There is no limit
One of the significant factors in the growth of sports agencies was..?
Development of competing leagues
Who was the "endorsement king of the pre-Michael Jordan era?"
All of the following are objectives of person-centered branding except:
Branding based on how someone is as a person rather than on their performance
When negotiating an endorsement contract the agent should be certain to maintain the client's exclusive rights and control over his or her:
Image and other endorsements
An athlete earning a multi-million dollar salary should adopt a:
An agent must help an athlete with the transition from a professional playing career as an athlete and with
post career planning and retirement
When the Dayton Dragons opened the gates of their new field in April of 2000 with what the team dubbed the "world's largest outdoor billboard" they were using the strategy of:
Dominant identity
The continuing influx of new sport leagues, teams, and events has created:
More options for companies large and small to engage in sport sponsorships
The most successful sport organizations in attracting and retaining sponsorship partners are those that do all of the following except:
Sign as many sponsors as possible
For the major professional sport leagues and associations, sponsorships involve:
A variety of marketing mix elements designed to send messages to a targeted audience
Sponsorship provides a company with all of the following except:
Opportunities to receive revenue back from the team or league based on success on the field/court
Which of the following has been described as a watershed in the evolution of sport sponsorship?
Los Angeles Olympic games
Based on corporate sponsorship involvement, which Olympic Games was able to turn a profit for the host city?
The man behind the success of the new commercial mind-set brought to the Los Angeles Olympics was:
The "2-2-1 Plan" instituted by Major League Baseball and its baseball commissioner Peter Ueberroth did which of the following:
Required companies to commit for 3 years along with financial promises as well
Reasons for the tremendous growth in sport sponsorship over the past two decades include:
Commercial success of the LA Olympics, increased media interest in sport
Targeted sponsorships enable corporate marketers to reach:
Specific groups that have similar demographics, psychographics, or geographics
One major reason why Golden Flake Snack Foods selected the Southeastern Conference (SEC) as a ...
Female & Family demographic
PepsiCo's Mountain Dew brand has built a sponsorship franchise with Dew Tour specifically to reach the:
Younger generations
Today's sport sponsorship can be described as
Discipline including; serious research, large investments, and strategic objectives in some measurable way.
Return on investment (ROI) in the sport sponsorship world is defined as:
Meeting the company's specific marketing and sales objectives.
The concept requiring that the sponsor commit financial resources in support of its sponsorship through promotion and advertising that thematically includes the sport property's imagery is known as:
Sales promotions in sport sponsorships are designed to:
Stimulate immediate product demand
Sales promotions may be aimed at:
Increasing brand awareness, broadening the sales distribution channels for a company & product/service
No other sport has utilized in-stadium promotion as widely as:
Continuity promotions refer to the concept of:
Requires fans to attend multiple games in order to receive full promotion.
The success of in-venue promotions varies widely based on a number of factors including:
Value added benefits, traditional giveaways, continuity promotions, day of promotion, opponent, perceived quality, and success rate.
A cereal company activates its NASCAR sponsorship by offering consumers a free mini-car for consumers who purchase specially marked boxes. This is an example of what type of promotion:
One of the most effective sales promotion tools often used with a new product to induce consumers to try a product is:
The joining together of two or more companies to capitalize on a sponsorship is known as:
Cross-promotion
Which type of sponsorship platform would be more appropriate for larger, national companies with large financial resources
Governing body sponsorship
Which type of sponsorship platform would be more appropriate for local or regional companies or companies with smaller marketing budgets?
Team sponsorhship
One of the fastest-growing sponsorship platforms is:
Facility sponsorship
In measuring return-on-investment (ROI) from sport sponsorships, companies have used all of the following methods except:
Qscores scale
More and more corporations are directing a portion of their sport sponsorship spending to ethnic marketing because of:
Growth of the Hispanic population, ESPN Deportes
_____ is the attempt by a person or organization to benefit from media
Of the following, who are stakeholders?
Media, fans sponsors
Groups and individuals that have a stake in an organization.
In times of crisis, why is the Internet a useful tool for a sport communications practitioner?
Potential to reach large audience
The three disciplines Integrated Marketing Communications combines are:
Advertising, Marketing, and public relations
Which of these statements about community relations is true?
The development of substantive programs is to benefit charitable causes, educational and outreach programs in an organizations area of business.
A video news release (VNR) is:
A video segment made to look like a news report, but is instead created by =an outside source who could benefit.
______________ combines elements of computing, technology, telecommunications, and content to create products and services to be used interactively by consumers and business users.
New media Industry
An __________________ is an Interchange of information between two or more parties that has a specific purpose or goal.
According to Neilsen/NetRatings, ____ % of active home Web users connected to the Internet via broadband.
According to Neilsen/NetRatings, sports internet sites reach approximately ___ million active online visitors.
A ______________ is a basic interpretive mechanism to let people know what an organization is doing and are sent out to editors and reporters in hopes of stimulating favorable stories about their organizations.
Electronic ________________ sent via e-mail, as compared with printed versions, are generally less costly, easier to produce, more timely, and can include additional links to other Web-based information.
One of the most recent trends in public relations activities by sport teams, leagues, players associations, and college athletics is government relations. Government relations is another term for
Lobbying of state and federal officials
The success rate of a direct marketing campaign is where a positive response comes from approximately ___ % of respondents.
_________________ is information placed in the media by an identified sponsor that pays for the time or space. It is a controlled method of placing messages in the media.
Choosing the correct medium to place advertising requires a thorough examination of each potential outlet's ability to reach the most people fitting a target audience's demographic profile. This is known as
_________________ is, according to Seitel (2001), the symbiosis of advertising, marketing, and public relations.
A ___________ is a group of key individuals such as the president, general manager/athletic director, director of communications, director of marketing, director of finance, and legal counsel who are responsible for effectively managing a crisis.
Crisis team
_____________ is created to reinforce an organization's brand imagery in the minds of consumers.
________________ aim to encourage consumers to do something, such as buy tickets.
Call-to-action ads
Family Educational Rights and Privacy Act (FERPA) sets the parameters for providing personal academic and medical information to the media. Which of the following statements is not a true statement regarding FERPA?
Buckley amendment, sets parameters for providing personal academic and medical information to the media.
Why is it said that a video news release (VNR) is worth the price of production and distribution?
Summary or Press Release that's edited for a broadcast, making it more attractive for a TV producer to air.
_________________ contain all the statistical information and biographical information about two teams competing in a game, both from an individual and team perspective.
Media Notes Packages
A/an _____________ can help a sport organization decide how its advertising dollars can be effectively spent in the media of TV, print, and the internet.
One of the most overlooked forms of communication is internal communications. Internal communications involve
Daily/Weekly emails from President, AD, or GM.
What statement below is not a true one regarding sport communications?
Defined as all methods used by a sport organization to proactively deliver its messages to a diverse universe of constituencies
Sport communication professionals may find themselves or their organizations in some legal trouble if they commit ________________ in the course of sharing "news" with a representative of the media.
The financial success of a sport organization and the media are inextricably linked. In fact some sports teams are in fact owned by media conglomerates. Which of the following is not owned by a media conglomerate?
Alexander Graham Bell first demonstrated the telephone in what year?
In 1888, German physicist Heinrich Hertz published the results of an experiment proving that:
Radio waves could be generated, transmitted, and detected
Guglielmo Marconi patented what device in 1896?
The first commercial radio broadcast was
KDKA
In 1938 what team prevailed in a lawsuit against a radio station who had broadcast their games without permission?
What two men dominated the growth of sport broadcasting in the 1960's and beyond?
Roone Arledge and Pete Rozelle
The Sports Broadcasting Act of 1961
Granted pro sports immunity from antitrust actions regarding the pooling of broadcast rights
The NFL's annual television revenues are over:
"The thrill of victory and the agony of defeat" said by:
In 1970 Monday Night Football debuted. It was a revolutionary concept because it was the first sports broadcast to
Package sports as entertainment, and have 3 announcers in the broadcast booth.
Which term does not describe a typical rights arrangement?
Shared Exclusivity
CPM stands for:
Cost per thousand
What federal agency, created in 1934, currently regulates the communications industry?
A television program's "rating" represents:
% of TV households in the survey universe tuned into the program
A television program's "share" represents
% of TV households watching TV at the home
Cume is...
Cumulative Audience Over Time
The sports audience is on average:
60-70% males
The Arena Football League and NBC Sports agreed to what?
Pool and share costs and profits from telecasts of games
The YES network is
Owned by the New York Yankees, 24 hour sports network
Broadcasters say that revenue sharing is advantageous to them because why?
Frees them from financial burdens, forces teams and leagues to become active partners with those interested in marketing and promoting the game.
A haphazard broadcast has what effect?
Reflects badly on team, alienates audience, results in less ad revenue and lower rights fees
The NBA's television revenues for 2002 were what?
College Sports programs help ease the financial burden of their broadcast partners by?
Underwriting production costs and travel expenses
A two-hour basketball broadcast can be professionally produced for as little as:
CBS paid what staggering amount of money to televise March Madness?
The leading broadcast media research firm is
AC Nielson company
How many households in the United States have televisions?
What sporting event generates the largest television audience on a world scale?
A 22 rating for a television program means that it was viewed in how many homes in the Unites States?
23.474 Million
Today in the United States what percentage of homes are hooked up to cable television?
citi questions
principles of management final
relationship management final
sport management final
sports management 276 test 1
multicultural final exam
quiz a - e
sport management final (51-100)
quiz's 1-4 questions
kine 223 -soccer final
which group underwent a large increase in diversity during the cambrian explosion?
the most important role of bacteria in the environment is


text:
Tributes to Her Late Majesty the Queen
Thank you, Madam Deputy Speaker, for the opportunity to convey and share the sadness of my Gordon constituents at the passing of Her late Majesty Queen Elizabeth, and to express our gratitude for her lifetime of service as our monarch and Head of State.
It has been an incredible privilege to listen to so many generous tributes in this place yesterday and today, and to hear so many personal stories about how Her Majesty's life and reign touched so many people. Many have already spoken, in this place and elsewhere, of the sense of permanence that Her Majesty brought to us. She was ever-present—a constant presence—in our public life. So many of us perhaps never realised the importance that she played in that backdrop of our lives and the presence that she had until that presence was no longer there.
It was a role that she carried out with diligence, grace and decorum, and with a deep sense of duty and obligation, for which we are all incredibly grateful. She was quite an extraordinary person, called to serve us in quite extraordinary times in quite an extraordinary role, serving as our monarch through a tumultuous period of technological, social and political advance.
She was the Head of State of many different countries and territories, and, as the winds of change blew throughout the past century, she saw many of them achieving self-government in their own right and saw many changes internally within the UK, with devolution to Scotland, Wales and Northern Ireland. But throughout she demonstrated a surefootedness; a steadiness. She was a unifying presence, whatever change was happening around her, symbolising all that remained in common.
As has been said, she had a particular affinity with Scotland, particularly with Aberdeenshire in the north-east of Scotland, and especially with her beloved home, Balmoral castle. It was an area of Scotland where she was greatly loved and which she loved very much in return.
The loss of Her Majesty will be felt deeply. Even those who might be ambivalent to the institution of monarchy will nevertheless realise the enormity of the passing of someone who has served in that role so steadfastly, so diligently and with such commitment to her people.
As His Majesty King Charles has said:
"We mourn profoundly the passing of a cherished sovereign and a much-loved Mother. I know her loss will be deeply felt throughout the country, the realms and the Commonwealth, and by countless people around the world."
In that, he speaks for each of us. May she rest in peace. God save the King.


text:
The Sweetest Thing (2002)
Watch The Sweetest Thing Full Movie Online
Christina's love life is stuck in neutral. After years of avoiding the hazards of a meaningful relationship, one night while club-hopping with her girlfriends, she meets Peter, her perfect match. Fed up with playing games, she finally gets the courage to let her guard down and follow her heart, only to discover that Peter has suddenly left town. Accompanied by Courtney, she sets out to capture the one that got away.
Director: Allan Graf, Allen Kupetsky, Cara Giallanza, Carlos Saldanha, Cate Hardman, Chris Sanders, Chris Wedge, Claudine Strasser, Corey Yuen, Daniel Barlow, Dean DeBlois, Dean Garvin, Doug Coleman, Edward Lachman, Ellory Elkayem, Frank Kostenko Jr., George Clooney, Glen Trotiner, Gregg Smrz, Gregory Palmer, Guillermo del Toro, Hope Garrison, Janna DeLury, Jay Mason, Jeanne Byrd, Jeff Okabayashi, John P. Aguirre, Jonas Åkerlund, Julian Wall, Julie Taymor, K.C. Hodenfield, Kurt Wimmer, Larry Clark, Lars P. Winther, Louis Leterrier, Marie Leconte, Mark Avery, Mark Taylor, Martina Götthansova, Mary Cybulski, Nilo Otero, Pamela Alch, Paul F. Bernard, Paul Thomas Anderson, Philip Seeger, Randall Wallace, Robin Anderson, Roger Kumble, Sam Mendes, Shari L. Carpenter, Spike Jonze, Spike Lee, Stella D'Onofrio, Steve Battaglia, Tess Malone, Tom Brady, Walt Becker, Wayne Wang
Actors: Adam Chubbuck, Adam Sandler, Alan Tudyk, Alex Burns, Alexandra Holden, Alfred Molina, Amanda Plummer, Amy Hill, Amy Sedaris, Angus Macfadyen, Anna Faris, Anna Paquin, Antonio Banderas, Ashley Judd, Barry Pepper, Brad Pitt, Brian Cox, Brittany Murphy, Cameron Diaz, Cara Seymour, Cedric the Entertainer, China Chow, Chloe Hunter, Chris Cooper, Chris Eigeman, Chris Klein, Chris Sanders, Christian Bale, Christina Applegate, Ciarán Hinds, Clark Gregg, Daniel Cosgrove, Daniel Craig, Danny John-Jules, Daveigh Chase, David Arquette, David Darlow, David Ogden Stiers, David Schrempf, Denis Leary, Deon Richmond, Didier Saint Melin, Diedrich Bader, Diego Luna, Dominic Purcell, Don McManus, Donnie Yen, Doug E. Doug, Doug Rand, Doug Spinuzza, Drew Barrymore, Eddie McClintock, Edward Norton, Eileen Ryan, Elisa Bocanegra, Emily Siewert, Emily Watson, Eric Christian Olsen, Eric Roberts, Fay Hauser, Frances Conroy, François Berléand, Frank Grillo, George Clooney, Georgia Engel, Goran Visnjic, Greg Kinnear, Isiah Whitlock Jr., Jack Black, James Bullard, James Mangold, James Ransone, Jason Andrews, Jason Bateman, Jason Schwartzman, Jason Scott Lee, Jason Statham, Jay Tavare, Jean-Marie Paris, Jean-Yves Bilien, Jennifer Jason Leigh, Jennifer Lopez, Jerry Weintraub, John Leguizamo, Jsu Garcia, Judy Greer, Julia Roberts, Kal Penn, Kari Wuhrer, Keri Russell, Kevin Chamberlin, Kevin McDonald, Kevin Michael Richardson, Kris Kristofferson, Leon Rippy, Leonor Varela, Levan Uchaneishvili, Liam Aiken, Lorri Bagley, Luis Guzmán, Luke Goss, Madeleine Stowe, Maeve Quinlan, Maggie Gyllenhaal, Marc Blucas, Maria Pia Calzone, Marissa Matrone, Maritza Murray, Mary Lynn Rajskub, Matt Czuchry, Matt Damon, Matt Schulze, Matthew Harbour, Matthew Lawrence, Mel Gibson, Melora Hardin, Mena Suvari, Meryl Streep, Mía Maestro, Michael Cera, Mickey Rourke, Mike Apaletegui, Misha Kuznetsov, Natasha Richardson, Nicolas Cage, Norman Reedus, Parker Posey, Patricia Reyes Spíndola, Patrick Fugit, Paul Gleason, Paul Newman, Philip Seymour Hoffman, Priscilla Lopez, Rachel McAdams, Ralph Fiennes, Ray Romano, Ric Young, Richard Riehle, Rick Overton, Riley Smith, Rob Schneider, Robert Davi, Robert Smigel, Roger Rees, Ron Livingston, Ron Perlman, Rosario Dawson, Rutger Hauer, Ryan Reynolds, Saffron Burrows, Salma Hayek, Sam Elliott, Sam Rockwell, Scarlett Johansson, Scott Terra, Sean Bean, Sean Pertwee, Seann Conway, Selma Blair, Shu Qi, Simon Helberg, Stanley Tucci, Stephen Jasso, Stephen Root, Tara Reid, Taye Diggs, Teck Holmes, Thomas Jane, Thomas Kretschmann, Tia Carrere, Tiffany Limos, Tilda Swinton, Tim Matheson, Tom Hanks, Tony Siragusa, Tyler Hoechlin, Tyler Posey, Vincent Nemeth, Ving Rhames, Wade Williams, Wesley Snipes, Zoe Caldwell
Combining two names synonymous with outrageous comedy, funnyman Kevin Hart joins Tiffany Haddish (Girl Trip) in "Night School." Hart plays Teddy Walker, an underachiever in high school who thought his…
Robin Hood: Men in Tights
Robin Hood comes home after fighting in the Crusades to learn that the noble King Richard is in exile and that the despotic King John now rules England, with the…
Country: France, USA
Murderesses Velma Kelly and Roxie Hart find themselves on death row together and fight for the fame that will keep them from the gallows in 1920s Chicago.
Country: USA, Germany, Canada
Jumanji: Welcome to the Jungle
The tables are turned as four teenagers are sucked into Jumanji's world – pitted against rhinos, black mambas and an endless variety of jungle traps and puzzles. To survive, they'll…
Genre: Action, Adventure, Comedy, Fantasy
In a dystopian near future, single people, according to the laws of The City, are taken to The Hotel, where they are obliged to find a romantic partner in forty-five…
Country: Ireland, UK, Greece, France, Netherlands
Genre: Comedy, Drama, Romance, Science Fiction, Thriller
Being Frank
A seventeen-year-old boy blackmails his father after discovering his secret second family
Never Been Kissed
Josie Geller, a baby-faced junior copywriter at the Chicago Sun-Times, must pose as a student at her former high school to research contemporary teenage culture. With the help of her…
Many loosely connected characters cross paths in this film, based on the stories of Raymond Carver. Waitress Doreen Piggot accidentally runs into a boy with her car. Soon after walking…
The Adventures of Priscilla, Queen of the Desert
Two drag-queens and a transsexual contract to perform a drag show at a resort in Alice Springs, and head west from Sydney aboard their lavender bus, named 'Priscilla'. En route,…
Jojo Rabbit is about a young boy living during World War II. His only escapism is through his imaginary friend, an ethnically inaccurate version of Adolf Hitler, who pushes the…
Genre: Comedy, War
Fired from his band and hard up for cash, guitarist and vocalist Dewey Finn finagles his way into a job as a fifth-grade substitute teacher at a private school, where…
Creatively unfulfilled and facing financial ruin, Nick Cage must accept a $1 million offer to attend the birthday of a dangerous superfan. Things take a wildly unexpected turn when Cage…
Trailer: The Sweetest Thing


text:
<?php

namespace spec\IPFS\Console;

use IPFS\Console\ApiCommand;
use IPFS\Console\CommandBuilder;
use IPFS\Container\ServiceProvider;
use IPFS\Driver\Driver;
use IPFS\Utils\AnnotationReader;
use phpDocumentor\Reflection\DocBlockFactory;
use PhpSpec\ObjectBehavior;
use Pimple\Container;
use Prophecy\Argument;
use spec\IPFS\TestApi;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\OutputInterface;

class CommandBuilderSpec extends ObjectBehavior
{
    public function let()
    {
        $container = new Container();
        $provider = new ServiceProvider();
        $provider->register($container);

        $this->beConstructedWith(
            [new TestApi()],
            new AnnotationReader(new \Doctrine\Common\Annotations\AnnotationReader(), DocBlockFactory::createInstance())
        );
    }

    public function it_is_initializable()
    {
        $this->shouldHaveType(CommandBuilder::class);
    }

    public function it_builds_symfony_commands_from_the_apis()
    {
        $commands = $this->generateCommands();

        $commands->shouldHaveKey('test:foo');
        $command = $commands['test:foo'];
        /* @var ApiCommand $command */

        $command->shouldHaveType(ApiCommand::class);
        $command->getName()->shouldBe('test:foo');
        $command->getDescription()->shouldBe('this is a description.');

        $command->getDefinition()->hasOption('bazz');
        $command->getDefinition()->getOption('bazz')->getDefault()->shouldBe(false);
        $command->getDefinition()->getOption('bazz')->getDescription()->shouldBe('bazz');

        $command->getDefinition()->hasOption('lol');
        $command->getDefinition()->getOption('lol')->getDefault()->shouldBe(1);
        $command->getDefinition()->getOption('lol')->getDescription()->shouldBe('lol');

        $command->getDefinition()->hasArgument('bar');
        $command->getDefinition()->getArgument('bar')->isRequired()->shouldBe(true);
        $command->getDefinition()->getArgument('bar')->getDescription()->shouldBe('bar');
    }

    public function it_invokes_the_driver_on_run(Driver $driver, OutputInterface $output)
    {
        $this->getWrappedObject()->addDriver(get_class($driver->getWrappedObject()), function () use ($driver) {
            return $driver->getWrappedObject();
        });

        $command = $this->generateCommands()['test:foo'];
        $command->setApplication(new Application());

        $command->run(new ArrayInput(['bar' => 'real value', '--driver' => get_class($driver->getWrappedObject())]), $output);

        $output->writeln(Argument::any())->shouldBeCalled();
    }
}

redpajama_set_name: RedPajamaGithub


A comparison of 1% prilocaine with 0.5% ropivacaine for outpatient-based surgery under axillary brachial plexus block.
Abstract: A comparison of 1% prilocaine with 0.5% ropivacaine for outpatient-based surgery under axillary brachial plexus block.
Janzen PR, Vipond AJ, Bush DJ, Hopkins PM.
Leeds Teaching Hospitals, St. James's University Hospital, Beckett Street, Leeds, England.
We compared the use of 1% prilocaine with 0.5% ropivacaine for axillary brachial plexus anesthesia in a double-blinded manner in day-stay patients to determine the better of the two local anesthetics in terms of onset time and duration of motor block. Sixty patients scheduled for outpatient upper-limb surgery were allocated randomly to receive either prilocaine (28 patients) or ropivacaine (32 patients) at a volume of 0.7 mL/kg. The brachial plexus was located with a plexus needle and nerve stimulator. By 20 min after injection of prilocaine or ropivacaine, there was no difference in analgesic effect. By this time, it was apparent whether or not a block was going to be adequate for surgery. Pain returned after a mean of 278 min (SD 111 min; range, 160-630 min) with prilocaine as compared with 636 min (SD 284 min; range, 210-1440 min) with ropivacaine. Analgesia use was similar in both groups. Duration of motor block with prilocaine was a mean of 254 min (SD 62 min; range, 130-385 min), as compared with 642 min (SD 199 min; range, 350-1080 min) with ropivacaine. We conclude that there is no clinically important difference between 1% prilocaine and 0.5% ropivacaine in time to onset of axillary brachial plexus block when they are injected in equal volumes. There is a significantly longer duration of action with ropivacaine, which may make it less suitable for day-stay upper-limb surgery because of the handicap from reduced muscle power. Implications: This study compares two local anesthetics to determine which is most suitable for day-stay upper-limb surgery under axillary brachial plexus block.Prilocaine 1% is more suitable than ropivacaine 0.5% because of a more prolonged duration of action of ropivacaine, although this could be useful in other circumstances.