szetszwo commented on code in PR #1021:
URL: https://github.com/apache/ratis/pull/1021#discussion_r1458332163


##########
ratis-server-api/src/main/java/org/apache/ratis/server/raftlog/RaftLogSequentialOps.java:
##########
@@ -125,10 +125,21 @@ <OUTPUT, THROWABLE extends Throwable> OUTPUT 
runSequentially(
 
   /**
    * Append asynchronously an entry.
-   * Used by the leader.
+   * Used by the leader for scenarios that there is no needs to clean up 
resources when the given entry is no
+   * longer used/referenced by this log.
    */
   default CompletableFuture<Long> appendEntry(LogEntryProto entry, 
TransactionContext context) {
-    return appendEntry(entry);
+    return appendEntry(ReferenceCountedObject.wrap(entry), context);
+  }

Review Comment:
   The method is not used anywhere except for the new 
`append(ReferenceCountedObject)`.  It should throw an exception and annotated 
as deprecated.
   ```java
     /**
      * @deprecated use {@link #append(ReferenceCountedObject)}.
      */
     @Deprecated
     default CompletableFuture<Long> appendEntry(LogEntryProto entry, 
TransactionContext context) {
       throw new UnsupportedOperationException();
     }
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to