Skip to content

Commit 15aaa63

Browse files
committed
Rename back
1 parent 2bfef36 commit 15aaa63

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

lib/BinaryProtoLookupService.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ auto BinaryProtoLookupService::findBroker(const std::string& address, bool autho
4747
}
4848

4949
// NOTE: we can use move capture for topic since C++14
50-
cnxPool_.getRandomConnectionAsync(address).addListener([this, promise, topic, address, authoritative,
51-
redirectCount](
52-
Result result,
53-
const ClientConnectionWeakPtr& weakCnx) {
50+
cnxPool_.getConnectionAsync(address).addListener([this, promise, topic, address, authoritative,
51+
redirectCount](Result result,
52+
const ClientConnectionWeakPtr& weakCnx) {
5453
if (result != ResultOk) {
5554
promise->setFailed(result);
5655
return;
@@ -110,7 +109,7 @@ Future<Result, LookupDataResultPtr> BinaryProtoLookupService::getPartitionMetada
110109
}
111110
std::string lookupName = topicName->toString();
112111
const auto address = serviceNameResolver_.resolveHost();
113-
cnxPool_.getRandomConnectionAsync(address, address)
112+
cnxPool_.getConnectionAsync(address, address)
114113
.addListener(std::bind(&BinaryProtoLookupService::sendPartitionMetadataLookupRequest, this,
115114
lookupName, std::placeholders::_1, std::placeholders::_2, promise));
116115
return promise->getFuture();
@@ -163,7 +162,7 @@ Future<Result, NamespaceTopicsPtr> BinaryProtoLookupService::getTopicsOfNamespac
163162
return promise->getFuture();
164163
}
165164
std::string namespaceName = nsName->toString();
166-
cnxPool_.getRandomConnectionAsync(serviceNameResolver_.resolveHost())
165+
cnxPool_.getConnectionAsync(serviceNameResolver_.resolveHost())
167166
.addListener(std::bind(&BinaryProtoLookupService::sendGetTopicsOfNamespaceRequest, this,
168167
namespaceName, mode, std::placeholders::_1, std::placeholders::_2, promise));
169168
return promise->getFuture();
@@ -177,7 +176,7 @@ Future<Result, SchemaInfo> BinaryProtoLookupService::getSchema(const TopicNamePt
177176
promise->setFailed(ResultInvalidTopicName);
178177
return promise->getFuture();
179178
}
180-
cnxPool_.getRandomConnectionAsync(serviceNameResolver_.resolveHost())
179+
cnxPool_.getConnectionAsync(serviceNameResolver_.resolveHost())
181180
.addListener(std::bind(&BinaryProtoLookupService::sendGetSchemaRequest, this, topicName->toString(),
182181
version, std::placeholders::_1, std::placeholders::_2, promise));
183182

lib/ConnectionPool.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ class PULSAR_PUBLIC ConnectionPool {
7777
const std::string& physicalAddress,
7878
int keySuffix);
7979

80-
int generateRandomIndex() { return randomDistribution_(randomEngine_); }
81-
82-
Future<Result, ClientConnectionWeakPtr> getRandomConnectionAsync(const std::string& logicalAddress,
83-
const std::string& physicalAddress) {
80+
Future<Result, ClientConnectionWeakPtr> getConnectionAsync(const std::string& logicalAddress,
81+
const std::string& physicalAddress) {
8482
return getConnectionAsync(logicalAddress, physicalAddress, generateRandomIndex());
8583
}
8684

87-
Future<Result, ClientConnectionWeakPtr> getRandomConnectionAsync(const std::string& address) {
88-
return getRandomConnectionAsync(address, address);
85+
Future<Result, ClientConnectionWeakPtr> getConnectionAsync(const std::string& address) {
86+
return getConnectionAsync(address, address);
8987
}
9088

89+
int generateRandomIndex() { return randomDistribution_(randomEngine_); }
90+
9191
private:
9292
ClientConfiguration clientConfiguration_;
9393
ExecutorServiceProviderPtr executorProvider_;

0 commit comments

Comments
 (0)