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


Reply via email to