eolivelli commented on a change in pull request #1931: (WIP) 
GetListOfEntriesOfLedger implementation
URL: https://github.com/apache/bookkeeper/pull/1931#discussion_r253199458
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java
 ##########
 @@ -641,4 +649,233 @@ public void onRotateEntryLog() {
     public List<GarbageCollectionStatus> getGarbageCollectionStatus() {
         return 
Collections.singletonList(gcThread.getGarbageCollectionStatus());
     }
+
+    @Override
+    public byte[] getEntriesOfLedger(long ledgerId) throws Exception {
+        return getEntriesOfLedger(ledgerId, Collections.emptyIterator());
+    }
+
+    public static final long INVALID_ENTRYID = -1;
+
+    /*
+     *
+     * Nomenclature:
+     *
+     * - Continuous entries are grouped as a ’Sequence’. - Number of continuous
+     * entries in a ‘Sequence’ is called ‘sequenceSize’. - Gap between
+     * Consecutive sequences is called ‘sequencePeriod’. - Consecutive 
sequences
+     * with same sequenceSize and same sequencePeriod in between consecutive
+     * sequences are grouped as a SequenceGroup. - ‘firstSequenceStart’ is the
+     * first entry in the first sequence of the SequenceGroup. -
+     * ‘lastSequenceStart’ is the first entry in the last sequence of the
+     * SequenceGroup.
+     *
+     * To represent a SequenceGroup, two long values and two int values are
+     * needed, so each SequenceGroup can be represented with (2 * 8 + 2 * 4 = 
24
+     * bytes).
+     */
+    private static class SequenceGroup {
 
 Review comment:
   we should have specific unit tests around these classes, they can be tested 
without starting a bookie 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to