cmccabe commented on code in PR #14208:
URL: https://github.com/apache/kafka/pull/14208#discussion_r1296200009


##########
metadata/src/main/java/org/apache/kafka/controller/OffsetControlManager.java:
##########
@@ -212,10 +213,14 @@ long lastStableOffset() {
     }
 
     /**
-     * @return the transaction start offset, or -1 if there is no transaction.
+     * @return the transaction start offset if present, or empty if there is 
no transaction.
      */
-    long transactionStartOffset() {
-        return transactionStartOffset;
+    OptionalLong transactionStartOffset() {

Review Comment:
   I’m not loving this idea of OffsetControlManager.transactionStartOffset 
returning an OptionalLong. Seems inconsistent with the other accessors.
   
   Maybe let’s just return a regular long? I had some vague efficiency related 
reasons for preferring the negative / non-negative convention (to be fair, 
haven’t benchmarked)



##########
metadata/src/main/java/org/apache/kafka/controller/OffsetControlManager.java:
##########
@@ -212,10 +213,14 @@ long lastStableOffset() {
     }
 
     /**
-     * @return the transaction start offset, or -1 if there is no transaction.
+     * @return the transaction start offset if present, or empty if there is 
no transaction.
      */
-    long transactionStartOffset() {
-        return transactionStartOffset;
+    OptionalLong transactionStartOffset() {

Review Comment:
   I’m not loving this idea of OffsetControlManager.transactionStartOffset 
returning an OptionalLong. Seems inconsistent with the other accessors.
   
   Maybe let’s just return a regular long? I had some vague efficiency related 
reasons for preferring the negative / non-negative convention (to be fair, 
haven’t benchmarked)



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to