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

@ -22,7 +22,7 @@ using namespace oceanbase::lib;
namespace oceanbase {
namespace common {
class TestIOStress : public lib::ThreadPool {
public:
public:
TestIOStress();
virtual ~TestIOStress();
int init(const ObDiskFd& fd, const int64_t file_size, const int32_t user_thread_cnt, const int32_t sys_thread_cnt,
@ -60,7 +60,7 @@ class TestIOStress : public lib::ThreadPool {
K(sys_iops_), K(user_io_size_), K(sys_io_size_), K(no_wait_), K(fail_count_), K(succeed_count_), K(user_io_cnt_),
K(user_io_rt_), K(sys_io_cnt_), K(sys_io_rt_));
private:
private:
ObDiskFd fd_;
int64_t file_size_;
int32_t user_thread_cnt_;
@ -74,7 +74,7 @@ class TestIOStress : public lib::ThreadPool {
int64_t succeed_count_;
bool no_wait_;
public:
public:
int64_t user_io_cnt_;
int64_t user_io_rt_;
int64_t sys_io_cnt_;

View File

@ -26,7 +26,7 @@ using namespace ::testing;
namespace oceanbase {
namespace common {
class TestDiskError : public ::testing::Test {
public:
public:
TestDiskError()
{}
virtual ~TestDiskError()
@ -41,7 +41,7 @@ class TestDiskError : public ::testing::Test {
virtual void set_no_wait();
virtual void set_io_size(const int64_t disk_index, const int64_t io_size);
protected:
protected:
static const int64_t DISK_CNT = 2;
int64_t file_size_;
char file_names_[DISK_CNT][128];

View File

@ -44,7 +44,7 @@ using namespace oceanbase::lib;
namespace oceanbase {
namespace unittest {
class TestIOBenchmark : public ::testing::Test {
public:
public:
virtual void SetUp();
virtual void TearDown();
};

View File

@ -30,7 +30,7 @@ using namespace ::testing;
namespace oceanbase {
namespace common {
class MockIOCallback : public ObIOCallback {
public:
public:
MockIOCallback()
{}
virtual ~MockIOCallback()
@ -44,14 +44,14 @@ class MockIOCallback : public ObIOCallback {
};
class TestIOManager : public ::testing::Test {
public:
public:
TestIOManager();
virtual ~TestIOManager();
virtual void SetUp();
virtual void TearDown();
virtual void do_multi_disk_test(const bool remove_disk_during_io_ongoing, const bool disk_hang = false);
protected:
protected:
ObDiskFd fd_;
char filename_[128];
int64_t file_size_;
@ -318,7 +318,7 @@ TEST(ObIOAllocator, simple)
}
class MyThreadPool : public lib::ThreadPool {
public:
public:
static MyThreadPool& get_ins()
{
static MyThreadPool ins;
@ -786,7 +786,7 @@ TEST_F(TestIOManager, add_delete)
}
class TestMemLeakIOCallback : public ObIOCallback {
public:
public:
TestMemLeakIOCallback() : buf_(NULL), allocator_(nullptr), buf_size_(0)
{}
virtual ~TestMemLeakIOCallback()
@ -835,7 +835,7 @@ class TestMemLeakIOCallback : public ObIOCallback {
}
TO_STRING_KV(KP_(buf));
public:
public:
char* buf_;
ObIAllocator* allocator_;
int64_t buf_size_;
@ -916,7 +916,7 @@ TEST_F(TestIOManager, enqueue_failed)
#endif
class TestIOCallback : public ObIOCallback {
public:
public:
TestIOCallback() : buf_(NULL), buf_size_(OB_MALLOC_NORMAL_BLOCK_SIZE + DIO_READ_ALIGN_SIZE), allocator_(NULL)
{}
virtual ~TestIOCallback()
@ -969,7 +969,7 @@ class TestIOCallback : public ObIOCallback {
}
TO_STRING_KV(KP_(buf));
public:
public:
char* buf_;
int64_t buf_size_;
ObArenaAllocator* allocator_;

View File

@ -20,7 +20,7 @@ namespace oceanbase {
namespace unittest {
class TestIOPerformance : public ::testing::Test {
public:
public:
virtual void SetUp()
{
COMMON_LOG(INFO, "start set up");
@ -44,7 +44,7 @@ TEST_F(TestIOPerformance, single)
}
class MPSC_ThreadPool : public lib::ThreadPool {
public:
public:
MPSC_ThreadPool() : inited_(false), is_lighty_(true)
{}
virtual ~MPSC_ThreadPool()
@ -55,11 +55,11 @@ class MPSC_ThreadPool : public lib::ThreadPool {
static const int64_t CONSUMER_COUNT = 1;
static const int64_t PRODUCE_INTERVAL_US = 100;
private:
private:
int produce();
int consume();
private:
private:
bool inited_;
ObLightyQueue lighty_queue_;
ObFixedQueue<int64_t> fixed_queue_;

View File

@ -20,7 +20,7 @@ namespace oceanbase {
namespace common {
struct IOWorkload {
public:
public:
IOWorkload() : category_(USER_IO), size_(0), iops_(0), depth_(0), is_sequence_(0)
{}
bool is_valid() const
@ -29,7 +29,7 @@ struct IOWorkload {
}
TO_STRING_KV(K_(category), K_(size), K_(iops), K_(depth), K_(is_sequence))
public:
public:
ObIOCategory category_;
int32_t size_;
int64_t iops_;
@ -40,7 +40,7 @@ struct IOWorkload {
class IOInfoGenerator {
friend struct IORunContext;
public:
public:
IOInfoGenerator() : inited_(false), mode_(IO_MODE_READ), io_category_(USER_IO), io_size_(0), is_sequence_(false)
{}
virtual ~IOInfoGenerator()
@ -52,7 +52,7 @@ class IOInfoGenerator {
virtual int get_io_info(const char* buf, ObIOInfo& info) = 0;
TO_STRING_KV(K_(inited), K_(mode), K_(io_category), K_(io_size), K_(is_sequence));
protected:
protected:
bool inited_;
ObIOMode mode_;
ObIOCategory io_category_;
@ -61,7 +61,7 @@ class IOInfoGenerator {
};
struct IORunContext {
public:
public:
IORunContext() : thread_cnt_(0), generator_(NULL), succ_cnt_(0), fail_cnt_(0), sum_rt_(0)
{}
TO_STRING_KV(K_(thread_cnt), K_(workload), K_(succ_cnt), K_(fail_cnt), KP_(generator), K_(sum_rt));
@ -73,7 +73,7 @@ struct IORunContext {
return bret;
}
public:
public:
int64_t thread_cnt_;
IOWorkload workload_;
IOInfoGenerator* generator_;
@ -83,7 +83,7 @@ struct IORunContext {
};
class IORunner : public lib::ThreadPool {
public:
public:
IORunner() : inited_(0), duration_ms_(0), begin_time_(0), end_time_(0){};
~IORunner()
{}
@ -95,14 +95,14 @@ class IORunner : public lib::ThreadPool {
}
TO_STRING_KV(K_(inited), K_(duration_ms), K_(read_ctx), K_(write_ctx), K_(begin_time), K_(end_time));
private:
private:
void run1() override;
int run_read();
int run_write(const char* data);
void print_result();
inline int64_t get_wait_interval(const int64_t iops, const int64_t thread_cnt, const int32_t io_depth);
private:
private:
bool inited_;
int64_t duration_ms_;
IORunContext read_ctx_;
@ -112,7 +112,7 @@ class IORunner : public lib::ThreadPool {
};
class SingleIOInfoGenerator : public IOInfoGenerator {
public:
public:
SingleIOInfoGenerator() : fd_(), file_size_(0), last_offset_(0)
{}
virtual ~SingleIOInfoGenerator()
@ -120,14 +120,14 @@ class SingleIOInfoGenerator : public IOInfoGenerator {
int init(const ObIOMode mode, const IOWorkload& workload, const ObDiskFd& fd, const int64_t file_size);
virtual int get_io_info(const char* buf, ObIOInfo& info) override;
private:
private:
ObDiskFd fd_;
int64_t file_size_;
int64_t last_offset_;
};
class MultiIOInfoGenerator : public IOInfoGenerator {
public:
public:
MultiIOInfoGenerator() : file_size_(0), last_offset_(0)
{}
virtual ~MultiIOInfoGenerator()
@ -135,14 +135,14 @@ class MultiIOInfoGenerator : public IOInfoGenerator {
int init(const ObIOMode mode, const IOWorkload& workload, const ObArray<ObDiskFd>& fds, const int64_t file_size);
virtual int get_io_info(const char* buf, ObIOInfo& info) override;
private:
private:
ObArray<ObDiskFd> fds_;
int64_t file_size_;
int64_t last_offset_;
};
class IOStress {
public:
public:
IOStress() : inited_(false), file_ready_(false), file_size_(0)
{}
~IOStress();
@ -151,14 +151,14 @@ class IOStress {
int run();
int prepare_files(const int64_t file_num, const int64_t file_size);
private:
private:
int prepare_one_file(const char* file_path, const int64_t file_size, int& fd);
void destroy_files();
int load_io_runner(FILE* config_file, IORunner& runner);
int get_info_generator(
const ObIOMode mode, const bool multi_disk, const IOWorkload& workload, IOInfoGenerator*& generator);
private:
private:
bool inited_;
bool file_ready_;
int64_t file_size_;