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

Method cloneDuringTransfer

libminifi/src/core/ProcessSession.cpp:124–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124std::shared_ptr<core::FlowFile> ProcessSession::cloneDuringTransfer(const std::shared_ptr<core::FlowFile> &parent) {
125 auto record = std::make_shared<FlowFileRecord>();
126
127 auto flow_version = process_context_->getProcessorNode()->getFlowIdentifier();
128 if (flow_version != nullptr) {
129 record->setAttribute(SpecialFlowAttribute::FLOW_ID, flow_version->getFlowId());
130 }
131 this->_clonedFlowFiles.push_back(record);
132 logger_->log_debug("Clone FlowFile with UUID %s during transfer", record->getUUIDStr());
133 // Copy attributes
134 for (const auto& attribute : parent->getAttributes()) {
135 if (attribute.first == SpecialFlowAttribute::ALTERNATE_IDENTIFIER
136 || attribute.first == SpecialFlowAttribute::DISCARD_REASON
137 || attribute.first == SpecialFlowAttribute::UUID) {
138 // Do not copy special attributes from parent
139 continue;
140 }
141 record->setAttribute(attribute.first, attribute.second);
142 }
143 record->setLineageStartDate(parent->getlineageStartDate());
144 record->setLineageIdentifiers(parent->getlineageIdentifiers());
145 record->getlineageIdentifiers().push_back(parent->getUUID());
146
147 // Copy Resource Claim
148 std::shared_ptr<ResourceClaim> parent_claim = parent->getResourceClaim();
149 record->setResourceClaim(parent_claim);
150 if (parent_claim != nullptr) {
151 record->setOffset(parent->getOffset());
152 record->setSize(parent->getSize());
153 }
154 provenance_report_->clone(parent, record);
155
156 return record;
157}
158
159std::shared_ptr<core::FlowFile> ProcessSession::clone(const std::shared_ptr<core::FlowFile> &parent, int64_t offset, int64_t size) {
160 if ((uint64_t) (offset + size) > parent->getSize()) {

Callers 1

routeFlowFileMethod · 0.95

Calls 15

getProcessorNodeMethod · 0.80
log_debugMethod · 0.80
setLineageStartDateMethod · 0.80
setLineageIdentifiersMethod · 0.80
getResourceClaimMethod · 0.80
setResourceClaimMethod · 0.80
setOffsetMethod · 0.80
getOffsetMethod · 0.80
setSizeMethod · 0.80
getFlowIdentifierMethod · 0.45
setAttributeMethod · 0.45
getFlowIdMethod · 0.45

Tested by

no test coverage detected