sijie commented on a change in pull request #301: Issue-299
EnsemblePlacementPolicy in 4.5 is not compatible with 4.4 clients
URL: https://github.com/apache/bookkeeper/pull/301#discussion_r129650665
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/EnsemblePlacementPolicy.java
##########
@@ -107,7 +137,24 @@ public EnsemblePlacementPolicy
initialize(ClientConfiguration conf,
* @throws BKNotEnoughBookiesException
* @return the org.apache.bookkeeper.net.BookieSocketAddress
*/
- public BookieSocketAddress replaceBookie(int ensembleSize, int
writeQuorumSize, int ackQuorumSize, java.util.Map<String, byte[]>
customMetadata, Collection<BookieSocketAddress> currentEnsemble,
BookieSocketAddress bookieToReplace, Set<BookieSocketAddress> excludeBookies)
throws BKNotEnoughBookiesException;
+ public default BookieSocketAddress replaceBookie(int ensembleSize, int
writeQuorumSize, int ackQuorumSize,
+ java.util.Map<String, byte[]> customMetadata,
Collection<BookieSocketAddress> currentEnsemble,
+ BookieSocketAddress bookieToReplace, Set<BookieSocketAddress>
excludeBookies) throws BKNotEnoughBookiesException {
+ return replaceBookie(bookieToReplace, excludeBookies);
+ }
+
+ /**
+ * Legacy method introduce for compatibility with 4.4 clients
+ * @param bookieToReplace bookie to replace
+ * @param excludeBookies bookies that should not be considered as
candidate.
+ * @return the org.apache.bookkeeper.net.BookieSocketAddress
+ * @throws
org.apache.bookkeeper.client.BKException.BKNotEnoughBookiesException
+ * @see #replaceBookie(int, int, int, java.util.Map, java.util.Collection,
org.apache.bookkeeper.net.BookieSocketAddress, java.util.Set)
+ */
+ public default BookieSocketAddress replaceBookie(BookieSocketAddress
bookieToReplace,
Review comment:
same comment as above.
- the default behavior for the new method throws
UnsupportedOperationException
- the legacy method should call the new method by default.
----------------------------------------------------------------
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