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

Method remove

extensions/rocksdb-repos/DatabaseContentRepository.cpp:146–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146bool DatabaseContentRepository::remove(const minifi::ResourceClaim &claim) {
147 if (!is_valid_ || !db_)
148 return false;
149 auto opendb = db_->open();
150 if (!opendb) {
151 return false;
152 }
153 rocksdb::Status status;
154 status = opendb->Delete(rocksdb::WriteOptions(), claim.getContentFullPath());
155 if (status.ok()) {
156 logger_->log_debug("Deleting resource %s", claim.getContentFullPath());
157 return true;
158 } else {
159 logger_->log_debug("Attempted, but could not delete %s", claim.getContentFullPath());
160 return false;
161 }
162}
163
164std::shared_ptr<io::BaseStream> DatabaseContentRepository::write(const minifi::ResourceClaim& claim, bool /*append*/, rocksdb::WriteBatch* batch) {
165 // the traditional approach with these has been to return -1 from the stream; however, since we have the ability here

Callers 1

flushMethod · 0.45

Calls 4

openMethod · 0.80
log_debugMethod · 0.80
DeleteMethod · 0.45
getContentFullPathMethod · 0.45

Tested by

no test coverage detected