add task hash map to das ref
This commit is contained in:
@ -325,7 +325,7 @@ int ObTableLockOp::calc_tablet_loc(const ObLockCtDef &lock_ctdef,
|
||||
} else {
|
||||
//direct lock to storage
|
||||
tablet_loc = (MY_INPUT.get_tablet_loc() != nullptr ?
|
||||
MY_INPUT.get_tablet_loc() : MY_INPUT.get_table_loc()->tablet_locs_.get_first());
|
||||
MY_INPUT.get_tablet_loc() : MY_INPUT.get_table_loc()->get_first_tablet_loc());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -775,7 +775,7 @@ int ObTableModifyOp::calc_single_table_loc()
|
||||
K(table_loc_id), K(ref_table_id), K(das_ctx.get_table_loc_list()));
|
||||
} else {
|
||||
get_input()->table_loc_ = table_loc;
|
||||
get_input()->tablet_loc_ = table_loc->tablet_locs_.get_first();
|
||||
get_input()->tablet_loc_ = table_loc->get_first_tablet_loc();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
@ -170,11 +170,11 @@ int ObPxMultiPartDeleteOp::read_row(ObExecContext &ctx,
|
||||
if (NO_PARTITION_ID_FLAG == part_id_idx) {
|
||||
// 如果row中没有partition id expr对应的cell,默认partition id为0
|
||||
ObDASTableLoc *table_loc = del_rtdef_.das_rtdef_.table_loc_;
|
||||
if (OB_ISNULL(table_loc) || table_loc->tablet_locs_.size() != 1) {
|
||||
if (OB_ISNULL(table_loc) || table_loc->get_tablet_locs().size() != 1) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("insert table location is invalid", K(ret), KPC(table_loc));
|
||||
} else {
|
||||
tablet_id = table_loc->tablet_locs_.get_first()->tablet_id_;
|
||||
tablet_id = table_loc->get_first_tablet_loc()->tablet_id_;
|
||||
}
|
||||
} else if (child_->get_spec().output_.count() > part_id_idx) {
|
||||
ObExpr *expr = child_->get_spec().output_.at(part_id_idx);
|
||||
|
||||
@ -139,11 +139,11 @@ int ObPxMultiPartInsertOp::read_row(ObExecContext &ctx,
|
||||
row = &child_->get_spec().output_;
|
||||
if (NO_PARTITION_ID_FLAG == part_id_idx) {
|
||||
ObDASTableLoc *table_loc = ins_rtdef_.das_rtdef_.table_loc_;
|
||||
if (OB_ISNULL(table_loc) || table_loc->tablet_locs_.size() != 1) {
|
||||
if (OB_ISNULL(table_loc) || table_loc->get_tablet_locs().size() != 1) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("insert table location is invalid", K(ret), KPC(table_loc));
|
||||
} else {
|
||||
tablet_id = table_loc->tablet_locs_.get_first()->tablet_id_;
|
||||
tablet_id = table_loc->get_first_tablet_loc()->tablet_id_;
|
||||
}
|
||||
} else if (child_->get_spec().output_.count() > part_id_idx) {
|
||||
ObExpr *expr = child_->get_spec().output_.at(part_id_idx);
|
||||
|
||||
@ -141,11 +141,11 @@ int ObPxMultiPartUpdateOp::read_row(ObExecContext &ctx,
|
||||
row = &child_->get_spec().output_;
|
||||
if (NO_PARTITION_ID_FLAG == part_id_idx) {
|
||||
ObDASTableLoc *table_loc = upd_rtdef_.dupd_rtdef_.table_loc_;
|
||||
if (OB_ISNULL(table_loc) || table_loc->tablet_locs_.size() != 1) {
|
||||
if (OB_ISNULL(table_loc) || table_loc->get_tablet_locs().size() != 1) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("insert table location is invalid", K(ret), KPC(table_loc));
|
||||
} else {
|
||||
tablet_id = table_loc->tablet_locs_.get_first()->tablet_id_;
|
||||
tablet_id = table_loc->get_first_tablet_loc()->tablet_id_;
|
||||
}
|
||||
} else if (child_->get_spec().output_.count() > part_id_idx) {
|
||||
ObExpr *expr = child_->get_spec().output_.at(part_id_idx);
|
||||
|
||||
@ -54,11 +54,11 @@ int ObPxMultiPartSSTableInsertOp::get_tablet_id_from_row(const ObExprPtrIArray &
|
||||
tablet_id.reset();
|
||||
if (NO_PARTITION_ID_FLAG == part_id_idx) {
|
||||
ObDASTableLoc *table_loc = ins_rtdef_.das_rtdef_.table_loc_;
|
||||
if (OB_ISNULL(table_loc) || table_loc->tablet_locs_.size() != 1) {
|
||||
if (OB_ISNULL(table_loc) || table_loc->get_tablet_locs().size() != 1) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("insert table location is invalid", K(ret), KPC(table_loc));
|
||||
} else {
|
||||
tablet_id = table_loc->tablet_locs_.get_first()->tablet_id_;
|
||||
tablet_id = table_loc->get_first_tablet_loc()->tablet_id_;
|
||||
}
|
||||
} else if (part_id_idx < 0) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
|
||||
@ -885,7 +885,8 @@ int ObPxSubCoord::rebuild_sqc_access_table_locations()
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected table loc", K(ret));
|
||||
} else {
|
||||
FOREACH(tmp_node, table_loc->tablet_locs_) {
|
||||
for (DASTabletLocListIter tmp_node = table_loc->tablet_locs_begin();
|
||||
tmp_node != table_loc->tablet_locs_end(); ++tmp_node) {
|
||||
ObDASTabletLoc *tablet_loc = *tmp_node;
|
||||
if (tablet_loc->tablet_id_ == location_keys.at(i).tablet_id_) {
|
||||
if (OB_FAIL(access_locations.push_back(tablet_loc))) {
|
||||
|
||||
@ -189,7 +189,7 @@ int ObPXServerAddrUtil::alloc_by_data_distribution_inner(
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("fail to get phy table location", K(ret));
|
||||
} else {
|
||||
const DASTabletLocList &locations = table_loc->tablet_locs_;
|
||||
const DASTabletLocList &locations = table_loc->get_tablet_locs();
|
||||
if (locations.size() <= 0) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("the location array is empty", K(locations.size()), K(ret));
|
||||
@ -511,7 +511,8 @@ int ObPXServerAddrUtil::alloc_by_random_distribution(ObExecContext &exec_ctx,
|
||||
DASTabletLocArray locations;
|
||||
FOREACH_X(tmp_node, table_locs, OB_SUCC(ret)) {
|
||||
ObDASTableLoc *table_loc = *tmp_node;
|
||||
FOREACH_X(tablet_node, table_loc->tablet_locs_, OB_SUCC(ret)) {
|
||||
for (DASTabletLocListIter tablet_node = table_loc->tablet_locs_begin();
|
||||
OB_SUCC(ret) && tablet_node != table_loc->tablet_locs_end(); ++tablet_node) {
|
||||
OZ(locations.push_back(*tablet_node));
|
||||
}
|
||||
}
|
||||
@ -792,7 +793,7 @@ int ObPXServerAddrUtil::set_sqcs_accessed_location(ObExecContext &ctx,
|
||||
int ret = OB_SUCCESS;
|
||||
common::ObArray<ObPxSqcMeta *> sqcs;
|
||||
int n_locations = 0;
|
||||
const DASTabletLocList &locations = table_loc->tablet_locs_;
|
||||
const DASTabletLocList &locations = table_loc->get_tablet_locs();
|
||||
DASTabletLocSEArray temp_locations;
|
||||
if (OB_ISNULL(table_loc) || OB_ISNULL(phy_op)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
|
||||
@ -690,7 +690,8 @@ int ObTableScanOp::prepare_das_task()
|
||||
}
|
||||
} else if (OB_LIKELY(nullptr == MY_CTDEF.das_dppr_tbl_)) {
|
||||
ObDASTableLoc *table_loc = tsc_rtdef_.scan_rtdef_.table_loc_;
|
||||
FOREACH_X(node, table_loc->tablet_locs_, OB_SUCC(ret)) {
|
||||
for (DASTabletLocListIter node = table_loc->tablet_locs_begin();
|
||||
OB_SUCC(ret) && node != table_loc->tablet_locs_end(); ++node) {
|
||||
ObDASTabletLoc *tablet_loc = *node;
|
||||
if (OB_FAIL(create_one_das_task(tablet_loc))) {
|
||||
LOG_WARN("create one das task failed", K(ret));
|
||||
@ -807,7 +808,7 @@ int ObTableScanOp::init_table_scan_rtdef()
|
||||
if (OB_FAIL(init_das_scan_rtdef(scan_ctdef, scan_rtdef, loc_meta))) {
|
||||
LOG_WARN("init das scan rtdef failed", K(ret));
|
||||
} else if (!MY_SPEC.use_dist_das_ && !MY_SPEC.gi_above_ && !scan_rtdef.table_loc_->empty()) {
|
||||
MY_INPUT.tablet_loc_ = scan_rtdef.table_loc_->tablet_locs_.get_first();
|
||||
MY_INPUT.tablet_loc_ = scan_rtdef.table_loc_->get_first_tablet_loc();
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret) && MY_CTDEF.lookup_ctdef_ != nullptr) {
|
||||
@ -2062,9 +2063,8 @@ int ObTableScanOp::get_access_tablet_loc(ObGranuleTaskInfo &info)
|
||||
iter_end_ = true;
|
||||
ret = OB_SUCCESS;
|
||||
}
|
||||
} else if (OB_FAIL(ObDASUtils::get_tablet_loc_by_id(info.tablet_loc_->tablet_id_,
|
||||
*tsc_rtdef_.scan_rtdef_.table_loc_,
|
||||
MY_INPUT.tablet_loc_))) {
|
||||
} else if (OB_FAIL(tsc_rtdef_.scan_rtdef_.table_loc_->get_tablet_loc_by_id(info.tablet_loc_->tablet_id_,
|
||||
MY_INPUT.tablet_loc_))) {
|
||||
//need use `get_tablet_loc_by_id` to find my px work thread's tablet_loc,
|
||||
//because the tablet_loc in SQC maybe shared with other px work thread,
|
||||
//the tablet loc maybe modify in das partition retry
|
||||
|
||||
Reference in New Issue
Block a user