| 137 | } |
| 138 | |
| 139 | bool FlowFileRecord::Persist(const std::shared_ptr<core::Repository>& flowRepository) { |
| 140 | if (flowRepository->isNoop()) { |
| 141 | return true; |
| 142 | } |
| 143 | |
| 144 | io::BufferStream outStream; |
| 145 | |
| 146 | if (!Serialize(outStream)) { |
| 147 | return false; |
| 148 | } |
| 149 | |
| 150 | if (flowRepository->Put(getUUIDStr(), const_cast<uint8_t*>(outStream.getBuffer()), outStream.size())) { |
| 151 | logger_->log_debug("NiFi FlowFile Store event %s size " "%" PRIu64 " success", getUUIDStr(), outStream.size()); |
| 152 | // on behalf of the persisted record instance |
| 153 | if (claim_) claim_->increaseFlowFileRecordOwnedCount(); |
| 154 | return true; |
| 155 | } else { |
| 156 | logger_->log_error("NiFi FlowFile Store failed %s size " "%" PRIu64, getUUIDStr(), outStream.size()); |
| 157 | return false; |
| 158 | } |
| 159 | |
| 160 | return true; |
| 161 | } |
| 162 | |
| 163 | std::shared_ptr<FlowFileRecord> FlowFileRecord::DeSerialize(io::InputStream& inStream, const std::shared_ptr<core::ContentRepository>& content_repo, utils::Identifier& container) { |
| 164 | int ret; |
no test coverage detected