pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] merlimat closed pull request #3145: [Pulsar Broker] Minor CleanUp and Fix Javadocs
Date Sat, 08 Dec 2018 23:03:33 GMT
merlimat closed pull request #3145: [Pulsar Broker] Minor CleanUp and Fix Javadocs
URL: https://github.com/apache/pulsar/pull/3145
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
index e2d2a818fa..d1f37c9dbd 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
@@ -358,7 +358,7 @@ private void createSampleNameSpace(URL webServiceUrl, String brokerServiceUrl,
S
         }
     }
 
-    /** this methods gets a buidler to use to build and an embedded pulsar instance `
+    /** This method gets a builder to build an embedded pulsar instance
      * i.e.
      * <pre>
      * <code>
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
index 37c4906efa..4f5bd7288f 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
@@ -549,7 +549,7 @@ private void startZkCacheService() throws PulsarServerException {
 
     private void startNamespaceService() throws PulsarServerException {
 
-        LOG.info("starting name space service, bootstrap namespaces=" + config.getBootstrapNamespaces());
+        LOG.info("Starting name space service, bootstrap namespaces=" + config.getBootstrapNamespaces());
 
         this.nsservice = getNamespaceServiceProvider().get();
     }
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LoadCalculator.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LoadCalculator.java
index e4955d63bb..e742c193a2 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LoadCalculator.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LoadCalculator.java
@@ -21,11 +21,9 @@
 /**
  * This interface class defines how we calculator the resource requirement per service unit
based on the
  * <code>ServiceRequest</code>
- * 
- * 
  */
 public interface LoadCalculator {
-    public ResourceDescription getResourceDescription(ServiceRequest srvRequest);
+    ResourceDescription getResourceDescription(ServiceRequest srvRequest);
 
-    public void recaliberateResourceUsagePerServiceUnit(LoadReport loadReport);
+    void recalibrateResourceUsagePerServiceUnit(LoadReport loadReport);
 }
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadCalculatorImpl.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadCalculatorImpl.java
index 8e343535ad..8998ea9cc2 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadCalculatorImpl.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadCalculatorImpl.java
@@ -18,26 +18,20 @@
  */
 package org.apache.pulsar.broker.loadbalance.impl;
 
-import java.util.Map;
-
 import org.apache.pulsar.broker.loadbalance.LoadCalculator;
 import org.apache.pulsar.broker.loadbalance.LoadReport;
 import org.apache.pulsar.broker.loadbalance.ResourceDescription;
 import org.apache.pulsar.broker.loadbalance.ServiceRequest;
 
