codingwangqi commented on a change in pull request #1640: Issue #1639: Etcd based metadata driver implementation URL: https://github.com/apache/bookkeeper/pull/1640#discussion_r218362794
########## File path: metadata-drivers/etcd/src/main/java/com/coreos/jetcd/internal/impl/EtcdConnectionManager.java ########## @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coreos.jetcd.internal.impl; + +import com.coreos.jetcd.Client; +import com.coreos.jetcd.api.WatchGrpc; +import lombok.extern.slf4j.Slf4j; + +/** + * Keep a reference to etcd internal connection manager. + */ +@Slf4j +public class EtcdConnectionManager { + + private final ClientImpl client; + private ClientConnectionManager connMgr; + + public EtcdConnectionManager(Client client) { + this((ClientImpl) client); + } + + EtcdConnectionManager(ClientImpl client) { Review comment: Currently the Etcd watcher implementation is synchronous implementation, although the underlying is asynchronous. Etcd team is working on an async implementation. so in order to get around, we have to intercept the `ClientImpl` to get the connection manager. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
