reformat source code
according to code styles, 'AccessModifierOffset' should be -2.
This commit is contained in:
@ -24,7 +24,7 @@ namespace common {
|
||||
class ObMemstoreAllocatorMgr;
|
||||
class ObActiveList;
|
||||
class ObFifoArena {
|
||||
public:
|
||||
public:
|
||||
static int64_t total_hold_;
|
||||
struct Page;
|
||||
struct Ref {
|
||||
@ -159,7 +159,7 @@ class ObFifoArena {
|
||||
int64_t allocated_;
|
||||
};
|
||||
|
||||
public:
|
||||
public:
|
||||
enum {
|
||||
MAX_CACHED_GROUP_COUNT = 16,
|
||||
MAX_CACHED_PAGE_COUNT = MAX_CACHED_GROUP_COUNT * Handle::MAX_NWAY,
|
||||
@ -183,7 +183,7 @@ class ObFifoArena {
|
||||
reset();
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
int init(uint64_t tenant_id);
|
||||
void reset();
|
||||
void update_nway_per_group(int64_t nway);
|
||||
@ -211,7 +211,7 @@ class ObFifoArena {
|
||||
void set_memstore_threshold(int64_t memstore_threshold);
|
||||
bool need_do_writing_throttle() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
ObQSync& get_qs()
|
||||
{
|
||||
static ObQSync s_qs;
|
||||
@ -227,7 +227,7 @@ class ObFifoArena {
|
||||
}
|
||||
|
||||
struct ObWriteThrottleInfo {
|
||||
public:
|
||||
public:
|
||||
ObWriteThrottleInfo()
|
||||
{
|
||||
reset();
|
||||
@ -241,7 +241,7 @@ class ObFifoArena {
|
||||
TO_STRING_KV(K(decay_factor_), K(alloc_duration_), K(trigger_percentage_), K(memstore_threshold_),
|
||||
K(period_throttled_count_), K(period_throttled_time_), K(total_throttled_count_), K(total_throttled_time_));
|
||||
|
||||
public:
|
||||
public:
|
||||
// control info
|
||||
double decay_factor_;
|
||||
int64_t alloc_duration_;
|
||||
@ -254,7 +254,7 @@ class ObFifoArena {
|
||||
int64_t total_throttled_time_;
|
||||
};
|
||||
|
||||
private:
|
||||
private:
|
||||
void release_ref(Ref* ref);
|
||||
Page* alloc_page(int64_t size);
|
||||
void free_page(Page* ptr);
|
||||
@ -267,7 +267,7 @@ class ObFifoArena {
|
||||
int64_t get_writing_throttling_trigger_percentage_() const;
|
||||
int64_t get_writing_throttling_maximum_duration_() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
static const int64_t MAX_WAIT_INTERVAL = 20 * 1000 * 1000; // 20s
|
||||
static const int64_t MEM_SLICE_SIZE = 2 * 1024 * 1024; // Bytes per usecond
|
||||
static const int64_t MIN_INTERVAL = 20000;
|
||||
|
||||
@ -32,7 +32,7 @@ struct FrozenMemstoreInfoLogger {
|
||||
int64_t pos_;
|
||||
};
|
||||
class ObGMemstoreAllocator {
|
||||
public:
|
||||
public:
|
||||
typedef ObSpinLock Lock;
|
||||
typedef ObSpinLockGuard LockGuard;
|
||||
typedef ObGMemstoreAllocator GAlloc;
|
||||
@ -42,7 +42,7 @@ class ObGMemstoreAllocator {
|
||||
typedef Arena::Handle ArenaHandle;
|
||||
|
||||
class AllocHandle : public ListHandle, public ObIAllocator {
|
||||
public:
|
||||
public:
|
||||
memtable::ObMemtable& mt_;
|
||||
GAlloc* host_;
|
||||
ArenaHandle arena_handle_;
|
||||
@ -118,17 +118,17 @@ class ObGMemstoreAllocator {
|
||||
}
|
||||
INHERIT_TO_STRING_KV("ListHandle", ListHandle, KP_(host), K_(arena_handle), K_(last_freeze_timestamp));
|
||||
|
||||
private:
|
||||
private:
|
||||
int64_t last_freeze_timestamp_;
|
||||
};
|
||||
|
||||
public:
|
||||
public:
|
||||
ObGMemstoreAllocator() : hlist_(), arena_(), last_freeze_timestamp_(0)
|
||||
{}
|
||||
~ObGMemstoreAllocator()
|
||||
{}
|
||||
|
||||
public:
|
||||
public:
|
||||
int init(uint64_t tenant_id)
|
||||
{
|
||||
update_last_freeze_timestamp();
|
||||
@ -150,7 +150,7 @@ class ObGMemstoreAllocator {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
int64_t get_mem_active_memstore_used()
|
||||
{
|
||||
int64_t hazard = hlist_.hazard();
|
||||
@ -169,7 +169,7 @@ class ObGMemstoreAllocator {
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
int set_memstore_threshold(uint64_t tenant_id);
|
||||
bool need_do_writing_throttle() const
|
||||
{
|
||||
@ -192,11 +192,11 @@ class ObGMemstoreAllocator {
|
||||
ATOMIC_STORE(&last_freeze_timestamp_, ObTimeUtility::current_time());
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
int64_t nway_per_group();
|
||||
int set_memstore_threshold_without_lock(uint64_t tenant_id);
|
||||
|
||||
private:
|
||||
private:
|
||||
Lock lock_;
|
||||
HandleList hlist_;
|
||||
Arena arena_;
|
||||
|
||||
@ -19,7 +19,7 @@ namespace oceanbase {
|
||||
namespace common {
|
||||
class ObFifoArena;
|
||||
class ObHandleList {
|
||||
public:
|
||||
public:
|
||||
typedef ObDLink DLink;
|
||||
struct DList {
|
||||
DLink head_;
|
||||
@ -163,18 +163,18 @@ class ObHandleList {
|
||||
return total_list_.next(iter);
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void set_frozen_(Handle& handle);
|
||||
int64_t alloc_id()
|
||||
{
|
||||
return ATOMIC_AAF(&id_, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
void update_hazard();
|
||||
int64_t calc_hazard();
|
||||
|
||||
private:
|
||||
private:
|
||||
int64_t id_;
|
||||
DList total_list_;
|
||||
DList active_list_;
|
||||
|
||||
@ -25,7 +25,7 @@ namespace common {
|
||||
class ObGMemstoreAllocator;
|
||||
|
||||
class ObMemstoreAllocatorMgr {
|
||||
public:
|
||||
public:
|
||||
typedef ObGMemstoreAllocator TAllocator;
|
||||
typedef common::hash::ObHashMap<uint64_t, TAllocator*> TenantMemostoreAllocatorMap;
|
||||
ObMemstoreAllocatorMgr();
|
||||
@ -35,13 +35,13 @@ class ObMemstoreAllocatorMgr {
|
||||
int64_t get_all_tenants_memstore_used();
|
||||
static ObMemstoreAllocatorMgr& get_instance();
|
||||
|
||||
public:
|
||||
public:
|
||||
void set_malloc_allocator(lib::ObMallocAllocator* malloc_allocator)
|
||||
{
|
||||
malloc_allocator_ = malloc_allocator;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
static const uint64_t PRESERVED_TENANT_COUNT = 10000;
|
||||
static const uint64_t ALLOCATOR_MAP_BUCKET_NUM = 64;
|
||||
bool is_inited_;
|
||||
@ -50,7 +50,7 @@ class ObMemstoreAllocatorMgr {
|
||||
lib::ObMallocAllocator* malloc_allocator_;
|
||||
int64_t all_tenants_memstore_used_;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObMemstoreAllocatorMgr);
|
||||
}; // end of class ObMemstoreAllocatorMgr
|
||||
|
||||
|
||||
@ -35,13 +35,13 @@ namespace oceanbase {
|
||||
namespace common {
|
||||
// Interface for Clog module
|
||||
class ObILogAllocator {
|
||||
public:
|
||||
public:
|
||||
ObILogAllocator()
|
||||
{}
|
||||
virtual ~ObILogAllocator()
|
||||
{}
|
||||
|
||||
public:
|
||||
public:
|
||||
virtual void* alloc_log_task_buf() = 0;
|
||||
virtual void free_log_task_buf(void* ptr) = 0;
|
||||
virtual void* ge_alloc(const int64_t size) = 0;
|
||||
@ -65,13 +65,13 @@ class ObILogAllocator {
|
||||
|
||||
// Interface for ReplayEngine module
|
||||
class ObIReplayTaskAllocator {
|
||||
public:
|
||||
public:
|
||||
ObIReplayTaskAllocator()
|
||||
{}
|
||||
virtual ~ObIReplayTaskAllocator()
|
||||
{}
|
||||
|
||||
public:
|
||||
public:
|
||||
virtual void* alloc_replay_task_buf(const bool is_inner_table, const int64_t size) = 0;
|
||||
virtual void free_replay_task(const bool is_inner_table, void* ptr) = 0;
|
||||
virtual bool can_alloc_replay_task(const bool is_inner_table, int64_t size) const = 0;
|
||||
@ -81,7 +81,7 @@ class ObIReplayTaskAllocator {
|
||||
};
|
||||
|
||||
class ObTenantMutilAllocator : public ObILogAllocator, public ObIReplayTaskAllocator, public common::ObLink {
|
||||
public:
|
||||
public:
|
||||
const int LOG_TASK_SIZE = sizeof(clog::ObLogTask);
|
||||
const int LOG_FLUSH_TASK_SIZE = sizeof(clog::ObLogFlushTask);
|
||||
const int LOG_FETCH_TASK_SIZE = sizeof(clog::ObFetchLogTask);
|
||||
@ -102,7 +102,7 @@ class ObTenantMutilAllocator : public ObILogAllocator, public ObIReplayTaskAlloc
|
||||
const int64_t INNER_TABLE_REPLAY_MEM_PERCENT = 20;
|
||||
static int choose_blk_size(int obj_size);
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObTenantMutilAllocator(uint64_t tenant_id)
|
||||
: tenant_id_(tenant_id),
|
||||
total_limit_(INT64_MAX),
|
||||
@ -200,7 +200,7 @@ class ObTenantMutilAllocator : public ObILogAllocator, public ObIReplayTaskAlloc
|
||||
void dec_pending_replay_mutator_size(int64_t size);
|
||||
int64_t get_pending_replay_mutator_size() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
uint64_t tenant_id_ CACHE_ALIGNED;
|
||||
int64_t total_limit_;
|
||||
int64_t log_task_alloc_count_;
|
||||
|
||||
@ -25,7 +25,7 @@ class ObIReplayTaskAllocator;
|
||||
class ObTenantMutilAllocator;
|
||||
|
||||
class ObTenantMutilAllocatorMgr {
|
||||
public:
|
||||
public:
|
||||
typedef ObTenantMutilAllocator TMA;
|
||||
ObTenantMutilAllocatorMgr()
|
||||
: is_inited_(false),
|
||||
@ -56,24 +56,24 @@ class ObTenantMutilAllocatorMgr {
|
||||
void free_log_task_buf(void* ptr);
|
||||
int update_tenant_mem_limit(const share::TenantUnits& all_tenant_units);
|
||||
|
||||
public:
|
||||
public:
|
||||
static ObTenantMutilAllocatorMgr& get_instance();
|
||||
|
||||
private:
|
||||
private:
|
||||
int construct_allocator_(const uint64_t tenant_id, TMA*& out_allocator);
|
||||
int create_tenant_mutil_allocator_(const uint64_t tenant_id, TMA*& out_allocator);
|
||||
|
||||
private:
|
||||
private:
|
||||
static const uint64_t PRESERVED_TENANT_COUNT = 10000;
|
||||
|
||||
private:
|
||||
private:
|
||||
bool is_inited_;
|
||||
obsys::CRWLock locks_[PRESERVED_TENANT_COUNT];
|
||||
ObTenantMutilAllocator* tma_array_[PRESERVED_TENANT_COUNT];
|
||||
ObBlockAllocMgr clog_body_blk_alloc_;
|
||||
ObVSliceAlloc clog_entry_alloc_;
|
||||
|
||||
private:
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObTenantMutilAllocatorMgr);
|
||||
}; // end of class ObTenantMutilAllocatorMgr
|
||||
|
||||
|
||||
Reference in New Issue
Block a user