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

Method restore

libminifi/src/core/ProcessSession.cpp:614–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614void ProcessSession::restore(const std::string &key, const std::shared_ptr<core::FlowFile> &flow) {
615 logger_->log_info("Restoring content to %s from key %s", flow->getUUIDStr(), key);
616
617 // Restore the claim
618 if (!flow->hasStashClaim(key)) {
619 logger_->log_warn("Requested restore to record %s from unknown key %s", flow->getUUIDStr(), key);
620 return;
621 }
622
623 // Disown current claim if existing
624 if (flow->getResourceClaim()) {
625 logger_->log_warn("Restoring stashed content of record %s from key %s when there is "
626 "existing content; existing content will be overwritten",
627 flow->getUUIDStr(), key);
628 }
629
630 // Restore the claim
631 auto stashClaim = flow->getStashClaim(key);
632 flow->setResourceClaim(stashClaim);
633 flow->clearStashClaim(key);
634}
635
636ProcessSession::RouteResult ProcessSession::routeFlowFile(const std::shared_ptr<FlowFile> &record) {
637 if (record->isDeleted()) {

Callers

nothing calls this directly

Calls 8

log_infoMethod · 0.80
hasStashClaimMethod · 0.80
log_warnMethod · 0.80
getResourceClaimMethod · 0.80
getStashClaimMethod · 0.80
setResourceClaimMethod · 0.80
clearStashClaimMethod · 0.80
getUUIDStrMethod · 0.45

Tested by

no test coverage detected