13 #include "nebula/client/Config.h"
14 #include "nebula/client/Connection.h"
15 #include "nebula/client/Session.h"
23 void init(
const std::vector<std::string> &addresses,
const Config &config);
27 Session getSession(
const std::string &username,
28 const std::string &password,
29 bool retryConnect =
true);
35 std::size_t size()
const {
36 std::lock_guard<std::mutex> l(lock_);
42 void newConnection(std::size_t cursor, std::size_t count);
44 std::size_t nextCursor() {
45 return cursor_ >= address_.size() ? cursor_ = 0 : cursor_++;
48 std::size_t cursor_{0};
50 std::vector<std::pair<std::string, int32_t>> address_;
53 mutable std::mutex lock_;
54 std::list<Connection> conns_;