You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by mm...@apache.org on 2021/12/12 17:05:18 UTC
[bookkeeper] branch master updated: ReplicationWorker should not try to create a ZK based LedgerManagerFactory (#2935)
This is an automated email from the ASF dual-hosted git repository.
mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 28de93d ReplicationWorker should not try to create a ZK based LedgerManagerFactory (#2935)
28de93d is described below
commit 28de93dd6a377ecf4d91ef54bf06a49c9bb956b5
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Sun Dec 12 09:05:12 2021 -0800
ReplicationWorker should not try to create a ZK based LedgerManagerFactory (#2935)
* ReplicationWorker should not try to create a ZK based LedgerManagerFactory
* Get the ledger factory from the bk client instead
* Removed unused imports
---
.../apache/bookkeeper/replication/ReplicationWorker.java | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java
index 524d07d..dacbe24 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java
@@ -25,12 +25,10 @@ import static org.apache.bookkeeper.replication.ReplicationStats.NUM_FULL_OR_PAR
import static org.apache.bookkeeper.replication.ReplicationStats.REPLICATE_EXCEPTION;
import static org.apache.bookkeeper.replication.ReplicationStats.REPLICATION_WORKER_SCOPE;
import static org.apache.bookkeeper.replication.ReplicationStats.REREPLICATE_OP;
-
import com.google.common.base.Stopwatch;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
-
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
@@ -46,7 +44,6 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiConsumer;
-
import org.apache.bookkeeper.bookie.BookieThread;
import org.apache.bookkeeper.client.BKException;
import org.apache.bookkeeper.client.BKException.BKNoSuchLedgerExistsOnMetadataServerException;
@@ -58,8 +55,6 @@ import org.apache.bookkeeper.client.LedgerFragment;
import org.apache.bookkeeper.client.LedgerHandle;
import org.apache.bookkeeper.client.api.LedgerMetadata;
import org.apache.bookkeeper.conf.ServerConfiguration;
-import org.apache.bookkeeper.meta.AbstractZkLedgerManagerFactory;
-import org.apache.bookkeeper.meta.LedgerManagerFactory;
import org.apache.bookkeeper.meta.LedgerUnderreplicationManager;
import org.apache.bookkeeper.net.BookieId;
import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.GenericCallback;
@@ -175,12 +170,8 @@ public class ReplicationWorker implements Runnable {
this.conf = conf;
this.bkc = bkc;
this.ownBkc = ownBkc;
- LedgerManagerFactory mFactory = AbstractZkLedgerManagerFactory
- .newLedgerManagerFactory(
- this.conf,
- bkc.getMetadataClientDriver().getLayoutManager());
- this.underreplicationManager = mFactory
- .newLedgerUnderreplicationManager();
+
+ this.underreplicationManager = bkc.getLedgerManagerFactory().newLedgerUnderreplicationManager();
this.admin = new BookKeeperAdmin(bkc, statsLogger);
this.ledgerChecker = new LedgerChecker(bkc);
this.workerThread = new BookieThread(this, "ReplicationWorker");