You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2021/09/18 07:19:05 UTC
[pulsar] 02/04: [clean up] Remove unused variable and unneccessary
box in NamespaceBundleFactory (#11975)
This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 0b9d51bb49a9fb7a94ba5d38b52dc7ea287f7731
Author: Shoothzj <sh...@gmail.com>
AuthorDate: Fri Sep 10 11:56:35 2021 +0800
[clean up] Remove unused variable and unneccessary box in NamespaceBundleFactory (#11975)
Clean up. Remove unused variable and unneccessary box in NamespaceBundleFactory
(cherry picked from commit 7ff9c6e19e1bfcc6abd94f258d99e463c3c5f0df)
---
.../java/org/apache/pulsar/common/naming/NamespaceBundleFactory.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundleFactory.java b/pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundleFactory.java
index a62ea93..3e30148 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundleFactory.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundleFactory.java
@@ -92,7 +92,6 @@ public class NamespaceBundleFactory {
CompletableFuture<NamespaceBundles> future = new CompletableFuture<>();
// Read the static bundle data from the policies
pulsar.getLocalMetadataStore().get(path).thenAccept(result -> {
- NamespaceBundles namespaceBundles;
if (result.isPresent()) {
try {
@@ -276,9 +275,9 @@ public class NamespaceBundleFactory {
splitPartition = i;
Long maxVal = sourceBundle.partitions[i + 1];
Long minVal = sourceBundle.partitions[i];
- Long segSize = splitBoundary == null ? (maxVal - minVal) / numBundles : splitBoundary - minVal;
+ long segSize = splitBoundary == null ? (maxVal - minVal) / numBundles : splitBoundary - minVal;
partitions[pos++] = minVal;
- Long curPartition = minVal + segSize;
+ long curPartition = minVal + segSize;
for (int j = 0; j < numBundles - 1; j++) {
partitions[pos++] = curPartition;
curPartition += segSize;