adamdebreceni commented on code in PR #1640:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1640#discussion_r1412073720


##########
libminifi/src/core/ContentRepository.cpp:
##########
@@ -98,4 +98,23 @@ bool ContentRepository::remove(const minifi::ResourceClaim 
&streamId) {
   return true;
 }
 
+std::unique_ptr<StreamAppendLock> ContentRepository::append(const 
org::apache::nifi::minifi::ResourceClaim &claim, size_t offset) {
+  std::lock_guard guard(appending_mutex_);
+  if (offset != size(claim)) {
+    // we are trying to append to a resource that has already been appended to
+    return {};
+  }
+  if (!appending_.insert(claim.getContentFullPath()).second) {
+    // this resource is currently being appended to
+    return {};
+  }
+  return std::make_unique<ContentStreamAppendLock>(sharedFromThis(), claim);
+}

Review Comment:
   renamed



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to