sijie commented on a change in pull request #641: Issue-596 Issue-583: Auto replication should honor ensemble placement policy URL: https://github.com/apache/bookkeeper/pull/641#discussion_r146352189
########## File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java ########## @@ -882,27 +941,74 @@ private void asyncRecoverLedgerFragment(final LedgerHandle lh, * - ledgerHandle * @param ledgerFragment * - LedgerFragment to replicate - * @param targetBookieAddress - * - target Bookie, to where entries should be replicated. */ public void replicateLedgerFragment(LedgerHandle lh, + final LedgerFragment ledgerFragment) + throws InterruptedException, BKException { + Optional<Set<BookieSocketAddress>> excludedBookies = Optional.empty(); + Map<Integer, BookieSocketAddress> targetBookieAddresses = + getReplacedBookiesByIndexes(lh, ledgerFragment.getEnsemble(), + ledgerFragment.getBookiesIndexes(), excludedBookies); + replicateLedgerFragment(lh, ledgerFragment, targetBookieAddresses); + } + + private void replicateLedgerFragment(LedgerHandle lh, final LedgerFragment ledgerFragment, - final BookieSocketAddress targetBookieAddress) + final Map<Integer, BookieSocketAddress> targetBookieAddresses) Review comment: yes, a fragment is a range of ledger entries. it is not per bookie. so when we replicate a fragment, it can be more efficient on replicating to multiple bookies. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services