reformat source code
according to code styles, 'AccessModifierOffset' should be -2.
This commit is contained in:
@ -27,7 +27,7 @@ class ObITransSubmitLogCb;
|
||||
}
|
||||
namespace unittest {
|
||||
class LogServiceSubmitTask {
|
||||
public:
|
||||
public:
|
||||
LogServiceSubmitTask() : cb_(NULL)
|
||||
{}
|
||||
~LogServiceSubmitTask()
|
||||
@ -49,13 +49,13 @@ class LogServiceSubmitTask {
|
||||
return partition_key_;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
transaction::ObITransSubmitLogCb* cb_;
|
||||
ObPartitionKey partition_key_;
|
||||
};
|
||||
|
||||
class MockObClogAdapter : public transaction::ObIClogAdapter, public ObSimpleThreadPool {
|
||||
public:
|
||||
public:
|
||||
MockObClogAdapter()
|
||||
{
|
||||
ObSimpleThreadPool::init(1, 10000);
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
namespace oceanbase {
|
||||
namespace unittest {
|
||||
class MockObElectionCallback : public election::ObIElectionCallback {
|
||||
public:
|
||||
public:
|
||||
int on_get_election_priority(election::ObElectionPriority& priority)
|
||||
{
|
||||
priority.set_candidate(true);
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace unittest {
|
||||
class MockObElectionMgr : public election::ObElectionMgr {
|
||||
public:
|
||||
public:
|
||||
int set_election_rpc(election::ObIElectionRpc* election_rpc)
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
@ -41,7 +41,7 @@ class MockObElectionMgr : public election::ObElectionMgr {
|
||||
return idx_;
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
common::ObAddr addr_;
|
||||
int64_t idx_;
|
||||
};
|
||||
|
||||
@ -26,7 +26,7 @@ using namespace election;
|
||||
using namespace common;
|
||||
namespace unittest {
|
||||
class ElectionRpcTask {
|
||||
public:
|
||||
public:
|
||||
ElectionRpcTask()
|
||||
{
|
||||
reset();
|
||||
@ -41,7 +41,7 @@ class ElectionRpcTask {
|
||||
timestamp_ = 0;
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
ObAddr server_;
|
||||
ObElectionMsgBuffer msgbuf_;
|
||||
ObPartitionKey partition_;
|
||||
@ -49,17 +49,17 @@ class ElectionRpcTask {
|
||||
};
|
||||
|
||||
class ElectionRpcTaskFactory {
|
||||
public:
|
||||
public:
|
||||
static ElectionRpcTask* alloc();
|
||||
static void release(ElectionRpcTask* task);
|
||||
|
||||
private:
|
||||
private:
|
||||
static int64_t alloc_count_;
|
||||
static int64_t release_count_;
|
||||
};
|
||||
|
||||
class MockObElectionRpc : public ObIElectionRpc, public common::ObSimpleThreadPool {
|
||||
public:
|
||||
public:
|
||||
MockObElectionRpc() : inited_(false), election_mgr_(NULL)
|
||||
{}
|
||||
~MockObElectionRpc()
|
||||
@ -99,7 +99,7 @@ class MockObElectionRpc : public ObIElectionRpc, public common::ObSimpleThreadPo
|
||||
int init(ObIElectionMgr* election_mgr, const ObAddr& self);
|
||||
void handle(void* task);
|
||||
|
||||
private:
|
||||
private:
|
||||
bool inited_;
|
||||
ObIElectionMgr* election_mgr_;
|
||||
};
|
||||
|
||||
@ -19,7 +19,7 @@ class ObIFreezeCb;
|
||||
}
|
||||
namespace unittest {
|
||||
class MockObFreezeTransCb : public storage::ObIFreezeCb {
|
||||
public:
|
||||
public:
|
||||
MockObFreezeTransCb()
|
||||
{}
|
||||
virtual ~MockObFreezeTransCb()
|
||||
|
||||
@ -27,19 +27,19 @@ using namespace common::hash;
|
||||
namespace share {
|
||||
|
||||
class MockObLocationCache : public ObIPartitionLocationCache {
|
||||
public:
|
||||
public:
|
||||
MockObLocationCache()
|
||||
{}
|
||||
virtual ~MockObLocationCache()
|
||||
{}
|
||||
int init();
|
||||
|
||||
public:
|
||||
public:
|
||||
int add(const ObPartitionKey& partition, const ObAddr& leader);
|
||||
int add_overwrite(const ObPartitionKey& partition, const ObAddr& leader);
|
||||
int remove(const ObPartitionKey& partition);
|
||||
|
||||
public:
|
||||
public:
|
||||
virtual ObIPartitionLocationCache::PartitionLocationCacheType get_type() const
|
||||
{
|
||||
return static_cast<ObIPartitionLocationCache::PartitionLocationCacheType>(PART_LOC_CACHE_TYPE_NORMAL);
|
||||
@ -115,10 +115,10 @@ class MockObLocationCache : public ObIPartitionLocationCache {
|
||||
return common::OB_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
static const int64_t BUCKET_NUM = 137;
|
||||
|
||||
private:
|
||||
private:
|
||||
ObHashMap<ObPartitionKey, ObAddr> partition_addr_map_;
|
||||
};
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ using namespace transaction;
|
||||
using namespace common;
|
||||
namespace unittest {
|
||||
class MockObTransRpc : public ObITransRpc, public common::ObSimpleThreadPool {
|
||||
public:
|
||||
public:
|
||||
MockObTransRpc() : is_inited_(false), trans_service_(NULL)
|
||||
{}
|
||||
~MockObTransRpc()
|
||||
@ -82,7 +82,7 @@ class MockObTransRpc : public ObITransRpc, public common::ObSimpleThreadPool {
|
||||
int init(ObTransService* trans_service, const ObAddr& self);
|
||||
void handle(void* task);
|
||||
|
||||
private:
|
||||
private:
|
||||
bool is_inited_;
|
||||
ObTransService* trans_service_;
|
||||
};
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
namespace oceanbase {
|
||||
namespace unittest {
|
||||
class MockObTransService : public transaction::ObTransService {
|
||||
public:
|
||||
public:
|
||||
int set_clog_adapter(transaction::ObIClogAdapter* clog_adapter)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -51,7 +51,7 @@ class MockObTransService : public transaction::ObTransService {
|
||||
return addr_;
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
ObAddr addr_;
|
||||
int64_t idx_;
|
||||
};
|
||||
|
||||
@ -40,11 +40,11 @@ namespace unittest {
|
||||
//};
|
||||
|
||||
class ObTransServiceCluster {
|
||||
public:
|
||||
public:
|
||||
ObTransServiceCluster();
|
||||
~ObTransServiceCluster();
|
||||
|
||||
public:
|
||||
public:
|
||||
bool is_inited()
|
||||
{
|
||||
return inited_;
|
||||
@ -56,7 +56,7 @@ class ObTransServiceCluster {
|
||||
int wait();
|
||||
int destroy();
|
||||
|
||||
public:
|
||||
public:
|
||||
ObTransRpcProxy* get_trans_proxy()
|
||||
{
|
||||
return &trans_proxy_;
|
||||
@ -91,7 +91,7 @@ class ObTransServiceCluster {
|
||||
const int64_t start_request_abort_time, const int64_t end_request_abort_time, const bool response_abort,
|
||||
const int64_t start_response_abort_time, const int64_t end_response_abort_time, const bool is_clear = true);
|
||||
|
||||
private:
|
||||
private:
|
||||
typedef common::hash::ObHashMap<common::ObAddr, common::ObPartitionLeaderArray> ObPartitionLeaderMap;
|
||||
int32_t get_scheduler_idx_()
|
||||
{
|
||||
@ -99,7 +99,7 @@ class ObTransServiceCluster {
|
||||
}
|
||||
int add_partition_(const ObPartitionKey& partition, const ObAddr& addr, ObPartitionLeaderMap& partition_leader_map);
|
||||
|
||||
private:
|
||||
private:
|
||||
int run_all_tests_(ObTransServiceCtx* trans_service_ctx);
|
||||
int run_local_single_partition_transaction_all_major_freeze_tests_(ObTransServiceCtx* trans_service_ctx);
|
||||
int run_local_single_partition_transaction_all_rpc_exp_tests_(ObTransServiceCtx* trans_service_ctx);
|
||||
@ -136,7 +136,7 @@ class ObTransServiceCluster {
|
||||
const bool is_local, const bool is_remote, const bool is_distributed, const bool is_rollback = false);
|
||||
int set_test_retry_end_trans(ObTransServiceCtx* trans_service_ctx, const bool test_retry_end_trans);
|
||||
|
||||
private:
|
||||
private:
|
||||
bool inited_;
|
||||
bool is_running_;
|
||||
bool is_add_partition_;
|
||||
|
||||
@ -42,16 +42,16 @@ using namespace obrpc;
|
||||
|
||||
namespace unittest {
|
||||
class ObTransServiceCtxThread : public share::ObThreadPool {
|
||||
public:
|
||||
public:
|
||||
int setThreadParameter(const int threadCount, void* arg);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
bool inited_;
|
||||
void* arg_;
|
||||
};
|
||||
|
||||
class ObTransServiceCtx : public ObITransRpc, public ObIElectionRpc {
|
||||
public:
|
||||
public:
|
||||
ObTransServiceCtx() : inited_(false), base_rpc_port_(0), scheduler_idx_(0), tenant_id_(0)
|
||||
{
|
||||
reset();
|
||||
@ -155,7 +155,7 @@ class ObTransServiceCtx : public ObITransRpc, public ObIElectionRpc {
|
||||
test_retry_end_trans_ = test_retry_end_trans;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
ObTransService* get_scheduler_()
|
||||
{
|
||||
return &txs_[scheduler_idx_];
|
||||
@ -168,17 +168,17 @@ class ObTransServiceCtx : public ObITransRpc, public ObIElectionRpc {
|
||||
int get_participant_(const ObAddr& addr, ObTransService*& participant);
|
||||
int check_major_freeze_(const int64_t msg_type, const ObPartitionKey& partition);
|
||||
|
||||
public:
|
||||
public:
|
||||
class ObGetLeaderThread : public ObTransServiceCtxThread {
|
||||
public:
|
||||
public:
|
||||
void run1();
|
||||
};
|
||||
class ObMajorfreezeThread : public ObTransServiceCtxThread {
|
||||
public:
|
||||
public:
|
||||
void run1();
|
||||
};
|
||||
|
||||
private:
|
||||
private:
|
||||
bool inited_;
|
||||
int32_t base_rpc_port_;
|
||||
char ip_[MAX_IP_ADDR_LENGTH];
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace oceanbase {
|
||||
namespace unittest {
|
||||
class ObTransMajorFreezeException {
|
||||
public:
|
||||
public:
|
||||
ObTransMajorFreezeException()
|
||||
{
|
||||
reset();
|
||||
@ -34,7 +34,7 @@ class ObTransMajorFreezeException {
|
||||
}
|
||||
TO_STRING_KV(K_(msg_type), K_(is_do_major_freeze), K_(partitions));
|
||||
|
||||
private:
|
||||
private:
|
||||
int64_t msg_type_;
|
||||
bool is_do_major_freeze_;
|
||||
common::ObPartitionArray partitions_;
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
namespace oceanbase {
|
||||
namespace unittest {
|
||||
class ObTransMsgException {
|
||||
public:
|
||||
public:
|
||||
ObTransMsgException()
|
||||
: inited_(false),
|
||||
request_abort_(false),
|
||||
@ -63,7 +63,7 @@ class ObTransMsgException {
|
||||
TO_STRING_KV(K_(request_abort), K_(start_request_abort_time), K_(end_request_abort_time), K_(response_abort),
|
||||
K_(start_response_abort_time), K_(end_response_abort_time));
|
||||
|
||||
public:
|
||||
public:
|
||||
bool inited_;
|
||||
bool request_abort_;
|
||||
bool response_abort_;
|
||||
@ -75,7 +75,7 @@ class ObTransMsgException {
|
||||
};
|
||||
|
||||
class ObTransRpcExecption {
|
||||
public:
|
||||
public:
|
||||
ObTransRpcExecption()
|
||||
{
|
||||
reset();
|
||||
@ -89,7 +89,7 @@ class ObTransRpcExecption {
|
||||
const int64_t end_request_abort_time, const bool response_abort, const int64_t start_response_abort_time,
|
||||
const int64_t end_response_abort_time);
|
||||
|
||||
public:
|
||||
public:
|
||||
ObTransMsgException commit_msg_exp_;
|
||||
ObTransMsgException abort_msg_exp_;
|
||||
ObTransMsgException stmt_create_ctx_msg_exp_;
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
namespace oceanbase {
|
||||
namespace unittest {
|
||||
class ObTransSwitchLeader {
|
||||
public:
|
||||
public:
|
||||
ObTransSwitchLeader() : partitions_(common::ObModIds::OB_TRANS_PARTITION_ARRAY)
|
||||
{
|
||||
reset();
|
||||
@ -55,7 +55,7 @@ class ObTransSwitchLeader {
|
||||
|
||||
TO_STRING_KV(K_(need_change), K_(change_back), K_(change_num), K_(partitions));
|
||||
|
||||
public:
|
||||
public:
|
||||
bool need_change_;
|
||||
bool change_back_;
|
||||
int64_t change_num_;
|
||||
@ -84,7 +84,7 @@ enum ObTransSwitchLeaderType {
|
||||
};
|
||||
|
||||
class ObTransSwitchLeaderException {
|
||||
public:
|
||||
public:
|
||||
ObTransSwitchLeaderException()
|
||||
{
|
||||
reset();
|
||||
@ -92,13 +92,13 @@ class ObTransSwitchLeaderException {
|
||||
virtual ~ObTransSwitchLeaderException()
|
||||
{}
|
||||
|
||||
public:
|
||||
public:
|
||||
void reset();
|
||||
ObTransSwitchLeader* get_switch_leader_exp(const int64_t type);
|
||||
int set_switch_leader(const int64_t type, const bool need_change, const bool change_back, const int64_t change_num);
|
||||
int set_switch_leader_partitions(const int64_t type, const common::ObPartitionArray& partitions);
|
||||
|
||||
public:
|
||||
public:
|
||||
ObTransSwitchLeader switch_leaders_[OB_SWITCH_LEADER_COUNT];
|
||||
};
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ enum ObTransServiceType {
|
||||
};
|
||||
|
||||
class ObTransServiceHandler {
|
||||
public:
|
||||
public:
|
||||
ObTransServiceHandler();
|
||||
~ObTransServiceHandler();
|
||||
|
||||
@ -42,17 +42,17 @@ class ObTransServiceHandler {
|
||||
|
||||
void* get_trans_service_ctx();
|
||||
|
||||
private:
|
||||
private:
|
||||
static void destroy_thread_key(void* ptr);
|
||||
int create_thread_key();
|
||||
int delete_thread_key();
|
||||
|
||||
public:
|
||||
public:
|
||||
pthread_key_t key_;
|
||||
};
|
||||
|
||||
class ObTransServiceThread : public share::ObThreadPool {
|
||||
public:
|
||||
public:
|
||||
ObTransServiceThread() : inited_(false)
|
||||
{}
|
||||
~ObTransServiceThread()
|
||||
@ -65,7 +65,7 @@ class ObTransServiceThread : public share::ObThreadPool {
|
||||
void* get_trans_service();
|
||||
void run1();
|
||||
|
||||
private:
|
||||
private:
|
||||
void* arg_;
|
||||
bool inited_;
|
||||
ObTransServiceHandler* chandler_;
|
||||
|
||||
Reference in New Issue
Block a user