eolivelli commented on a change in pull request #657: DistributionSchedule uses 
int[] rather than HashSet
URL: https://github.com/apache/bookkeeper/pull/657#discussion_r147656194
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/EnsemblePlacementPolicy.java
 ##########
 @@ -294,33 +294,39 @@ public BookieSocketAddress replaceBookie(int 
ensembleSize,
      *
      * @param ensemble
      *          Ensemble to read entries.
-     * @param writeSet
-     *          Write quorum to read entries.
      * @param bookieFailureHistory
      *          Observed failures on the bookies
-     * @return read sequence of bookies
+     * @param writeSet
+     *          Write quorum to read entries. This will be modified, rather 
than
+     *          allocating a new WriteSet.
+     * @return The read sequence. This will be the same object as the passed in
+     *         writeSet.
      * @since 4.5
      */
-    public List<Integer> reorderReadSequence(ArrayList<BookieSocketAddress> 
ensemble,
-                                             List<Integer> writeSet,
-                                             Map<BookieSocketAddress, Long> 
bookieFailureHistory);
+    public DistributionSchedule.WriteSet reorderReadSequence(
+            ArrayList<BookieSocketAddress> ensemble,
+            Map<BookieSocketAddress, Long> bookieFailureHistory,
+            DistributionSchedule.WriteSet writeSet);
 
 
     /**
      * Reorder the read last add confirmed sequence of a given write quorum 
<i>writeSet</i>.
      *
      * @param ensemble
      *          Ensemble to read entries.
-     * @param writeSet
-     *          Write quorum to read entries.
      * @param bookieFailureHistory
      *          Observed failures on the bookies
-     * @return read sequence of bookies
+     * @param writeSet
+     *          Write quorum to read entries. This will be modified, rather 
than
+     *          allocating a new WriteSet.
+     * @return The read sequence. This will be the same object as the passed in
+     *         writeSet.
      * @since 4.5
      */
-    public List<Integer> reorderReadLACSequence(ArrayList<BookieSocketAddress> 
ensemble,
-                                                List<Integer> writeSet,
-                                                Map<BookieSocketAddress, Long> 
bookieFailureHistory);
+    public DistributionSchedule.WriteSet reorderReadLACSequence(
 
 Review comment:
   we could use 'void' as return type:
   we are changing the signature and we do not want client code to allocate 
WriteSet but we would like the given WriteSet to be modified.
   
   Anyway I am fine with this version.
   But I would like to know @ivankelly  and @sijie options

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