[FEAT MERGE] system resource optimization

Co-authored-by: tushicheng <18829573815@163.com>
Co-authored-by: HaHaJeff <jeffzhouhhh@gmail.com>
Co-authored-by: dimstars <liangjinrongcm@gmail.com>
This commit is contained in:
obdev
2023-08-29 10:41:01 +00:00
committed by ob-robot
parent 7678a4a676
commit 81b8923b14
191 changed files with 2817 additions and 2464 deletions

View File

@ -155,7 +155,7 @@ class ObDedupQueue : public lib::ThreadPool
public:
static const int64_t TOTAL_LIMIT = 1024L * 1024L * 1024L;
static const int64_t HOLD_LIMIT = 512L * 1024L * 1024L;
static const int64_t PAGE_SIZE = common::OB_MALLOC_BIG_BLOCK_SIZE;
static const int64_t PAGE_SIZE = common::OB_MALLOC_MIDDLE_BLOCK_SIZE;
static const int64_t TASK_MAP_SIZE = 20L * 1000;
static const int64_t TASK_QUEUE_SIZE = 20L * 1000;
public:
@ -186,7 +186,7 @@ private:
HashAllocator;
typedef hash::ObHashMap<const IObDedupTask *,
IObDedupTask *,
hash::MultiWriteDefendMode,
hash::LatchReadWriteDefendMode,
hash::hash_func<const IObDedupTask *>,
hash::equal_to<const IObDedupTask *>,
HashAllocator,

View File

@ -77,14 +77,14 @@ public:
ret = OB_INVALID_ARGUMENT;
COMMON_LOG(ERROR, "timeout is invalid", K(ret), K(timeout_us));
} else {
auto key = sem_.get_key();
sem_.wait(key, timeout_us);
for(int i = 0; OB_ENTRY_NOT_EXIST == ret && i < PRIO_CNT; i++) {
if (OB_SUCCESS == queue_[i].pop(data)) {
ret = OB_SUCCESS;
}
}
if (OB_FAIL(ret)) {
auto key = sem_.get_key();
sem_.wait(key, timeout_us);
data = NULL;
} else {
(void)ATOMIC_FAA(&size_, -1);
@ -93,6 +93,18 @@ public:
return ret;
}
void destroy()
{
clear();
}
void clear()
{
ObLink* p = NULL;
while(OB_SUCCESS == pop(p, 0))
;
}
private:
SimpleCond sem_;
ObLinkQueue queue_[PRIO_CNT];