Renkai commented on a change in pull request #9096:
URL: https://github.com/apache/pulsar/pull/9096#discussion_r555064904



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/LedgerOffloader.java
##########
@@ -35,6 +39,78 @@
 @InterfaceStability.Evolving
 public interface LedgerOffloader {
 
+    @ToString
+    class SegmentInfo {
+        public SegmentInfo(UUID uuid, long beginLedger, long beginEntry, 
String driverName,
+                           Map<String, String> driverMetadata) {
+            this.uuid = uuid;
+            this.beginLedger = beginLedger;
+            this.beginEntry = beginEntry;
+            this.driverName = driverName;
+            this.driverMetadata = driverMetadata;
+        }
+
+
+        public final UUID uuid;
+        public final long beginLedger;
+        public final long beginEntry;
+        public final String driverName;
+        volatile private long endLedger;
+        volatile private long endEntry;
+        volatile boolean closed = false;
+        public final Map<String, String> driverMetadata;
+
+        public boolean isClosed() {
+            return closed;
+        }
+
+        public void closeSegment(long endLedger, long endEntry) {
+            this.endLedger = endLedger;
+            this.endEntry = endEntry;
+            this.closed = true;
+        }
+
+        public OffloadResult result() {
+            return new OffloadResult(beginLedger, beginEntry, endLedger, 
endEntry);
+        }
+    }
+
+
+    class OffloadResult {

Review comment:
       It's a data object like a POJO or Java Bean, I don't see the benefit to 
make it an interface.




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


Reply via email to