16 #ifndef IMPALA_RUNTIME_DATA_STREAM_MGR_H
17 #define IMPALA_RUNTIME_DATA_STREAM_MGR_H
21 #include <boost/thread/mutex.hpp>
22 #include <boost/shared_ptr.hpp>
23 #include <boost/thread/condition_variable.hpp>
24 #include <boost/unordered_map.hpp>
32 #include "gen-cpp/Types_types.h"
37 class DataStreamRecvr;
68 const TUniqueId& fragment_instance_id,
PlanNodeId dest_node_id,
82 const TRowBatch& thrift_batch,
int sender_id);
91 void Cancel(
const TUniqueId& fragment_instance_id);
104 typedef boost::unordered_multimap<uint32_t,
110 bool operator()(
const std::pair<impala::TUniqueId, PlanNodeId>& a,
111 const std::pair<impala::TUniqueId, PlanNodeId>& b) {
112 if (a.first.hi < b.first.hi) {
114 }
else if (a.first.hi > b.first.hi) {
116 }
else if (a.first.lo < b.first.lo) {
118 }
else if (a.first.lo > b.first.lo) {
121 return a.second < b.second;
132 boost::shared_ptr<DataStreamRecvr>
FindRecvr(
133 const TUniqueId& fragment_instance_id,
PlanNodeId node_id,
134 bool acquire_lock =
true);
Status DeregisterRecvr(const TUniqueId &fragment_instance_id, PlanNodeId node_id)
Remove receiver block for fragment_instance_id/node_id from the map.
boost::shared_ptr< DataStreamRecvr > CreateRecvr(RuntimeState *state, const RowDescriptor &row_desc, const TUniqueId &fragment_instance_id, PlanNodeId dest_node_id, int num_senders, int buffer_size, RuntimeProfile *profile, bool is_merging)
FragmentStreamSet fragment_stream_set_
Status CloseSender(const TUniqueId &fragment_instance_id, PlanNodeId dest_node_id, int sender_id)
bool operator()(const std::pair< impala::TUniqueId, PlanNodeId > &a, const std::pair< impala::TUniqueId, PlanNodeId > &b)
boost::mutex lock_
protects all fields below
boost::shared_ptr< DataStreamRecvr > FindRecvr(const TUniqueId &fragment_instance_id, PlanNodeId node_id, bool acquire_lock=true)
uint32_t GetHashValue(const TUniqueId &fragment_instance_id, PlanNodeId node_id)
less-than ordering for pair<TUniqueId, PlanNodeId>
boost::unordered_multimap< uint32_t, boost::shared_ptr< DataStreamRecvr > > StreamMap
std::set< std::pair< TUniqueId, PlanNodeId >, ComparisonOp > FragmentStreamSet
ordered set of registered streams' fragment instance id/node id
const RowDescriptor & row_desc() const
Status AddData(const TUniqueId &fragment_instance_id, PlanNodeId dest_node_id, const TRowBatch &thrift_batch, int sender_id)
void Cancel(const TUniqueId &fragment_instance_id)
Closes all receivers registered for fragment_instance_id immediately.