| 144 | } |
| 145 | |
| 146 | bool 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 | |
| 164 | std::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 |
no test coverage detected