GAIA 0.1.0
mr
joiner_executor.h
1
// Copyright 2019, Beeri 15. All rights reserved.
2
// Author: Roman Gershman (romange@gmail.com)
3
//
4
5
#pragma once
6
7
#include <boost/fiber/unbuffered_channel.hpp>
8
9
#include "mr/operator_executor.h"
10
11
namespace
mr3 {
12
13
class
JoinerExecutor
:
public
OperatorExecutor
{
14
struct
IndexedInput {
15
uint32_t index;
16
const
pb::Input::FileSpec* fspec;
17
const
pb::WireFormat* wf;
18
};
19
20
using
ShardInput = std::pair<ShardId, std::vector<IndexedInput>>;
21
public
:
22
JoinerExecutor
(
util::IoContextPool
* pool,
Runner
* runner);
23
~
JoinerExecutor
();
24
25
void
Run(
const
std::vector<const InputBase*>& inputs, detail::TableBase* tb,
26
ShardFileMap* out_files)
final
;
27
28
// Stops the executor in the middle.
29
void
Stop()
final
;
30
31
private
:
32
void
InitInternal()
final
;
33
void
CheckInputs(
const
std::vector<const InputBase*>& inputs);
34
35
void
ProcessInputQ(detail::TableBase* tb);
36
37
void
JoinerFiber();
38
39
::boost::fibers::unbuffered_channel<ShardInput> input_q_;
40
41
std::atomic<uint64_t> finish_shard_latency_sum_{0}, finish_shard_latency_cnt_{0};
42
};
43
44
}
// namespace mr3
mr3::JoinerExecutor
Definition:
joiner_executor.h:13
mr3::OperatorExecutor
Base class for operator executors.
Definition:
operator_executor.h:27
util::IoContextPool
A pool of IoContext objects, representing and managing CPU resources of the system.
Definition:
io_context_pool.h:26
mr3::Runner
Definition:
runner.h:20
Generated by
1.8.15