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_r129649515
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/EnsemblePlacementPolicy.java
##########
@@ -89,7 +99,27 @@ public EnsemblePlacementPolicy
initialize(ClientConfiguration conf,
* @throws BKNotEnoughBookiesException if not enough bookies available.
* @return the
java.util.ArrayList<org.apache.bookkeeper.net.BookieSocketAddress>
*/
- public ArrayList<BookieSocketAddress> newEnsemble(int ensembleSize, int
writeQuorumSize, int ackQuorumSize, Map<String, byte[]> customMetadata,
Set<BookieSocketAddress> excludeBookies) throws BKNotEnoughBookiesException;
+ public default ArrayList<BookieSocketAddress> newEnsemble(int
ensembleSize, int writeQuorumSize,
+ int ackQuorumSize, Map<String, byte[]> customMetadata,
Set<BookieSocketAddress> excludeBookies) throws BKNotEnoughBookiesException {
+ return newEnsemble(ensembleSize, ackQuorumSize, excludeBookies);
+ }
+
+ /**
+ * Legacy method introduce for compatibility with 4.4 clients
+ * @param ensembleSize
+ * Ensemble Size
+ * @param quorumSize
+ * Quorum Size
+ * @param excludeBookies
+ * @return
+ * @throws
org.apache.bookkeeper.client.BKException.BKNotEnoughBookiesException
+ *
+ * @see #newEnsemble(int, int, int, java.util.Map, java.util.Set)
+ */
+ public default ArrayList<BookieSocketAddress> newEnsemble(int
ensembleSize, int quorumSize,
Review comment:
This is a legacy method for backward compatibility, so its default behavior
should be calling new overrided methods.
- you can throw UnsupportedException in #newEnsemble(ensmebleSize,
writeQuorumSize, ackQuorumSize, ...)
- set a default behavior for #newEnsemble(ensembleSize, quorumSize, ...) by
calling #newEnsemble(ensembleSize, quorumSize, quorumSize).
----------------------------------------------------------------
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