17 #include <boost/thread/thread.hpp>
24 using namespace impala;
32 for (
int i = 0; i < num_args; ++i) {
34 ss <<
"worker-thread(" << i <<
")";
46 if (latencies != NULL) sw.
Start();
47 Status local_status =
function(arg);
48 if (!local_status.
ok()) {
49 unique_lock<mutex> l(*lock);
50 if (status->
ok()) *status = local_status;
53 if (latencies != NULL) {
static void Worker(Function function, void *arg, boost::mutex *lock, Status *status, StatsMetric< double > *latencies)
TODO: Consider allowing fragment IDs as category parameters.
boost::function< Status(void *arg)> Function
void Update(const T &value)
uint64_t ElapsedTime() const
Returns time in nanosecond.
Status AddThread(Thread *thread)
static Status Exec(Function function, void **args, int num_args, StatsMetric< double > *latencies=NULL)
Callers may pass a StatsMetric to gather the latency distribution of task execution.