arpadboda commented on a change in pull request #664: WIP: MINIFICPP-1062 -
Improve FlowFile repository performance by leveraging batching
URL: https://github.com/apache/nifi-minifi-cpp/pull/664#discussion_r344712636
##########
File path: extensions/rocksdb-repos/FlowFileRepository.cpp
##########
@@ -32,25 +33,34 @@ namespace repository {
void FlowFileRepository::flush() {
rocksdb::WriteBatch batch;
- std::string key;
- std::string value;
+ uint64_t decrement_total = 0;
rocksdb::ReadOptions options;
std::vector<std::shared_ptr<FlowFileRecord>> purgeList;
- uint64_t decrement_total = 0;
+ std::vector<rocksdb::Slice> keys;
+ std::vector<std::string> values;
+
while (keys_to_delete.size_approx() > 0) {
+ std::string key;
if (keys_to_delete.try_dequeue(key)) {
- db_->Get(options, key, &value);
- decrement_total += value.size();
- std::shared_ptr<FlowFileRecord> eventRead =
std::make_shared<FlowFileRecord>(shared_from_this(), content_repo_);
- if (eventRead->DeSerialize(reinterpret_cast<const uint8_t
*>(value.data()), value.size())) {
- purgeList.push_back(eventRead);
- }
- logger_->log_debug("Issuing batch delete, including %s, Content path
%s", eventRead->getUUIDStr(), eventRead->getContentFullPath());
- batch.Delete(key);
+ keys.push_back(key);
Review comment:
Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services