ivankelly commented on a change in pull request #657: DistributionSchedule uses
int[] rather than HashSet
URL: https://github.com/apache/bookkeeper/pull/657#discussion_r147659732
##########
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:
@eolivelli I think void would make it a little harder to use.
For example, in a lot of places we do
```
WriteSet reordered = policy.reorderReadSequnce(ensemble, failed,
schedule.getWriteSet(eid))
```
If reorder returned void, then we would need to first assign the write set
returned from getWriteSet to a variable and then pass it in.
----------------------------------------------------------------
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