Skip to content

Commit

Permalink
[fix][build] Fix code style
Browse files Browse the repository at this point in the history
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
  • Loading branch information
nodece committed May 13, 2024
1 parent 6da3c15 commit f89fa72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import org.apache.pulsar.broker.admin.AdminResource;
import org.apache.pulsar.broker.loadbalance.LeaderBroker;
import org.apache.pulsar.broker.namespace.NamespaceService;
import org.apache.pulsar.broker.service.BrokerService;
import org.apache.pulsar.broker.service.Subscription;
import org.apache.pulsar.broker.service.Topic;
import org.apache.pulsar.broker.web.RestException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,8 @@ private CompletableFuture<Optional<Topic>> createNonPersistentTopic(String topic
if (log.isDebugEnabled()) {
log.debug("Broker is unable to load non-persistent topic {}", topic);
}
topicFuture.completeExceptionally(new NotAllowedException("Broker is not unable to load non-persistent topic"));
topicFuture.completeExceptionally(
new NotAllowedException("Broker is not unable to load non-persistent topic"));
return topicFuture;
}
final long topicCreateTimeMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,24 +322,21 @@ CompletableFuture<MessageId> internalSendAsync(Message<?> message) {
interceptorMessage.getProperties();
}

int msgSize = interceptorMessage.getDataBuffer().readableBytes();
sendAsync(interceptorMessage, new DefaultSendMessageCallback(future, interceptorMessage, msgSize));
sendAsync(interceptorMessage, new DefaultSendMessageCallback(future, interceptorMessage));
return future;
}

private class DefaultSendMessageCallback implements SendCallback {

CompletableFuture<MessageId> sendFuture;
MessageImpl<?> currentMsg;
int msgSize;
long createdAt = System.nanoTime();
SendCallback nextCallback = null;
MessageImpl<?> nextMsg = null;

DefaultSendMessageCallback(CompletableFuture<MessageId> sendFuture, MessageImpl<?> currentMsg, int msgSize) {
DefaultSendMessageCallback(CompletableFuture<MessageId> sendFuture, MessageImpl<?> currentMsg) {
this.sendFuture = sendFuture;
this.currentMsg = currentMsg;
this.msgSize = msgSize;
}

@Override
Expand Down

0 comments on commit f89fa72

Please sign in to comment.