Fix direct load allocator tenant
This commit is contained in:
@ -30,6 +30,7 @@ ObDirectLoadMemDump::Context::Context()
|
||||
finished_sub_dump_count_(0),
|
||||
sub_dump_count_(0)
|
||||
{
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
}
|
||||
|
||||
ObDirectLoadMemDump::Context::~Context()
|
||||
|
||||
@ -14,7 +14,8 @@ namespace storage
|
||||
using namespace common;
|
||||
|
||||
ObDirectLoadMultipleHeapTableIndexScanMerge::ObDirectLoadMultipleHeapTableIndexScanMerge()
|
||||
: scanners_(nullptr),
|
||||
: allocator_("TLD_ScanMerge"),
|
||||
scanners_(nullptr),
|
||||
consumers_(nullptr),
|
||||
consumer_cnt_(0),
|
||||
simple_merge_(nullptr),
|
||||
@ -39,6 +40,7 @@ int ObDirectLoadMultipleHeapTableIndexScanMerge::init(
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid args", KR(ret), K(scanners.count()));
|
||||
} else {
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
if (scanners.count() > 1) {
|
||||
// init consumers
|
||||
if (OB_ISNULL(consumers_ = static_cast<int64_t *>(
|
||||
|
||||
@ -21,6 +21,7 @@ using namespace blocksstable;
|
||||
ObDirectLoadMultipleHeapTableSorter::ObDirectLoadMultipleHeapTableSorter(
|
||||
ObDirectLoadMemContext *mem_ctx)
|
||||
: mem_ctx_(mem_ctx),
|
||||
allocator_("TLD_Sorter"),
|
||||
extra_buf_(nullptr),
|
||||
index_dir_id_(-1),
|
||||
data_dir_id_(-1),
|
||||
@ -36,6 +37,7 @@ ObDirectLoadMultipleHeapTableSorter::~ObDirectLoadMultipleHeapTableSorter()
|
||||
int ObDirectLoadMultipleHeapTableSorter::init()
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
if (OB_ISNULL(extra_buf_ = static_cast<char *>(allocator_.alloc(mem_ctx_->table_data_desc_.extra_buf_size_)))) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
LOG_WARN("fail to allocate extra buf", KR(ret));
|
||||
|
||||
@ -40,6 +40,8 @@ ObDirectLoadMultipleSSTableCompactor::ObDirectLoadMultipleSSTableCompactor()
|
||||
data_block_count_(0),
|
||||
row_count_(0),
|
||||
max_data_block_size_(0),
|
||||
start_key_allocator_("TLD_SRowkey"),
|
||||
end_key_allocator_("TLD_ERowkey"),
|
||||
is_inited_(false)
|
||||
{
|
||||
}
|
||||
@ -59,6 +61,8 @@ int ObDirectLoadMultipleSSTableCompactor::init(const ObDirectLoadMultipleSSTable
|
||||
LOG_WARN("invalid args", KR(ret), K(param));
|
||||
} else {
|
||||
param_ = param;
|
||||
start_key_allocator_.set_tenant_id(MTL_ID());
|
||||
end_key_allocator_.set_tenant_id(MTL_ID());
|
||||
start_key_.set_min_rowkey();
|
||||
end_key_.set_min_rowkey();
|
||||
is_inited_ = true;
|
||||
|
||||
@ -39,7 +39,8 @@ bool ObDirectLoadMultipleSSTableScanMergeParam::is_valid() const
|
||||
*/
|
||||
|
||||
ObDirectLoadMultipleSSTableScanMerge::ObDirectLoadMultipleSSTableScanMerge()
|
||||
: datum_utils_(nullptr),
|
||||
: allocator_("TLD_ScanMerge"),
|
||||
datum_utils_(nullptr),
|
||||
dml_row_handler_(nullptr),
|
||||
range_(nullptr),
|
||||
consumers_(nullptr),
|
||||
@ -92,6 +93,7 @@ int ObDirectLoadMultipleSSTableScanMerge::init(
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid args", KR(ret), K(param), K(sstable_array), K(range));
|
||||
} else {
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
// construct scanners
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < sstable_array.count(); ++i) {
|
||||
ObDirectLoadMultipleSSTable *sstable = sstable_array.at(i);
|
||||
|
||||
@ -16,7 +16,8 @@ using namespace common;
|
||||
using namespace blocksstable;
|
||||
|
||||
ObDirectLoadMultipleSSTableScanner::ObDirectLoadMultipleSSTableScanner()
|
||||
: sstable_(nullptr),
|
||||
: allocator_("TLD_Scanner"),
|
||||
sstable_(nullptr),
|
||||
range_(nullptr),
|
||||
datum_utils_(nullptr),
|
||||
is_iter_start_(false),
|
||||
@ -48,6 +49,7 @@ int ObDirectLoadMultipleSSTableScanner::init(ObDirectLoadMultipleSSTable *sstabl
|
||||
table_data_desc_ = table_data_desc;
|
||||
range_ = ⦥
|
||||
datum_utils_ = datum_utils;
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
if (OB_FAIL(data_block_scanner_.init(sstable, table_data_desc, range, datum_utils))) {
|
||||
LOG_WARN("fail to init data block scanner", KR(ret));
|
||||
} else if (OB_FAIL(data_block_reader_.init(table_data_desc.sstable_data_block_size_,
|
||||
|
||||
@ -36,6 +36,7 @@ ObDirectLoadPartitionMergeTask::ObDirectLoadPartitionMergeTask()
|
||||
is_stop_(false),
|
||||
is_inited_(false)
|
||||
{
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
}
|
||||
|
||||
ObDirectLoadPartitionMergeTask::~ObDirectLoadPartitionMergeTask()
|
||||
@ -825,7 +826,8 @@ int ObDirectLoadPartitionHeapTableMultipleMergeTask::construct_row_iter(
|
||||
*/
|
||||
|
||||
ObDirectLoadPartitionHeapTableMultipleAggregateMergeTask::RowIterator::RowIterator()
|
||||
: origin_iter_(nullptr),
|
||||
: allocator_("TLD_RowIter"),
|
||||
origin_iter_(nullptr),
|
||||
rowkey_column_num_(0),
|
||||
store_column_count_(0),
|
||||
heap_table_array_(nullptr),
|
||||
@ -862,6 +864,7 @@ int ObDirectLoadPartitionHeapTableMultipleAggregateMergeTask::RowIterator::init(
|
||||
LOG_WARN("invalid args", KR(ret), K(merge_param), K(tablet_id), KP(origin_table),
|
||||
KP(heap_table_array));
|
||||
} else {
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
range_.set_whole_range();
|
||||
if (OB_FAIL(origin_table->scan(range_, allocator_, origin_iter_))) {
|
||||
LOG_WARN("fail to scan origin table", KR(ret));
|
||||
|
||||
@ -368,6 +368,7 @@ int ObDirectLoadSSTableRangeSplitter::init(const ObIArray<ObDirectLoadSSTable *>
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid args", KR(ret), K(sstable_array), KP(datum_utils));
|
||||
} else {
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
if (OB_FAIL(construct_rowkey_iters(sstable_array))) {
|
||||
LOG_WARN("fail to construct rowkey itres", KR(ret));
|
||||
} else if (OB_FAIL(
|
||||
@ -452,6 +453,7 @@ int ObDirectLoadMergeRangeSplitter::init(ObDirectLoadOriginTable *origin_table,
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid args", KR(ret), KPC(origin_table), K(sstable_array), KP(datum_utils));
|
||||
} else {
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
scan_range_.set_whole_range();
|
||||
if (OB_FAIL(construct_origin_table_rowkey_iter(origin_table))) {
|
||||
LOG_WARN("fail to construct origin sstable rowkey itre", KR(ret));
|
||||
@ -567,6 +569,7 @@ int ObDirectLoadMultipleMergeTabletRangeSplitter::init(
|
||||
K(table_data_desc), KP(datum_utils));
|
||||
} else {
|
||||
tablet_id_ = tablet_id;
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
scan_range_.set_whole_range();
|
||||
if (OB_FAIL(construct_origin_table_rowkey_iter(origin_table))) {
|
||||
LOG_WARN("fail to construct origin sstable rowkey itre", KR(ret));
|
||||
@ -1036,6 +1039,7 @@ int ObDirectLoadMultipleSSTableRangeSplitter::init(
|
||||
LOG_WARN("invalid args", KR(ret), K(sstable_array), K(table_data_desc), KP(datum_utils));
|
||||
} else {
|
||||
datum_utils_ = datum_utils;
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
if (OB_FAIL(construct_rowkey_iters(sstable_array, table_data_desc, datum_utils))) {
|
||||
LOG_WARN("fail to construct rowkey iters", KR(ret));
|
||||
} else if (OB_FAIL(compare_.init(*datum_utils))) {
|
||||
|
||||
@ -47,6 +47,7 @@ int ObDirectLoadSSTableBuilder::init(const ObDirectLoadSSTableBuildParam ¶m)
|
||||
const uint64_t tenant_id = MTL_ID();
|
||||
param_ = param;
|
||||
allocator_.set_tenant_id(tenant_id);
|
||||
rowkey_allocator_.set_tenant_id(tenant_id);
|
||||
start_key_.set_min_rowkey();
|
||||
end_key_.set_min_rowkey();
|
||||
int64_t dir_id = -1;
|
||||
|
||||
@ -36,7 +36,12 @@ bool ObDirectLoadSSTableCompactParam::is_valid() const
|
||||
*/
|
||||
|
||||
ObDirectLoadSSTableCompactor::ObDirectLoadSSTableCompactor()
|
||||
: index_item_count_(0), index_block_count_(0), row_count_(0), is_inited_(false)
|
||||
: index_item_count_(0),
|
||||
index_block_count_(0),
|
||||
row_count_(0),
|
||||
start_key_allocator_("TLD_SRowkey"),
|
||||
end_key_allocator_("TLD_ERowkey"),
|
||||
is_inited_(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -55,6 +60,8 @@ int ObDirectLoadSSTableCompactor::init(const ObDirectLoadSSTableCompactParam &pa
|
||||
LOG_WARN("invalid args", KR(ret), K(param));
|
||||
} else {
|
||||
param_ = param;
|
||||
start_key_allocator_.set_tenant_id(MTL_ID());
|
||||
end_key_allocator_.set_tenant_id(MTL_ID());
|
||||
start_key_.set_min_rowkey();
|
||||
end_key_.set_min_rowkey();
|
||||
is_inited_ = true;
|
||||
|
||||
@ -41,7 +41,8 @@ bool ObDirectLoadSSTableScanMergeParam::is_valid() const
|
||||
*/
|
||||
|
||||
ObDirectLoadSSTableScanMerge::ObDirectLoadSSTableScanMerge()
|
||||
: datum_utils_(nullptr),
|
||||
: allocator_("TLD_ScanMerge"),
|
||||
datum_utils_(nullptr),
|
||||
dml_row_handler_(nullptr),
|
||||
range_(nullptr),
|
||||
consumers_(nullptr),
|
||||
@ -97,6 +98,7 @@ int ObDirectLoadSSTableScanMerge::init(const ObDirectLoadSSTableScanMergeParam &
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid args", KR(ret), K(param), K(sstable_array), K(range));
|
||||
} else {
|
||||
allocator_.set_tenant_id(MTL_ID());
|
||||
// construct scanners
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < sstable_array.count(); ++i) {
|
||||
ObDirectLoadSSTable *sstable = sstable_array.at(i);
|
||||
|
||||
Reference in New Issue
Block a user