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/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new b549620  Remove unused zookeeper factory in function worker (#12605)
b549620 is described below

commit b5496202f5bddbf34de35148079f20c644d48429
Author: ZhangJian He <shoot...@gmail.com>
AuthorDate: Thu Nov 4 00:51:53 2021 +0800

    Remove unused zookeeper factory in function worker (#12605)
---
 .../apache/pulsar/functions/worker/PulsarWorkerService.java   |  5 ++---
 .../main/java/org/apache/pulsar/functions/worker/Worker.java  | 11 -----------
 .../org/apache/pulsar/functions/worker/WorkerService.java     |  2 +-
 3 files changed, 3 insertions(+), 15 deletions(-)

diff --git 
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/PulsarWorkerService.java
 
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/PulsarWorkerService.java
index 9c47dfe..29faa1e 100644
--- 
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/PulsarWorkerService.java
+++ 
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/PulsarWorkerService.java
@@ -305,7 +305,6 @@ public class PulsarWorkerService implements WorkerService {
         String tenant = a[0];
         String cluster = workerConfig.getPulsarFunctionsCluster();
 
-        int[] ar = null;
         /*
         multiple brokers may be trying to create the property, cluster, and 
namespace
         for function worker service this in parallel. The function worker 
service uses the namespace
@@ -500,7 +499,7 @@ public class PulsarWorkerService implements WorkerService {
             leaderService.start();
 
             // initialize function metadata manager
-            log.info("/** Initializing Metdata Manager **/");
+            log.info("/** Initializing Metadata Manager **/");
             functionMetaDataManager.initialize();
 
             // initialize function runtime manager
@@ -524,7 +523,7 @@ public class PulsarWorkerService implements WorkerService {
             functionAssignmentTailer.startFromMessage(lastAssignmentMessageId);
 
             // start function metadata manager
-            log.info("/** Starting Metdata Manager **/");
+            log.info("/** Starting Metadata Manager **/");
             functionMetaDataManager.start();
 
             // Starting cluster services
diff --git 
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/Worker.java
 
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/Worker.java
index df3ce76..929e62e 100644
--- 
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/Worker.java
+++ 
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/Worker.java
@@ -31,8 +31,6 @@ import 
org.apache.pulsar.common.configuration.PulsarConfigurationLoader;
 import org.apache.pulsar.functions.worker.rest.WorkerServer;
 import org.apache.pulsar.functions.worker.service.WorkerServiceLoader;
 import org.apache.pulsar.metadata.api.extended.MetadataStoreExtended;
-import org.apache.pulsar.zookeeper.ZooKeeperClientFactory;
-import org.apache.pulsar.zookeeper.ZookeeperBkClientFactoryImpl;
 
 @Slf4j
 public class Worker {
@@ -41,7 +39,6 @@ public class Worker {
     private final WorkerService workerService;
     private WorkerServer server;
 
-    private ZooKeeperClientFactory zkClientFactory = null;
     private final OrderedExecutor orderedExecutor = 
OrderedExecutor.newBuilder().numThreads(8).name("zk-cache-ordered").build();
     private PulsarResources pulsarResources;
     private MetadataStoreExtended configMetadataStore;
@@ -91,14 +88,6 @@ public class Worker {
         return new AuthenticationService(getServiceConfiguration());
     }
 
-    public ZooKeeperClientFactory getZooKeeperClientFactory() {
-        if (zkClientFactory == null) {
-            zkClientFactory = new 
ZookeeperBkClientFactoryImpl(orderedExecutor);
-        }
-        // Return default factory
-        return zkClientFactory;
-    }
-
     protected void stop() {
         try {
             if (null != this.server) {
diff --git 
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/WorkerService.java
 
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/WorkerService.java
index f76f753..3cc76c1 100644
--- 
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/WorkerService.java
+++ 
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/WorkerService.java
@@ -57,7 +57,7 @@ public interface WorkerService {
      *
      * @param brokerConfig broker config
      * @param workerConfig worker config
-     * @param PulsarResources configuration metadata-store
+     * @param pulsarResources configuration metadata-store
      * @param internalConf pulsar internal configuration data
      * @throws Exception when failed to initialize the worker service in 
broker.
      */

Reply via email to