Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chores: remove useless code in BinaryProtoLookupService #15350

Merged
merged 1 commit into from
Apr 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ private CompletableFuture<Pair<InetSocketAddress, InetSocketAddress>> findBroker
clientCnx.newLookup(request, requestId).whenComplete((r, t) -> {
if (t != null) {
// lookup failed
log.warn("[{}] failed to send lookup request : {}", topicName.toString(), t.getMessage());
log.warn("[{}] failed to send lookup request : {}", topicName, t.getMessage());
if (log.isDebugEnabled()) {
log.debug("[{}] Lookup response exception: {}", topicName.toString(), t);
log.debug("[{}] Lookup response exception: {}", topicName, t);
}

addressFuture.completeExceptionally(t);
Expand All @@ -145,11 +145,11 @@ private CompletableFuture<Pair<InetSocketAddress, InetSocketAddress>> findBroker
// lookup failed
if (redirectCount > 0) {
if (log.isDebugEnabled()) {
log.debug("[{}] lookup redirection failed ({}) : {}", topicName.toString(),
log.debug("[{}] lookup redirection failed ({}) : {}", topicName,
redirectCount, lookupException.getMessage());
}
} else {
log.warn("[{}] lookup failed : {}", topicName.toString(),
log.warn("[{}] lookup failed : {}", topicName,
lookupException.getMessage(), lookupException);
}
addressFuture.completeExceptionally(lookupException);
Expand All @@ -168,7 +168,7 @@ private CompletableFuture<Pair<InetSocketAddress, InetSocketAddress>> findBroker

} catch (Exception parseUrlException) {
// Failed to parse url
log.warn("[{}] invalid url {} : {}", topicName.toString(), uri, parseUrlException.getMessage(),
log.warn("[{}] invalid url {} : {}", topicName, uri, parseUrlException.getMessage(),
parseUrlException);
addressFuture.completeExceptionally(parseUrlException);
}
Expand All @@ -185,14 +185,14 @@ private CompletableFuture<Pair<InetSocketAddress, InetSocketAddress>> findBroker
private CompletableFuture<PartitionedTopicMetadata> getPartitionedTopicMetadata(InetSocketAddress socketAddress,
TopicName topicName) {

CompletableFuture<PartitionedTopicMetadata> partitionFuture = new CompletableFuture<PartitionedTopicMetadata>();
CompletableFuture<PartitionedTopicMetadata> partitionFuture = new CompletableFuture<>();

client.getCnxPool().getConnection(socketAddress).thenAccept(clientCnx -> {
long requestId = client.newRequestId();
ByteBuf request = Commands.newPartitionMetadataRequest(topicName.toString(), requestId);
clientCnx.newLookup(request, requestId).whenComplete((r, t) -> {
if (t != null) {
log.warn("[{}] failed to get Partitioned metadata : {}", topicName.toString(),
log.warn("[{}] failed to get Partitioned metadata : {}", topicName,
t.getMessage(), t);
partitionFuture.completeExceptionally(t);
} else {
Expand All @@ -202,7 +202,7 @@ private CompletableFuture<PartitionedTopicMetadata> getPartitionedTopicMetadata(
partitionFuture.completeExceptionally(new PulsarClientException.LookupException(
format("Failed to parse partition-response redirect=%s, topic=%s, partitions with %s,"
+ " error message %s",
r.redirect, topicName.toString(), r.partitions,
r.redirect, topicName, r.partitions,
e.getMessage())));
}
}
Expand Down Expand Up @@ -236,7 +236,7 @@ public CompletableFuture<Optional<SchemaInfo>> getSchema(TopicName topicName, by
Optional.ofNullable(BytesSchemaVersion.of(version)));
clientCnx.sendGetSchema(request, requestId).whenComplete((r, t) -> {
if (t != null) {
log.warn("[{}] failed to get schema : {}", topicName.toString(),
log.warn("[{}] failed to get schema : {}", topicName,
t.getMessage(), t);
schemaFuture.completeExceptionally(t);
} else {
Expand Down Expand Up @@ -293,7 +293,7 @@ private void getTopicsUnderNamespace(InetSocketAddress socketAddress,
} else {
if (log.isDebugEnabled()) {
log.debug("[namespace: {}] Success get topics list in request: {}",
namespace.toString(), requestId);
namespace, requestId);
}
// do not keep partition part of topic name
List<String> result = new ArrayList<>();
Expand Down