TupleCache::~TupleCache() { // Drain the cache first drain_impl(); for (auto iter = cache_.begin(); iter != cache_.end(); ++iter) { delete iter->second; } }
TupleCache::~TupleCache() { // Drain the cache first drain_impl(); std::map<sp_int32, TupleList*>::iterator iter; for (iter = cache_.begin(); iter != cache_.end(); ++iter) { delete iter->second; } }
void TupleCache::drain(EventLoop::Status) { drain_impl(); }
void TupleCache::add_emit_tuple(sp_int32 _task_id, const proto::system::AckTuple& _tuple) { if (total_size_ >= drain_threshold_bytes_) drain_impl(); TupleList* l = get(_task_id); return l->add_emit_tuple(_tuple, &total_size_); }
sp_int64 TupleCache::add_data_tuple(sp_int32 _task_id, const proto::api::StreamId& _streamid, proto::system::HeronDataTuple* _tuple) { if (total_size_ >= drain_threshold_bytes_) drain_impl(); TupleList* l = get(_task_id); return l->add_data_tuple(_streamid, _tuple, &total_size_, &tuples_cache_max_tuple_size_); }