-import com.google.common.collect.Maps;
-
 public class SimpleLoadCalculatorImpl implements LoadCalculator {
 
-    private final Map<String, Map<String, Integer>> resourceUsageCalibers = Maps.newHashMap();
-
     @Override
     public ResourceDescription getResourceDescription(ServiceRequest srvRequest) {
         return null;
     }
 
     @Override
-    public void recaliberateResourceUsagePerServiceUnit(LoadReport loadReport) {
+    public void recalibrateResourceUsagePerServiceUnit(LoadReport loadReport) {
         // Based on each load report, calculate the average resource required by each service
request characteristics
         // i.e. from the load report, we calculate that # of topics and # of consumers are
related to memory
         // usage, # of msg/s is counted toward NIC inbw and outbw and CPU, # of connections
are related to the # of
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java
index e6a62b0fb3..a2d2c08325 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java
@@ -37,14 +37,12 @@
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLongFieldUpdater;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.bookkeeper.common.util.OrderedExecutor;
 import org.apache.bookkeeper.mledger.Entry;
 import org.apache.bookkeeper.mledger.Position;
-import org.apache.bookkeeper.mledger.util.SafeRun;
 import org.apache.pulsar.broker.admin.AdminResource;
 import org.apache.pulsar.broker.service.BrokerService;
 import org.apache.pulsar.broker.service.BrokerServiceException;
@@ -292,17 +290,6 @@ private boolean hasLocalProducers() {
         return foundLocal.get();
     }
 
-    private boolean hasRemoteProducers() {
-        AtomicBoolean foundRemote = new AtomicBoolean(false);
-        producers.forEach(producer -> {
-            if (producer.isRemote()) {
-                foundRemote.set(true);
-            }
-        });
-
-        return foundRemote.get();
-    }
-
     @Override
     public void removeProducer(Producer producer) {
         checkArgument(producer.getTopic() == this);
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchConverter.java
b/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchConverter.java
index 7915688f07..9009ff9c58 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchConverter.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchConverter.java
@@ -41,11 +41,7 @@
 import org.apache.pulsar.common.compression.CompressionCodec;
 import org.apache.pulsar.common.compression.CompressionCodecProvider;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 public class RawBatchConverter {
-    private static final Logger log = LoggerFactory.getLogger(RawBatchConverter.class);
 
     public static boolean isReadableBatch(RawMessage msg) {
         ByteBuf payload = msg.getHeadersAndPayload();
@@ -93,7 +89,7 @@ public static boolean isReadableBatch(RawMessage msg) {
     }
 
     /**
-     * Take a batched message and a filter, and returns a message with the only the submessages
+     * Take a batched message and a filter, and returns a message with the only the sub-messages
      * which match the filter. Returns an empty optional if no messages match.
      *
      * This takes ownership of the passes in message, and if the returned optional is not
empty,
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundle.java
b/pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundle.java
index aac9aa0e37..11b29d89a4 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundle.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundle.java
@@ -77,7 +77,7 @@ public int compareTo(NamespaceBundle other) {
 
         try {
             /**
-             * <code>Range.insersection()</code> will throw <code>IllegalArgumentException</code>
when two ranges are
+             * <code>Range.intersection()</code> will throw <code>IllegalArgumentException</code>
when two ranges are
              * not connected at all, which is a OK case for our comparison. <code>checkState</code>
here is to ensure
              * that the two ranges we are comparing don't have overlaps.
              */
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java
index 54c51fcd39..78b591d2e8 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java
@@ -355,7 +355,7 @@ public void testResourceDescription() {
         assertTrue(rd1.calculateRank() > rd.calculateRank());
 
         SimpleLoadCalculatorImpl calc = new SimpleLoadCalculatorImpl();
-        calc.recaliberateResourceUsagePerServiceUnit(null);
+        calc.recalibrateResourceUsagePerServiceUnit(null);
         assertNull(calc.getResourceDescription(null));
 
     }
diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageIdImpl.java
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageIdImpl.java
index dd1b37dd33..f9125753a2 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageIdImpl.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageIdImpl.java
@@ -18,9 +18,6 @@
  */
 package org.apache.pulsar.client.impl;
 
-import static com.google.common.base.Preconditions.checkState;
-import static org.apache.pulsar.common.naming.TopicName.PARTITIONED_TOPIC_SUFFIX;
-
 import java.util.Objects;
 import org.apache.pulsar.client.api.MessageId;
 
diff --git a/pulsar-discovery-service/src/main/java/org/apache/pulsar/discovery/service/web/DiscoveryServiceServlet.java
b/pulsar-discovery-service/src/main/java/org/apache/pulsar/discovery/service/web/DiscoveryServiceServlet.java
index 5cd8749894..2b8eff342a 100644
--- a/pulsar-discovery-service/src/main/java/org/apache/pulsar/discovery/service/web/DiscoveryServiceServlet.java
+++ b/pulsar-discovery-service/src/main/java/org/apache/pulsar/discovery/service/web/DiscoveryServiceServlet.java
@@ -151,7 +151,7 @@ private void redirect(HttpServletRequest request, HttpServletResponse
response)
     }
 
     /**
-     * Find next broke url in round-robin
+     * Find next broker url in round-robin
      *
      * @return
      */
diff --git a/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperServerAspect.java
b/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperServerAspect.java
index b48a081382..4e027f9575 100644
--- a/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperServerAspect.java
+++ b/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperServerAspect.java
@@ -28,7 +28,7 @@
 import org.aspectj.lang.annotation.Pointcut;
 
 /**
- * Instruments ZooKeeperServer to enable stats reporting on data set and z-node sizess
+ * Instruments ZooKeeperServer to enable stats reporting on data set and z-node sizes
  */
 @Aspect
 public class ZooKeeperServerAspect {


 

----------------------------------------------------------------
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