15 #ifndef IMPALA_RUNTIME_DATA_STREAM_RECVR_H
16 #define IMPALA_RUNTIME_DATA_STREAM_RECVR_H
18 #include <boost/scoped_ptr.hpp>
19 #include <boost/thread/mutex.hpp>
23 #include "gen-cpp/Types_types.h"
24 #include "gen-cpp/Results_types.h"
31 class SortedRunMerger;
104 void AddBatch(
const TRowBatch& thrift_batch,
int sender_id);
bool ExceedsLimit(int batch_size)
RuntimeProfile::TimeSeriesCounter * bytes_received_time_series_counter_
Time series of number of bytes received, samples bytes_received_counter_.
RowDescriptor row_desc_
Row schema, copied from the caller of CreateRecvr().
RuntimeProfile::Counter * first_batch_wait_total_timer_
void RemoveSender(int sender_id)
RuntimeProfile * profile_
Runtime profile storing the counters below.
PlanNodeId dest_node_id() const
DataStreamRecvr(DataStreamMgr *stream_mgr, MemTracker *parent_tracker, const RowDescriptor &row_desc, const TUniqueId &fragment_instance_id, PlanNodeId dest_node_id, int num_senders, bool is_merging, int total_buffer_limit, RuntimeProfile *profile)
TUniqueId fragment_instance_id_
Fragment and node id of the destination exchange node this receiver is used by.
Status GetBatch(RowBatch **next_batch)
void CancelStream()
Empties the sender queues and notifies all waiting consumers of cancellation.
RuntimeProfile::Counter * deserialize_row_batch_timer_
boost::scoped_ptr< MemTracker > mem_tracker_
Memtracker for batches in the sender queue(s).
const TUniqueId & fragment_instance_id() const
AtomicInt< int > num_buffered_bytes_
total number of bytes held across all sender queues.
const RowDescriptor & row_desc() const
std::vector< SenderQueue * > sender_queues_
RuntimeProfile::Counter * buffer_full_total_timer_
This class is thread-safe.
void Close()
Deregister from DataStreamMgr instance, which shares ownership of this instance.
Status CreateMerger(const TupleRowComparator &less_than)
boost::try_mutex buffer_wall_timer_lock_
Status GetNext(RowBatch *output_batch, bool *eos)
RuntimeProfile::Counter * bytes_received_counter_
Number of bytes received.
void TransferAllResources(RowBatch *transfer_batch)
ObjectPool sender_queue_pool_
Pool of sender queues.
RuntimeProfile::Counter * buffer_full_wall_timer_
Wall time senders spend waiting for the recv buffer to have capacity.
boost::scoped_ptr< SortedRunMerger > merger_
SortedRunMerger used to merge rows from different senders.
void AddBatch(const TRowBatch &thrift_batch, int sender_id)
DataStreamMgr * mgr_
DataStreamMgr instance used to create this recvr. (Not owned)
RuntimeProfile::Counter * data_arrival_timer_
Total time spent waiting for data to arrive in the recv buffer.
MemTracker * mem_tracker() const