You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/08/25 13:54:13 UTC

[GitHub] [nifi-minifi-cpp] adam-markovics commented on a change in pull request #877: MINIFICPP-1339 - Reopen rocksdb database when space becomes available on the disk

adam-markovics commented on a change in pull request #877:
URL: https://github.com/apache/nifi-minifi-cpp/pull/877#discussion_r476437225



##########
File path: extensions/rocksdb-repos/FlowFileRepository.cpp
##########
@@ -37,6 +37,10 @@ namespace core {
 namespace repository {
 
 void FlowFileRepository::flush() {
+  auto opendb = db_->open();
+  if (!opendb) {
+    return;

Review comment:
       Is this okay, shouldn't we log or throw?

##########
File path: extensions/rocksdb-repos/FlowFileRepository.cpp
##########
@@ -194,22 +201,27 @@ bool FlowFileRepository::ExecuteWithRetry(std::function<rocksdb::Status()> opera
  * Returns True if there is data to interrogate.
  * @return true if our db has data stored.
  */
-bool FlowFileRepository::need_checkpoint(){
-  std::unique_ptr<rocksdb::Iterator> it = std::unique_ptr<rocksdb::Iterator>(db_->NewIterator(rocksdb::ReadOptions()));
+bool FlowFileRepository::need_checkpoint(minifi::internal::OpenRocksDB& opendb){
+  auto it = opendb.NewIterator(rocksdb::ReadOptions());
   for (it->SeekToFirst(); it->Valid(); it->Next()) {

Review comment:
       Why is this a loop if it returns the first time?

##########
File path: extensions/rocksdb-repos/FlowFileRepository.cpp
##########
@@ -91,14 +95,18 @@ void FlowFileRepository::flush() {
 }
 
 void FlowFileRepository::printStats() {
+  auto opendb = db_->open();
+  if (!opendb) {
+    return;

Review comment:
       Is this okay, shouldn't we log or throw?




----------------------------------------------------------------
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:
users@infra.apache.org