pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] aahmed-se commented on a change in pull request #2080: Extract out common code from standalone and build Embedded Pulsar
Date Mon, 09 Jul 2018 22:46:55 GMT
aahmed-se commented on a change in pull request #2080: Extract out common code from standalone
and build Embedded Pulsar
URL: https://github.com/apache/incubator-pulsar/pull/2080#discussion_r201171034
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
 ##########
 @@ -0,0 +1,391 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar;
+
+import com.beust.jcommander.Parameter;
+import com.ea.agentloader.AgentLoader;
+import com.google.common.collect.Sets;
+import org.apache.pulsar.broker.PulsarService;
+import org.apache.pulsar.broker.ServiceConfiguration;
+import org.apache.pulsar.broker.ServiceConfigurationUtils;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.apache.pulsar.client.admin.PulsarAdminException;
+import org.apache.pulsar.common.naming.TopicName;
+import org.apache.pulsar.common.policies.data.ClusterData;
+import org.apache.pulsar.common.policies.data.TenantInfo;
+import org.apache.pulsar.functions.worker.WorkerConfig;
+import org.apache.pulsar.functions.worker.WorkerService;
+import org.apache.pulsar.zookeeper.LocalBookkeeperEnsemble;
+import org.aspectj.weaver.loadtime.Agent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.net.URL;
+import java.nio.file.Paths;
+import java.util.Optional;
+
+import static org.apache.commons.lang3.StringUtils.isBlank;
+
+public class PulsarStandalone {
+
+    private static final Logger log = LoggerFactory.getLogger(PulsarStandalone.class);
+
+    PulsarService broker;
+    PulsarAdmin admin;
+    LocalBookkeeperEnsemble bkEnsemble;
+    ServiceConfiguration config;
+    WorkerService fnWorkerService;
+
+    public void setBroker(PulsarService broker) {
+        this.broker = broker;
+    }
+
+    public void setAdmin(PulsarAdmin admin) {
+        this.admin = admin;
+    }
+
+    public void setBkEnsemble(LocalBookkeeperEnsemble bkEnsemble) {
+        this.bkEnsemble = bkEnsemble;
+    }
+
+    public void setBkPort(int bkPort) {
+        this.bkPort = bkPort;
+    }
+
+    public void setBkDir(String bkDir) {
+        this.bkDir = bkDir;
+    }
+
+    public void setAdvertisedAddress(String advertisedAddress) {
+        this.advertisedAddress = advertisedAddress;
+    }
+
+    public void setConfig(ServiceConfiguration config) {
+
+        this.config = config;
+    }
+
+    public void setFnWorkerService(WorkerService fnWorkerService) {
+        this.fnWorkerService = fnWorkerService;
+    }
+
+    public void setConfigFile(String configFile) {
+        this.configFile = configFile;
+    }
+
+    public void setWipeData(boolean wipeData) {
+        this.wipeData = wipeData;
+    }
+
+    public void setNumOfBk(int numOfBk) {
+        this.numOfBk = numOfBk;
+    }
+
+    public void setZkPort(int zkPort) {
+        this.zkPort = zkPort;
+    }
+
+    public void setZkDir(String zkDir) {
+        this.zkDir = zkDir;
+    }
+
+    public void setNoBroker(boolean noBroker) {
+        this.noBroker = noBroker;
+    }
+
+    public void setOnlyBroker(boolean onlyBroker) {
+        this.onlyBroker = onlyBroker;
+    }
+
+    public void setNoFunctionsWorker(boolean noFunctionsWorker) {
+        this.noFunctionsWorker = noFunctionsWorker;
+    }
+
+    public void setFnWorkerConfigFile(String fnWorkerConfigFile) {
+        this.fnWorkerConfigFile = fnWorkerConfigFile;
+    }
+
+    public void setNoStreamStorage(boolean noStreamStorage) {
+        this.noStreamStorage = noStreamStorage;
+    }
+
+    public void setStreamStoragePort(int streamStoragePort) {
+        this.streamStoragePort = streamStoragePort;
+    }
+
+    public void setHelp(boolean help) {
+        this.help = help;
+    }
+
+    public ServiceConfiguration getConfig() {
+        return config;
+    }
+
+    public String getConfigFile() {
+        return configFile;
+    }
+
+    public boolean isWipeData() {
+        return wipeData;
+    }
+
+    public int getNumOfBk() {
+        return numOfBk;
+    }
+
+    public int getZkPort() {
+        return zkPort;
+    }
+
+    public int getBkPort() {
+        return bkPort;
+    }
+
+    public String getZkDir() {
+        return zkDir;
+    }
+
+    public String getBkDir() {
+        return bkDir;
+    }
+
+    public boolean isNoBroker() {
+        return noBroker;
+    }
+
+    public boolean isOnlyBroker() {
+        return onlyBroker;
+    }
+
+    public boolean isNoFunctionsWorker() {
+        return noFunctionsWorker;
+    }
+
+    public String getFnWorkerConfigFile() {
+        return fnWorkerConfigFile;
+    }
+
+    public boolean isNoStreamStorage() {
+        return noStreamStorage;
+    }
+
+    public int getStreamStoragePort() {
+        return streamStoragePort;
+    }
+
+    public String getAdvertisedAddress() {
+        return advertisedAddress;
+    }
+
+    public boolean isHelp() {
+        return help;
+    }
+
+    @Parameter(names = { "-c", "--config" }, description = "Configuration file path", required
= true)
 
 Review comment:
   Don't know what be done right now, I haven't changed the annotations in this pr.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message