Skip to content

Commit

Permalink
Fixed backporting errors and lombok license (apache#1752)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jai Asher authored May 9, 2018
1 parent 741174e commit 0093a80
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
19 changes: 19 additions & 0 deletions all/licenses/LICENSE-Lombok.txt
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions all/src/assemble/LICENSE.bin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -678,7 +683,7 @@ void splitAndOwnBundleOnceAndRetry(NamespaceBundle bundle,
unloadFuture.completeExceptionally(new ServiceUnitNotReadyException(msg1));
}
return;
}, pulsar.getOrderedExecutor());
});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 0093a80

Please sign in to comment.