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

Method commit

extensions/standard-processors/processors/PutFile.cpp:353–370  ·  view source on GitHub ↗

Renames tmp file to final destination Returns true if commit succeeded

Source from the content-addressed store, hash-verified

351// Renames tmp file to final destination
352// Returns true if commit succeeded
353bool PutFile::ReadCallback::commit() {
354 bool success = false;
355
356 logger_->log_info("PutFile committing put file operation to %s", dest_file_);
357
358 if (write_succeeded_) {
359 if (rename(tmp_file_.c_str(), dest_file_.c_str())) {
360 logger_->log_info("PutFile commit put file operation to %s failed because rename() call failed", dest_file_);
361 } else {
362 success = true;
363 logger_->log_info("PutFile commit put file operation to %s succeeded", dest_file_);
364 }
365 } else {
366 logger_->log_error("PutFile commit put file operation to %s failed because write failed", dest_file_);
367 }
368
369 return success;
370}
371
372// Clean up resources
373PutFile::ReadCallback::~ReadCallback() {

Callers 5

GetTCPTests.cppFile · 0.45
ProcessorTests.cppFile · 0.45
handleMethod · 0.45
onTriggerMethod · 0.45
putFileMethod · 0.45

Calls 3

log_infoMethod · 0.80
c_strMethod · 0.80
log_errorMethod · 0.80

Tested by

no test coverage detected