/Users/deen/code/yugabyte-db/src/yb/integration-tests/cql_test_base.h
Line | Count | Source |
1 | | // Copyright (c) YugaByte, Inc. |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
4 | | // in compliance with the License. You may obtain a copy of the License at |
5 | | // |
6 | | // http://www.apache.org/licenses/LICENSE-2.0 |
7 | | // |
8 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
9 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
10 | | // or implied. See the License for the specific language governing permissions and limitations |
11 | | // under the License. |
12 | | // |
13 | | |
14 | | #ifndef YB_INTEGRATION_TESTS_CQL_TEST_BASE_H |
15 | | #define YB_INTEGRATION_TESTS_CQL_TEST_BASE_H |
16 | | |
17 | | #include "yb/integration-tests/cql_test_util.h" |
18 | | #include "yb/integration-tests/mini_cluster.h" |
19 | | #include "yb/integration-tests/yb_mini_cluster_test_base.h" |
20 | | |
21 | | #include "yb/yql/cql/cqlserver/cql_server.h" |
22 | | |
23 | | namespace yb { |
24 | | |
25 | | template <class MiniClusterType> |
26 | | class CqlTestBase : public MiniClusterTestWithClient<MiniClusterType> { |
27 | | public: |
28 | | static constexpr auto kDefaultNumMasters = 1; |
29 | | static constexpr auto kDefaultNumTabletServers = 3; |
30 | | |
31 | 17 | virtual int num_masters() { |
32 | 17 | return kDefaultNumMasters; |
33 | 17 | } _ZN2yb11CqlTestBaseINS_11MiniClusterEE11num_mastersEv Line | Count | Source | 31 | 15 | virtual int num_masters() { | 32 | 15 | return kDefaultNumMasters; | 33 | 15 | } |
_ZN2yb11CqlTestBaseINS_19ExternalMiniClusterEE11num_mastersEv Line | Count | Source | 31 | 2 | virtual int num_masters() { | 32 | 2 | return kDefaultNumMasters; | 33 | 2 | } |
|
34 | | |
35 | 20 | virtual int num_tablet_servers() { |
36 | 20 | return kDefaultNumTabletServers; |
37 | 20 | } _ZN2yb11CqlTestBaseINS_11MiniClusterEE18num_tablet_serversEv Line | Count | Source | 35 | 18 | virtual int num_tablet_servers() { | 36 | 18 | return kDefaultNumTabletServers; | 37 | 18 | } |
_ZN2yb11CqlTestBaseINS_19ExternalMiniClusterEE18num_tablet_serversEv Line | Count | Source | 35 | 2 | virtual int num_tablet_servers() { | 36 | 2 | return kDefaultNumTabletServers; | 37 | 2 | } |
|
38 | | |
39 | | void SetUp() override; |
40 | | |
41 | | CHECKED_STATUS RestartCluster(); |
42 | | void ShutdownCluster(); |
43 | | CHECKED_STATUS StartCluster(); |
44 | | |
45 | | protected: |
46 | | void DoTearDown() override; |
47 | | |
48 | 18 | virtual void SetUpFlags() {} _ZN2yb11CqlTestBaseINS_11MiniClusterEE10SetUpFlagsEv Line | Count | Source | 48 | 18 | virtual void SetUpFlags() {} |
Unexecuted instantiation: _ZN2yb11CqlTestBaseINS_19ExternalMiniClusterEE10SetUpFlagsEv |
49 | | |
50 | | std::unique_ptr<CppCassandraDriver> driver_; |
51 | | std::unique_ptr<cqlserver::CQLServer> cql_server_; |
52 | | typename MiniClusterType::Options mini_cluster_opt_; |
53 | | |
54 | | private: |
55 | | void SetupClusterOpt(); |
56 | | CHECKED_STATUS StartCQLServer(); |
57 | | |
58 | | std::string cql_host_; |
59 | | uint16_t cql_port_ = 0; |
60 | | }; |
61 | | |
62 | | } // namespace yb |
63 | | |
64 | | #endif // YB_INTEGRATION_TESTS_CQL_TEST_BASE_H |