Remove auto and lambda
This commit is contained in:
@ -743,7 +743,7 @@ ObTmpTenantMacroBlockManager::~ObTmpTenantMacroBlockManager()
|
||||
int ObTmpTenantMacroBlockManager::init(common::ObIAllocator &allocator)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
auto attr = SET_USE_500(ObModIds::OB_TMP_BLOCK_MAP);
|
||||
ObMemAttr attr = SET_USE_500(ObModIds::OB_TMP_BLOCK_MAP);
|
||||
if (IS_INIT) {
|
||||
ret = OB_INIT_TWICE;
|
||||
STORAGE_LOG(WARN, "ObTmpMacroBlockManager has been inited", K(ret));
|
||||
@ -1564,7 +1564,7 @@ ObTmpFileStore::~ObTmpFileStore()
|
||||
int ObTmpFileStore::init()
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
auto attr = SET_USE_500(ObModIds::OB_TMP_FILE_STORE_MAP);
|
||||
ObMemAttr attr = SET_USE_500(ObModIds::OB_TMP_FILE_STORE_MAP);
|
||||
if (IS_INIT) {
|
||||
ret = OB_INIT_TWICE;
|
||||
STORAGE_LOG(WARN, "ObTmpFileStore has not been inited", K(ret));
|
||||
|
||||
@ -154,20 +154,10 @@ int ObDiskUsageReportTask::report_tenant_disk_usage(const char *svr_ip,
|
||||
// to reduce the locking time of the result_map_,
|
||||
// copy the value to array and then update the usage table,
|
||||
ObArray<hash::HashMapPair<ObDiskUsageReportKey, int64_t>> result_arr;
|
||||
ObFunction<int(const hash::HashMapPair<ObDiskUsageReportKey, int64_t> &pair)> copy_result =
|
||||
[&result_arr](const hash::HashMapPair<ObDiskUsageReportKey, int64_t> &pair) {
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_FAIL(result_arr.push_back(pair))) {
|
||||
STORAGE_LOG(WARN, "failed to push back pair", K(ret));
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
ObReportResultGetter copy_result(result_arr);
|
||||
|
||||
if (OB_FAIL(ret)) {
|
||||
// do nothing
|
||||
} else if (!copy_result.is_valid()) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
STORAGE_LOG(WARN, "copy_func invalid", K(ret));
|
||||
} else if (OB_FAIL(result_map_.foreach_refactored(copy_result))) {
|
||||
STORAGE_LOG(WARN, "fail to copy result", K(ret));
|
||||
}
|
||||
|
||||
@ -69,6 +69,27 @@ public:
|
||||
int get_data_disk_used_size(const uint64_t tenant_id, int64_t &used_size) const;
|
||||
int get_clog_disk_used_size(const uint64_t tenant_id, int64_t &used_size) const;
|
||||
|
||||
private:
|
||||
class ObReportResultGetter final
|
||||
{
|
||||
public:
|
||||
explicit ObReportResultGetter(ObArray<hash::HashMapPair<ObDiskUsageReportKey, int64_t>> &result_arr)
|
||||
: result_arr_(result_arr)
|
||||
{}
|
||||
~ObReportResultGetter() = default;
|
||||
int operator()(const hash::HashMapPair<ObDiskUsageReportKey, int64_t> &pair)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_FAIL(result_arr_.push_back(pair))) {
|
||||
STORAGE_LOG(WARN, "failed to push back pair", K(ret));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
private:
|
||||
ObArray<hash::HashMapPair<ObDiskUsageReportKey, int64_t>> &result_arr_;
|
||||
DISALLOW_COPY_AND_ASSIGN(ObReportResultGetter);
|
||||
};
|
||||
|
||||
private:
|
||||
int report_tenant_disk_usage(const char *svr_ip, const int32_t svr_port, const int64_t seq_num);
|
||||
int refresh_tenant_disk_usage();
|
||||
|
||||
Reference in New Issue
Block a user