You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/05/09 07:46:19 UTC

[GitHub] jai1 closed pull request #1752: Fixed backporting errors and lombok license

jai1 closed pull request #1752: Fixed backporting errors and lombok license
URL: https://github.com/apache/incubator-pulsar/pull/1752
 
 
   

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/all/licenses/LICENSE-Lombok.txt b/all/licenses/LICENSE-Lombok.txt
new file mode 100644
index 0000000000..5da7dbeff3
--- /dev/null
+++ b/all/licenses/LICENSE-Lombok.txt
@@ -0,0 +1,19 @@
+Copyright (C) 2009-2015 The Project Lombok Authors.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/all/src/assemble/LICENSE.bin.txt b/all/src/assemble/LICENSE.bin.txt
index 944ba2d1a6..b5e7db8707 100644
--- a/all/src/assemble/LICENSE.bin.txt
+++ b/all/src/assemble/LICENSE.bin.txt
@@ -348,6 +348,7 @@ BSD License
 MIT License
  * Java SemVer -- com.github.zafarkhaja-java-semver-*.jar -- licenses/LICENSE-SemVer.txt
  * SLF4J -- org.slf4j.*.jar -- licenses/LICENSE-SLF4J.txt
+ * Lombok -- org.projectlombok-*.jar  -- licenses/LICENSE-Lombok.txt
 
 Protocol Buffers License
  * Protocol Buffers -- com.google.protobuf-*.jar -- licenses/LICENSE-protobuf.txt
diff --git a/pom.xml b/pom.xml
index 16b1ecaaa6..9043897643 100644
--- a/pom.xml
+++ b/pom.xml
@@ -592,6 +592,13 @@ flexible messaging model and an intuitive client API.</description>
       <artifactId>powermock-module-testng</artifactId>
       <scope>test</scope>
     </dependency>
+
+    <dependency>
+      <groupId>org.projectlombok</groupId>
+      <artifactId>lombok</artifactId>
+      <version>1.16.20</version>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
index b8e4ae0e58..547f914a6c 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
@@ -42,6 +42,7 @@
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
+import org.apache.bookkeeper.util.SafeRunnable;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.pulsar.broker.PulsarServerException;
@@ -632,12 +633,16 @@ void splitAndOwnBundleOnceAndRetry(NamespaceBundle bundle,
 
         // If success updateNamespaceBundles, then do invalidateBundleCache and unload.
         // Else retry splitAndOwnBundleOnceAndRetry.
-        updateFuture.whenCompleteAsync((r, t)-> {
+        updateFuture.whenComplete((r, t)-> {
             if (t != null) {
                 // retry several times on BadVersion
                 if ((t instanceof ServerMetadataException) && (counter.decrementAndGet() >= 0)) {
-                    pulsar.getOrderedExecutor().submit(
-                        () -> splitAndOwnBundleOnceAndRetry(bundle, unload, counter, unloadFuture));
+                    pulsar.getOrderedExecutor().submit(new SafeRunnable() {
+                        @Override
+                        public void safeRun() {
+                            splitAndOwnBundleOnceAndRetry(bundle, unload, counter, unloadFuture);
+                        }
+                    });
                 } else {
                     // Retry enough, or meet other exception
                     String msg2 = format(" %s not success update nsBundles, counter %d, reason %s",
@@ -678,7 +683,7 @@ void splitAndOwnBundleOnceAndRetry(NamespaceBundle bundle,
                 unloadFuture.completeExceptionally(new ServiceUnitNotReadyException(msg1));
             }
             return;
-        }, pulsar.getOrderedExecutor());
+        });
     }
 
     /**
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java
index 3929c4855e..f7301edbd3 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java
@@ -924,7 +924,7 @@ public void testNamespaceSplitBundleConcurrent() throws Exception {
         // Force to create a topic
         final String namespace = "prop-xyz/use/ns1";
         final String topicName = (new StringBuilder("persistent://")).append(namespace).append("/ds2").toString();
-        Producer<byte[]> producer = pulsarClient.newProducer().topic(topicName).create();
+        Producer producer = pulsarClient.createProducer(topicName);
         producer.send("message".getBytes());
         publishMessagesOnPersistentTopic(topicName, 0);
         assertEquals(admin.persistentTopics().getList(namespace), Lists.newArrayList(topicName));


 

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