| 612 | } |
| 613 | |
| 614 | void 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 | |
| 636 | ProcessSession::RouteResult ProcessSession::routeFlowFile(const std::shared_ptr<FlowFile> &record) { |
| 637 | if (record->isDeleted()) { |
nothing calls this directly
no test coverage detected