dajac commented on code in PR #14985:
URL: https://github.com/apache/kafka/pull/14985#discussion_r1433889262


##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/runtime/InMemoryPartitionWriter.java:
##########
@@ -33,10 +37,141 @@
  */
 public class InMemoryPartitionWriter<T> implements PartitionWriter<T> {
 
+    public static class LogEntry {
+        public static <T> LogEntry value(T value) {
+            return new LogValue<>(value);
+        }
+
+        public static <T> LogEntry value(
+            long producerId,
+            short producerEpoch,
+            T value
+        ) {
+            return new LogValue<>(
+                producerId,
+                producerEpoch,
+                value
+            );
+        }
+
+        public static LogEntry control(
+            long producerId,
+            short producerEpoch,
+            int coordinatorEpoch,
+            TransactionResult result
+        ) {
+            return new LogControl(
+                producerId,
+                producerEpoch,
+                coordinatorEpoch,
+                result
+            );
+        }
+    }
+
+    public static class LogValue<T> extends LogEntry {
+        public final long producerId;
+        public final short producerEpoch;
+        public final T value;
+
+        private LogValue(
+            long producerId,
+            short producerEpoch,
+            T value
+        ) {
+            this.producerId = producerId;
+            this.producerEpoch = producerEpoch;
+            this.value = value;
+        }
+
+        private LogValue(T value) {
+            this(
+                RecordBatch.NO_PRODUCER_ID,
+                RecordBatch.NO_PRODUCER_EPOCH,
+                value
+            );
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;

Review Comment:
   Yes.



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