Skip to content

Commit d2e6875

Browse files
committed
fix checkstyle error
1 parent 90c24a1 commit d2e6875

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,11 +765,11 @@ public CompletableFuture<Optional<Long>> addProducer(Producer producer,
765765
return brokerService.checkTopicNsOwnership(getName())
766766
.thenCompose(__ ->
767767
incrementTopicEpochIfNeeded(producer, producerQueuedFuture))
768-
.thenCompose(producerEpoch ->
768+
.thenCompose(producerEpoch ->
769769
internalAddProducer(producer).thenApply(ignore -> {
770770
USAGE_COUNT_UPDATER.incrementAndGet(this);
771771
if (log.isDebugEnabled()) {
772-
log.debug("[{}] [{}] Added producer -- count: {}", topic, producer.getProducerName(),
772+
log.debug("[{}] [{}] Added producer -- count: {}", topic, producer.getProducerName(),
773773
USAGE_COUNT_UPDATER.get(this));
774774
}
775775
return producerEpoch;
@@ -963,7 +963,7 @@ protected CompletableFuture<Void> internalAddProducer(Producer producer) {
963963
log.warn("[{}] Attempting to add producer to a terminated topic", topic);
964964
throw new TopicTerminatedException("Topic was already terminated");
965965
}
966-
966+
967967
if (isSameAddressProducersExceeded(producer)) {
968968
log.warn("[{}] Attempting to add producer to topic which reached max same address producers limit",
969969
topic);

pulsar-broker/src/test/java/org/apache/pulsar/broker/service/AbstractTopicTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import static org.testng.Assert.assertEquals;
2727
import static org.testng.Assert.assertNotNull;
2828
import static org.testng.Assert.fail;
29-
import com.google.common.collect.ImmutableMap;
3029
import io.netty.channel.embedded.EmbeddedChannel;
30+
import java.util.Map;
3131
import java.util.Optional;
3232
import java.util.concurrent.CompletableFuture;
3333
import java.util.concurrent.CompletionException;
@@ -77,7 +77,7 @@ private Supplier<Pair<AbstractTopic, AbstractSubscription>> createProvider(
7777
}
7878
Topic topic = spy(topicOpt.get());
7979
AbstractSubscription subscription = mock(subscriptionClass);
80-
doReturn(ImmutableMap.of("subscription", subscription))
80+
doReturn(Map.of("subscription", subscription))
8181
.when(topic).getSubscriptions();
8282
return Pair.of((AbstractTopic) topic, subscription);
8383
};
@@ -127,7 +127,7 @@ public void testOverwriteOldProducerAfterTopicClosed(
127127

128128
// Add old producer
129129
topic.addProducer(oldProducer, new CompletableFuture<>()).join();
130-
130+
131131
CountDownLatch oldCnxCheckInvokedLatch = new CountDownLatch(1);
132132
CountDownLatch oldCnxCheckStartLatch = new CountDownLatch(1);
133133
doAnswer(invocation -> {
@@ -151,14 +151,14 @@ public void testOverwriteOldProducerAfterTopicClosed(
151151

152152
// Wait until new producer entered `AbstractTopic#tryOverwriteOldProducer`
153153
oldCnxCheckInvokedLatch.await();
154-
154+
155155
topic.close(true);
156156
// Run pending tasks to remove old producer from topic.
157157
((EmbeddedChannel) oldCnx.ctx().channel()).runPendingTasks();
158-
158+
159159
// Unblock ServerCnx#checkConnectionLiveness to resume `AbstractTopic#tryOverwriteOldProducer`
160160
oldCnxCheckStartLatch.countDown();
161-
161+
162162
// As topic is fenced, adding new producer should fail.
163163
try {
164164
producerEpoch.join();

0 commit comments

Comments
 (0)