Skip to content

Commit 5267a74

Browse files
authored
client_state is made public. get_logger() method is removed, log level is increased. (#1140)
1 parent 3ab833a commit 5267a74

File tree

4 files changed

+39
-25
lines changed

4 files changed

+39
-25
lines changed

hazelcast/include/hazelcast/client/connection/ClientConnectionManagerImpl.h

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ class HAZELCAST_API ClientConnectionManagerImpl
117117
void add_connection_listener(
118118
const std::shared_ptr<ConnectionListener>& connection_listener);
119119

120-
logger& get_logger();
121-
122120
std::shared_ptr<Connection> get_random_connection();
123121

124122
/**
@@ -160,23 +158,6 @@ class HAZELCAST_API ClientConnectionManagerImpl
160158

161159
void notify_backup(int64_t call_id);
162160

163-
private:
164-
static constexpr size_t EXECUTOR_CORE_POOL_SIZE = 10;
165-
static constexpr int32_t CLIENT = 1;
166-
static const endpoint_qualifier PUBLIC_ENDPOINT_QUALIFIER;
167-
static constexpr int SQL_CONNECTION_RANDOM_ATTEMPTS = 10;
168-
169-
struct auth_response
170-
{
171-
byte status;
172-
boost::uuids::uuid member_uuid;
173-
byte serialization_version;
174-
int32_t partition_count;
175-
boost::uuids::uuid cluster_id;
176-
boost::optional<address> server_address;
177-
std::string server_version;
178-
};
179-
180161
enum class client_state
181162
{
182163
/**
@@ -213,6 +194,23 @@ class HAZELCAST_API ClientConnectionManagerImpl
213194
friend std::ostream HAZELCAST_API& operator<<(std::ostream& os,
214195
client_state);
215196

197+
private:
198+
static constexpr size_t EXECUTOR_CORE_POOL_SIZE = 10;
199+
static constexpr int32_t CLIENT = 1;
200+
static const endpoint_qualifier PUBLIC_ENDPOINT_QUALIFIER;
201+
static constexpr int SQL_CONNECTION_RANDOM_ATTEMPTS = 10;
202+
203+
struct auth_response
204+
{
205+
byte status;
206+
boost::uuids::uuid member_uuid;
207+
byte serialization_version;
208+
int32_t partition_count;
209+
boost::uuids::uuid cluster_id;
210+
boost::optional<address> server_address;
211+
std::string server_version;
212+
};
213+
216214
auth_response authenticate_on_cluster(
217215
std::shared_ptr<Connection>& connection);
218216

hazelcast/src/hazelcast/client/network.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -674,12 +674,6 @@ ClientConnectionManagerImpl::~ClientConnectionManagerImpl()
674674
shutdown();
675675
}
676676

677-
logger&
678-
ClientConnectionManagerImpl::get_logger()
679-
{
680-
return client_.get_logger();
681-
}
682-
683677
void
684678
ClientConnectionManagerImpl::check_client_active()
685679
{

hazelcast/test/src/HazelcastTests8.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,6 +2571,27 @@ TEST_F(
25712571
EXPECT_THROW(connection_manager.get_or_connect(dummy_member),
25722572
exception::hazelcast_);
25732573
}
2574+
2575+
struct ClientStateOutput : ::testing::Test
2576+
{};
2577+
2578+
TEST_F(ClientStateOutput, test_output)
2579+
{
2580+
using client_state = connection::ClientConnectionManagerImpl::client_state;
2581+
2582+
auto to_string = [](client_state st){
2583+
std::stringstream ss;
2584+
2585+
ss << st;
2586+
2587+
return ss.str();
2588+
};
2589+
2590+
EXPECT_EQ(to_string(client_state::CONNECTED_TO_CLUSTER), "CONNECTED_TO_CLUSTER");
2591+
EXPECT_EQ(to_string(client_state::DISCONNECTED_FROM_CLUSTER), "DISCONNECTED_FROM_CLUSTER");
2592+
EXPECT_EQ(to_string(client_state::INITIAL), "INITIAL");
2593+
EXPECT_EQ(to_string(client_state::INITIALIZED_ON_CLUSTER), "INITIALIZED_ON_CLUSTER");
2594+
}
25742595
} // namespace test
25752596
} // namespace client
25762597
} // namespace hazelcast

hazelcast/test/src/compact/compact_test_base.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ class compact_test_base : public testing::Test
108108
client_config cfg;
109109

110110
cfg.set_cluster_name("compact-dev");
111+
cfg.get_logger_config().level(logger::level::finest);
111112

112113
return cfg;
113114
}

0 commit comments

Comments
 (0)