in src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java [178:197]
public void connect() throws IOException {
connectionEstablishLock.lock();
try {
if (!isConnected) {
URI[] addresses = new URI[this.targets.length];
for (int i = 0; i < this.targets.length; i++) {
addresses[i] = URI.create("//" + this.targets[i]);
}
this.channel = ChannelManager.create(this.options.buildChannelManagerSettings(),
new DefaultChannelFactory(addresses, this.options));
streamServiceBlockingStub = StreamServiceGrpc.newBlockingStub(this.channel);
measureServiceBlockingStub = MeasureServiceGrpc.newBlockingStub(this.channel);
streamServiceStub = StreamServiceGrpc.newStub(this.channel);
measureServiceStub = MeasureServiceGrpc.newStub(this.channel);
isConnected = true;
}
} finally {
connectionEstablishLock.unlock();
}
}