reformat source code

according to code styles, 'AccessModifierOffset' should be -2.
This commit is contained in:
gm
2021-06-16 15:48:42 +08:00
committed by MizuhaHimuraki
parent 8c4a2f26a6
commit 4a92b6d7df
3314 changed files with 23131 additions and 23401 deletions

View File

@ -46,7 +46,7 @@ class ObIElectionCallback;
namespace election {
class MockObElectionMgr : public ObElectionMgr {
public:
public:
MockObElectionMgr()
{}
~MockObElectionMgr()
@ -93,7 +93,7 @@ class MockObElectionMgr : public ObElectionMgr {
return OB_SUCCESS;
}
public:
public:
int add_partition(
const common::ObPartitionKey& partition_key, const int64_t replica_num, ObIElectionCallback* election_cb)
{
@ -119,7 +119,7 @@ class MockObElectionMgr : public ObElectionMgr {
return OB_SUCCESS;
}
public:
public:
int handle_election_msg(const ObElectionMsgBuffer& msgbuf, obrpc::ObElectionRpcResult& result)
{
UNUSED(msgbuf);
@ -127,7 +127,7 @@ class MockObElectionMgr : public ObElectionMgr {
return OB_SUCCESS;
}
public:
public:
int set_candidate(const common::ObPartitionKey& partition_key, const common::ObMemberList& prev_mlist,
const common::ObMemberList& curr_mlist)
{
@ -164,7 +164,7 @@ class MockObElectionMgr : public ObElectionMgr {
return OB_SUCCESS;
}
private:
private:
ObIElection* get_election_(const common::ObPartitionKey& partition_key) const
{
UNUSED(partition_key);

View File

@ -27,10 +27,10 @@ class ObILogNetTask;
class ObConfirmedInfo;
class ObLogTask;
class MockObLogEngine : public ObILogEngine {
public:
public:
typedef ObDiskBufferTask FlushTask;
public:
public:
MockObLogEngine()
{}
~MockObLogEngine()
@ -554,7 +554,7 @@ class MockObLogEngine : public ObILogEngine {
return ret;
}
private:
private:
ObIndexInfoBlockHandler fake_handler_;
ObLogDir si_dir_;
ObLogDir ui_dir_;

View File

@ -32,13 +32,13 @@ class ObLogEntry;
class ObLogEntryHeader;
class MockObLogMembershipMgr : public ObILogMembershipMgr, public ObISubmitLogCb {
public:
public:
MockObLogMembershipMgr()
{}
virtual ~MockObLogMembershipMgr()
{}
public:
public:
int init(const common::ObMemberList& member_list, const int64_t membership_timestamp,
const uint64_t membership_log_id, const int64_t replica_num, const common::ObAddr& self,
const common::ObPartitionKey& partition_key, ObILogSWForMS* sw, ObILogStateMgrForMS* state_mgr,
@ -287,7 +287,7 @@ class MockObLogMembershipMgr : public ObILogMembershipMgr, public ObISubmitLogCb
return OB_SUCCESS;
}
private:
private:
common::ObMemberList member_list_;
common::ObProposalID ms_proposal_id_;
};

View File

@ -28,7 +28,7 @@ namespace clog {
class ObILogMembershipMgr;
class MockObLogReconfirm : public ObLogReconfirm {
public:
public:
MockObLogReconfirm()
{}
virtual ~MockObLogReconfirm()
@ -83,7 +83,7 @@ class MockObLogReconfirm : public ObLogReconfirm {
static const int64_t SUBMITED_TAG_BIT = 29;
static const int64_t LOG_EXIST_TAG_BIT = 28;
private:
private:
int init_reconfirm_()
{
return OB_SUCCESS;

View File

@ -19,20 +19,20 @@
namespace oceanbase {
namespace clog {
class MockObLogReplayEngineWrapper : public ObLogReplayEngineWrapper {
public:
public:
MockObLogReplayEngineWrapper()
{}
virtual ~MockObLogReplayEngineWrapper()
{}
public:
public:
int init(replayengine::ObILogReplayEngine* log_replay_engine)
{
UNUSED(log_replay_engine);
return OB_SUCCESS;
}
public:
public:
int submit_replay_task(const common::ObPartitionKey& partition_key, const ObLogEntry& log_entry)
{
UNUSED(partition_key);

View File

@ -31,7 +31,7 @@ class ObIOutOfBandLogHandler;
class ObILogStateMgrForSW;
class MockObSlidingCallBack : public ObILogTaskCallBack {
public:
public:
MockObSlidingCallBack()
{}
virtual ~MockObSlidingCallBack()

View File

@ -32,7 +32,7 @@ class ObILogCallbackEngine;
class ObILogAllocator;
class MockObLogStateMgr : public ObLogStateMgr {
public:
public:
MockObLogStateMgr()
{}
~MockObLogStateMgr()
@ -40,7 +40,7 @@ class MockObLogStateMgr : public ObLogStateMgr {
destroy();
}
public:
public:
int init(ObILogSWForStateMgr* sw, ObILogReconfirm* reconfirm, ObILogEngine* log_engine, ObILogMembershipMgr* mm,
election::ObIElectionMgr* election_mgr, ObILogReplayEngineWrapper* replay_engine, share::ObIPSCb* ps_cb,
ObILogAllocator* alloc_mgr, const common::ObAddr& self, const common::ObProposalID& proposal_id,

View File

@ -20,13 +20,13 @@
namespace oceanbase {
namespace common {
class MockObPSCb : public share::ObIPSCb {
public:
public:
MockObPSCb()
{}
virtual ~MockObPSCb()
{}
public:
public:
int64_t get_min_using_file_id() const
{
return 0;

View File

@ -17,13 +17,13 @@
namespace oceanbase {
namespace clog {
class MockObSubmitLogCb : public ObISubmitLogCb {
public:
public:
MockObSubmitLogCb()
{}
virtual ~MockObSubmitLogCb()
{}
public:
public:
int on_success(const common::ObPartitionKey& partition_key, const clog::ObLogType log_type, const uint64_t log_id,
const int64_t version, const bool batch_committed, const bool batch_last_succeed)
{

View File

@ -18,7 +18,7 @@
namespace oceanbase {
namespace clog {
class MockLogEngine : public MockObLogEngine {
public:
public:
MockLogEngine()
{}
virtual ~MockLogEngine()
@ -258,7 +258,7 @@ class MockLogEngine : public MockObLogEngine {
return 0;
}
private:
private:
ObIndexInfoBlockHandler fake_handler_;
};
} // namespace clog

View File

@ -21,7 +21,7 @@ namespace oceanbase {
using namespace clog;
namespace clog {
class MockFilePool : public IFilePool {
public:
public:
virtual int get_fid_range(int64_t& min_fid, int64_t& max_fid)
{
UNUSED(min_fid);
@ -37,7 +37,7 @@ class MockFilePool : public IFilePool {
};
class MockLogDirectReader : public ObILogDirectReader {
public:
public:
virtual int init(IFilePool* reader_pool)
{
UNUSED(reader_pool);
@ -70,7 +70,7 @@ class MockLogDirectReader : public ObILogDirectReader {
};
class MockRawLogIterator : public ObIRawLogIterator {
public:
public:
int init()
{
num_ = 0;
@ -175,7 +175,7 @@ class MockRawLogIterator : public ObIRawLogIterator {
return common::OB_SUCCESS;
}
private:
private:
int num_;
ObLogEntry log_entry1;
ObLogEntry log_entry2;

View File

@ -25,7 +25,7 @@ class ObILogAllocator;
}
namespace clog {
class MockPartitionLogService : public ObIPartitionLogService {
public:
public:
virtual int init(ObILogEngine* log_engine, ObLogReplayEngineWrapper* replay_engine,
ObIFetchLogEngine* fetch_log_engine, election::ObIElectionMgr* election_mgr,
storage::ObPartitionService* partition_mgr, ObILogCallbackEngine* cb_engine, common::ObILogAllocator* alloc_mgr,
@ -1502,7 +1502,7 @@ class MockPartitionLogService : public ObIPartitionLogService {
return OB_SUCCESS;
}
private:
private:
common::ObPartitionKey p_k_;
};

View File

@ -19,7 +19,7 @@
namespace oceanbase {
namespace clog {
class MockObRootServer : public ObIMembershipCallback {
public:
public:
struct MockRootTableNode {
int64_t mc_timestamp_;
common::ObMemberList pre_member_list_;
@ -61,7 +61,7 @@ class MockObRootServer : public ObIMembershipCallback {
}
};
public:
public:
MockObRootServer();
~MockObRootServer();
int init();
@ -73,7 +73,7 @@ class MockObRootServer : public ObIMembershipCallback {
int on_member_change_success(const common::ObPartitionKey& partition_key, const int64_t mc_timestamp,
const common::ObMemberList& prev_member_list, const common::ObMemberList& curr_member_list);
private:
private:
static const int64_t BUCKET_NUM = 1000;
static const int32_t MOD_ID = 789789;

View File

@ -20,11 +20,11 @@ namespace oceanbase {
using namespace clog;
namespace storage {
class MockObPartition : public storage::MockObIPartition {
public:
public:
MockObPartition() : valid_(false)
{}
public:
public:
int init(int32_t seed)
{
partition_key_.init(seed, seed, 1024);
@ -53,18 +53,18 @@ class MockObPartition : public storage::MockObIPartition {
return 0;
}
private:
private:
clog::MockPartitionLogService mock_pls_;
common::ObPartitionKey partition_key_;
bool valid_;
};
class MockObPartitionService : public storage::MockObIPartitionService {
public:
public:
MockObPartitionService() : list_(NULL)
{}
public:
public:
struct MockPartitionNode {
MockObPartition partition_;
MockPartitionNode* next_;
@ -77,7 +77,7 @@ class MockObPartitionService : public storage::MockObIPartitionService {
}
};
class MockObPartitionIter : public storage::ObIPartitionIterator {
public:
public:
MockObPartitionIter() : mgr_(NULL), curr_node_(NULL)
{}
MockObPartitionIter(ObPartitionService* mgr)
@ -106,12 +106,12 @@ class MockObPartitionService : public storage::MockObIPartitionService {
return ret;
}
private:
private:
MockObPartitionService* mgr_;
MockPartitionNode* curr_node_;
};
public:
public:
int create_partition(int32_t seed)
// int create_partition(common::ObMemberList &list, const ObPartitionKey &key, const int64_t replica_num)
{
@ -174,7 +174,7 @@ class MockObPartitionService : public storage::MockObIPartitionService {
return ret;
}
private:
private:
MockPartitionNode* list_;
DISALLOW_COPY_AND_ASSIGN(MockObPartitionService);

View File

@ -19,7 +19,7 @@ using namespace clog;
namespace unittest {
class ObLogReconfirmAccessor {
public:
public:
void set_assert_on(ObLogReconfirm& reconfirm, bool assert)
{
reconfirm.set_assert_on_ = assert;

View File

@ -47,7 +47,7 @@ struct Callable {
typedef void* (*pthread_handler_t)(void*);
class BaseWorker {
public:
public:
static const int64_t MAX_N_THREAD = 16;
struct WorkContext {
WorkContext() : callable_(NULL), idx_(0)
@ -65,7 +65,7 @@ class BaseWorker {
int64_t idx_;
};
public:
public:
BaseWorker() : n_thread_(0), thread_running_(false)
{}
~BaseWorker()
@ -73,7 +73,7 @@ class BaseWorker {
wait();
}
public:
public:
BaseWorker& set_thread_num(int64_t n)
{
n_thread_ = n;
@ -137,7 +137,7 @@ class BaseWorker {
return err;
}
protected:
protected:
int64_t n_thread_;
bool thread_running_;
WorkContext ctx_[MAX_N_THREAD];
@ -201,13 +201,13 @@ class RWT : public Callable {
int64_t idx_;
};
public:
public:
RWT() : n_read_thread_(0), n_write_thread_(0), n_admin_thread_(0)
{}
virtual ~RWT()
{}
public:
public:
int64_t get_thread_num()
{
return 1 + n_read_thread_ + n_write_thread_ + n_admin_thread_;
@ -283,7 +283,7 @@ class RWT : public Callable {
return 0;
}
protected:
protected:
int64_t n_read_thread_;
int64_t n_write_thread_;
int64_t n_admin_thread_;
@ -342,13 +342,13 @@ struct BaseConfig {
};
class FixedAllocator : public ObIAllocator {
public:
public:
FixedAllocator(char* buf, int64_t limit) : buf_(buf), limit_(limit), pos_(0)
{}
virtual ~FixedAllocator()
{}
public:
public:
void reset()
{
pos_ = 0;
@ -369,7 +369,7 @@ class FixedAllocator : public ObIAllocator {
UNUSED(ptr);
}
private:
private:
char* buf_;
int64_t limit_;
int64_t pos_;

View File

@ -38,7 +38,7 @@ using namespace oceanbase::lib;
namespace oceanbase {
namespace unittest {
class MyMetaInfoGenerator : public ObIInfoBlockHandler {
public:
public:
MyMetaInfoGenerator()
{}
virtual ~MyMetaInfoGenerator()
@ -78,7 +78,7 @@ int64_t MyMetaInfoGenerator::get_entry_cnt() const
}
class MyCLogItem : public ObICLogItem {
public:
public:
MyCLogItem() : buf_(NULL), data_len_(0), is_flushed_(false), file_id_(0), offset_(0), err_code_(0)
{
cond_.init(1);
@ -138,13 +138,13 @@ void MyCLogItem::wait()
}
class TestCLogWriter : public ::testing::Test {
public:
public:
TestCLogWriter();
virtual ~TestCLogWriter();
virtual void SetUp();
virtual void TearDown();
protected:
protected:
char log_path_[1024];
char shm_path_[1024];
char* log_buf_;

View File

@ -21,7 +21,7 @@ using namespace common;
using namespace clog;
namespace unittest {
class ObInfoBlockHandlerTest : public testing::Test {
public:
public:
static void SetUpTestCase()
{
EXPECT_EQ(OB_SUCCESS, commit_handler_.init());

View File

@ -21,7 +21,7 @@ class ObLogChecksum;
}
namespace unittest {
class TestObLogChecksum : public ::testing::Test {
protected:
protected:
void SetUp()
{
const uint64_t TABLE_ID = 520;
@ -32,7 +32,7 @@ class TestObLogChecksum : public ::testing::Test {
void TearDown()
{}
protected:
protected:
common::ObPartitionKey partition_key_;
clog::ObLogChecksum check_sum_;
};

View File

@ -25,12 +25,12 @@ namespace oceanbase {
namespace unittest {
class Runnable {
public:
public:
virtual ~Runnable()
{}
virtual void routine() = 0;
public:
public:
void run()
{
pthread_create(&thread_, NULL, pthread_routine_, this);
@ -40,7 +40,7 @@ class Runnable {
pthread_join(thread_, NULL);
}
private:
private:
static void* pthread_routine_(void* arg)
{
Runnable* runnable = static_cast<Runnable*>(arg);
@ -51,7 +51,7 @@ class Runnable {
};
class Data : public clog::ObILogExtRingBufferData {
public:
public:
virtual ~Data()
{}
virtual void destroy()
@ -75,7 +75,7 @@ class Data : public clog::ObILogExtRingBufferData {
};
class SetRunnable : public Runnable {
public:
public:
virtual void routine()
{
for (int64_t idx = 0; idx < cnt_; ++idx) {
@ -89,7 +89,7 @@ class SetRunnable : public Runnable {
int64_t cnt_;
};
class PopRunnable : public Runnable {
public:
public:
virtual void routine()
{
// int64_t begin_sn = -1;

View File

@ -23,7 +23,7 @@ namespace oceanbase {
using namespace common;
namespace clog {
class MockSlidingCallBack : public MockObSlidingCallBack {
public:
public:
MockSlidingCallBack() : err_no_(OB_SUCCESS)
{}
virtual ~MockSlidingCallBack()
@ -38,19 +38,19 @@ class MockSlidingCallBack : public MockObSlidingCallBack {
err_no_ = err_no;
}
private:
private:
int err_no_;
};
} // namespace clog
namespace unittest {
class ObLogTaskTest : public ::testing::Test {
protected:
protected:
ObLogTaskTest() : log_task_(NULL), alloc_mgr_(NULL)
{}
virtual ~ObLogTaskTest()
{}
protected:
protected:
virtual void SetUp()
{
const uint64_t TABLE_ID = 15;
@ -83,7 +83,7 @@ class ObLogTaskTest : public ::testing::Test {
alloc_mgr_ = NULL;
}
protected:
protected:
clog::ObLogTask* log_task_;
clog::MockSlidingCallBack mock_sliding_cb_;
common::ObTenantMutilAllocator* alloc_mgr_;

View File

@ -18,7 +18,7 @@ namespace oceanbase {
using namespace clog;
namespace unittest {
class TestObIndexEntry : public ::testing::Test {
public:
public:
virtual void SetUp();
virtual void TearDown()
{}
@ -28,7 +28,7 @@ class TestObIndexEntry : public ::testing::Test {
return index_;
}
private:
private:
ObIndexEntry index_;
ObPartitionKey partition_key_;

View File

@ -20,7 +20,7 @@ using namespace oceanbase::clog;
namespace oceanbase {
namespace unittest {
class TestObLogBlock : public ::testing::Test {
public:
public:
virtual void SetUp()
{
type = OB_DATA_BLOCK;

View File

@ -20,7 +20,7 @@ using namespace oceanbase::clog;
namespace oceanbase {
namespace unittest {
class TestObLogBlockMetaV2 : public ::testing::Test {
public:
public:
TestObLogBlockMetaV2()
{}
~TestObLogBlockMetaV2()

View File

@ -19,7 +19,7 @@ using namespace common;
using namespace clog;
namespace unittest {
class TestMockObLogMembershipMgr : public MockObLogMembershipMgr {
public:
public:
void set_replica_num(const int64_t replica_num)
{
replica_num_ = replica_num;
@ -37,13 +37,13 @@ class TestMockObLogMembershipMgr : public MockObLogMembershipMgr {
return member_list_;
}
private:
private:
int64_t replica_num_;
common::ObMemberList member_list_;
};
class ObLogBroadcastInfoMgrTest : public testing::Test {
public:
public:
void SetUp();
void TearDown();

View File

@ -26,13 +26,13 @@ using namespace clog;
namespace unittest {
class TestObLogDirectReader : public ::testing::Test {
public:
public:
TestObLogDirectReader();
virtual ~TestObLogDirectReader();
virtual void SetUp();
virtual void TearDown();
protected:
protected:
int fd_;
char log_path_[1024];
char shm_path_[1024];

View File

@ -22,7 +22,7 @@ namespace oceanbase {
using namespace clog;
namespace unittest {
class TestObLogEntry : public ::testing::Test {
public:
public:
virtual void SetUp()
{
ltype = OB_LOG_SUBMIT; // Test log type in normal case
@ -44,7 +44,7 @@ class TestObLogEntry : public ::testing::Test {
virtual void TearDown()
{}
public:
public:
static const int64_t BUFSIZE = 1 << 9; // 256B
ObLogEntryHeader header;
clog::ObLogEntry entry;

View File

@ -19,7 +19,7 @@ namespace oceanbase {
using namespace clog;
namespace unittest {
class TestObLogEntryHeader : public ::testing::Test {
public:
public:
virtual void SetUp()
{}
virtual void TearDown()

View File

@ -28,7 +28,7 @@ extern int64_t get_free_quota(const char* path, const int64_t percent, int64_t&
namespace unittest {
class ObFormatter {
public:
public:
ObFormatter(char* buf, int64_t len) : buf_(buf), len_(len), pos_(0)
{}
~ObFormatter()
@ -52,7 +52,7 @@ class ObFormatter {
return src;
}
private:
private:
char* buf_;
int64_t len_;
int64_t pos_;
@ -63,7 +63,7 @@ class ObFormatter {
#define MAX_FILE_ID 10
class TestObLogFilePool : public ::testing::Test {
public:
public:
virtual void SetUp()
{
char buf[BUFSIZE];
@ -89,11 +89,11 @@ class TestObLogFilePool : public ::testing::Test {
return ret;
}
protected:
protected:
};
class MyFunc {
public:
public:
MyFunc()
{}
~MyFunc()

View File

@ -21,7 +21,7 @@ namespace oceanbase {
namespace unittest {
class TestObLogFileTrailer : public ::testing::Test {
public:
public:
virtual void SetUp()
{}
virtual void TearDown()

View File

@ -27,7 +27,7 @@ namespace oceanbase {
using namespace clog;
namespace unittest {
class TestObRawLogIterator : public ::testing::Test {
public:
public:
virtual void SetUp();
virtual void TearDown();
void prepare_entry();

View File

@ -30,13 +30,13 @@ void init_env()
}
class TestSegArray : public ::testing::Test {
public:
public:
TestSegArray()
{}
virtual ~TestSegArray()
{}
private:
private:
DISALLOW_COPY_AND_ASSIGN(TestSegArray);
};