MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / drain

Method drain

libminifi/src/Connection.cpp:226–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226void Connection::drain(bool delete_permanently) {
227 std::lock_guard<std::mutex> lock(mutex_);
228
229 while (!queue_.empty()) {
230 std::shared_ptr<core::FlowFile> item = queue_.front();
231 queue_.pop();
232 logger_->log_debug("Delete flow file UUID %s from connection %s, because it expired", item->getUUIDStr(), name_);
233 if (delete_permanently) {
234 if (item->isStored() && flow_repository_->Delete(item->getUUIDStr())) {
235 item->setStoredToRepository(false);
236 auto claim = item->getResourceClaim();
237 if (claim) claim->decreaseFlowFileRecordOwnedCount();
238 }
239 }
240 }
241 queued_data_size_ = 0;
242 logger_->log_debug("Drain connection %s", name_);
243}
244
245} // namespace minifi
246} // namespace nifi

Callers 3

clearConnectionMethod · 0.45
~ProcessGroupMethod · 0.45
drainConnectionsMethod · 0.45

Calls 9

log_debugMethod · 0.80
isStoredMethod · 0.80
setStoredToRepositoryMethod · 0.80
getResourceClaimMethod · 0.80
emptyMethod · 0.45
popMethod · 0.45
getUUIDStrMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected