[BUG.FIX] split tenant memory for TabletMap and TmpFileCache label
This commit is contained in:
@ -160,7 +160,7 @@ class ObResourceMap
|
||||
public:
|
||||
ObResourceMap();
|
||||
virtual ~ObResourceMap();
|
||||
int init(const int64_t bucket_num, const uint64_t tenant_id, const char *label,
|
||||
int init(const int64_t bucket_num, const ObMemAttr &attr,
|
||||
const int64_t total_limit, const int64_t hold_limit, const int64_t page_size);
|
||||
template <typename Callback = ObResourceDefaultCallback<Key,Value>>
|
||||
int get(const Key &key, ObResourceHandle<Value> &handle, Callback callback = ObResourceDefaultCallback<Key, Value>());
|
||||
@ -205,14 +205,13 @@ ObResourceMap<Key, Value>::~ObResourceMap()
|
||||
template <typename Key, typename Value>
|
||||
int ObResourceMap<Key, Value>::init(
|
||||
const int64_t bucket_num,
|
||||
const uint64_t tenant_id,
|
||||
const char *label,
|
||||
const ObMemAttr &attr,
|
||||
const int64_t total_limit,
|
||||
const int64_t hold_limit,
|
||||
const int64_t page_size)
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
ObMemAttr attr = SET_USE_500(ObMemAttr(tenant_id, label));
|
||||
const uint64_t tenant_id = attr.tenant_id_;
|
||||
const int64_t bkt_num = common::hash::cal_next_prime(bucket_num);
|
||||
if (OB_UNLIKELY(is_inited_)) {
|
||||
ret = common::OB_INIT_TWICE;
|
||||
@ -235,7 +234,7 @@ int ObResourceMap<Key, Value>::init(
|
||||
} else {
|
||||
allocator_.set_attr(attr);
|
||||
is_inited_ = true;
|
||||
STORAGE_LOG(INFO, "init resource map success", K(ret), K(tenant_id), K(bkt_num));
|
||||
STORAGE_LOG(INFO, "init resource map success", K(ret), K(attr), K(bkt_num));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user