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

Method Persist

libminifi/src/FlowFileRecord.cpp:139–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139bool 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
163std::shared_ptr<FlowFileRecord> FlowFileRecord::DeSerialize(io::InputStream& inStream, const std::shared_ptr<core::ContentRepository>& content_repo, utils::Identifier& container) {
164 int ret;

Callers 1

RepoTests.cppFile · 0.80

Calls 8

getUUIDStrFunction · 0.85
log_debugMethod · 0.80
log_errorMethod · 0.80
isNoopMethod · 0.45
PutMethod · 0.45
getBufferMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected