placeholder for fts branch DAS iter structure refactor
This commit is contained in:
@ -122,7 +122,9 @@ public:
|
||||
das_task_node_(),
|
||||
agg_tasks_(nullptr),
|
||||
cur_agg_list_(nullptr),
|
||||
op_result_(nullptr)
|
||||
op_result_(nullptr),
|
||||
attach_ctdef_(nullptr),
|
||||
attach_rtdef_(nullptr)
|
||||
{
|
||||
das_task_node_.get_data() = this;
|
||||
}
|
||||
@ -264,6 +266,11 @@ protected:
|
||||
ObDasAggregatedTasks *agg_tasks_; // task's agg task, do not serialize
|
||||
DasTaskLinkedList *cur_agg_list_; // task's agg_list, do not serialize
|
||||
ObIDASTaskResult *op_result_;
|
||||
//The attach_ctdef describes the computations that are pushed down and executed as an attachment to the ObDASTaskOp,
|
||||
//such as the back table operation for full-text indexes,
|
||||
//rowkey merging for index merge operations, and so on.
|
||||
const ObDASBaseCtDef *attach_ctdef_;
|
||||
ObDASBaseRtDef *attach_rtdef_;
|
||||
};
|
||||
typedef common::ObObjStore<ObIDASTaskOp*, common::ObIAllocator&> DasTaskList;
|
||||
typedef DasTaskList::Iterator DASTaskIter;
|
||||
@ -412,17 +419,22 @@ struct DASCtEncoder
|
||||
static int encode(char *buf, const int64_t buf_len, int64_t &pos, const T *val)
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
int64_t idx = 0;
|
||||
int64_t idx = common::OB_INVALID_INDEX;
|
||||
const ObDASBaseCtDef *ctdef = val;
|
||||
ObDASRemoteInfo *remote_info = ObDASRemoteInfo::get_remote_info();
|
||||
if (OB_ISNULL(val) || OB_ISNULL(remote_info)) {
|
||||
if (OB_ISNULL(remote_info)) {
|
||||
ret = common::OB_ERR_UNEXPECTED;
|
||||
SQL_DAS_LOG(WARN, "val is nullptr", K(ret), K(val), K(remote_info));
|
||||
SQL_DAS_LOG(WARN, "val is nullptr", K(ret), K(remote_info));
|
||||
} else if (OB_ISNULL(val)) {
|
||||
idx = common::OB_INVALID_INDEX;
|
||||
} else if (!common::has_exist_in_array(remote_info->ctdefs_, ctdef, &idx)) {
|
||||
ret = common::OB_ERR_UNEXPECTED;
|
||||
SQL_DAS_LOG(WARN, "val not found in ctdefs", K(ret), K(val), KPC(val));
|
||||
} else if (OB_FAIL(common::serialization::encode_i32(buf, buf_len, pos, static_cast<int32_t>(idx)))) {
|
||||
SQL_DAS_LOG(WARN, "encode idx failed", K(ret), K(idx));
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(common::serialization::encode_i32(buf, buf_len, pos, static_cast<int32_t>(idx)))) {
|
||||
SQL_DAS_LOG(WARN, "encode idx failed", K(ret), K(idx));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -430,13 +442,15 @@ struct DASCtEncoder
|
||||
static int decode(const char *buf, const int64_t data_len, int64_t &pos, const T *&val)
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
int32_t idx = 0;
|
||||
int32_t idx = common::OB_INVALID_INDEX;
|
||||
ObDASRemoteInfo *remote_info = ObDASRemoteInfo::get_remote_info();
|
||||
if (OB_ISNULL(remote_info)) {
|
||||
ret = common::OB_ERR_UNEXPECTED;
|
||||
SQL_DAS_LOG(WARN, "remote_info is nullptr", K(ret), K(remote_info));
|
||||
} else if (OB_FAIL(common::serialization::decode_i32(buf, data_len, pos, &idx))) {
|
||||
SQL_DAS_LOG(WARN, "decode idx failed", K(ret), K(idx));
|
||||
} else if (OB_UNLIKELY(common::OB_INVALID_INDEX == idx)) {
|
||||
val = nullptr;
|
||||
} else if (OB_UNLIKELY(idx < 0) || OB_UNLIKELY(idx >= remote_info->ctdefs_.count())) {
|
||||
ret = common::OB_ERR_UNEXPECTED;
|
||||
SQL_DAS_LOG(WARN, "idx is invalid", K(ret), K(idx), K(remote_info->ctdefs_.count()));
|
||||
@ -449,7 +463,7 @@ struct DASCtEncoder
|
||||
static int64_t encoded_length(const T *val)
|
||||
{
|
||||
UNUSED(val);
|
||||
int32_t idx = 0;
|
||||
int32_t idx = common::OB_INVALID_INDEX;
|
||||
return common::serialization::encoded_length_i32(idx);
|
||||
}
|
||||
};
|
||||
@ -460,17 +474,22 @@ struct DASRtEncoder
|
||||
static int encode(char *buf, const int64_t buf_len, int64_t &pos, const T *val)
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
int64_t idx = 0;
|
||||
int64_t idx = common::OB_INVALID_INDEX;
|
||||
ObDASBaseRtDef *rtdef = const_cast<T*>(val);
|
||||
ObDASRemoteInfo *remote_info = ObDASRemoteInfo::get_remote_info();
|
||||
if (OB_ISNULL(val) || OB_ISNULL(remote_info)) {
|
||||
if (OB_ISNULL(remote_info)) {
|
||||
ret = common::OB_ERR_UNEXPECTED;
|
||||
SQL_DAS_LOG(WARN, "val is nullptr", K(ret), K(val), K(remote_info));
|
||||
} else if (OB_ISNULL(val)) {
|
||||
idx = common::OB_INVALID_INDEX;
|
||||
} else if (!common::has_exist_in_array(remote_info->rtdefs_, rtdef, &idx)) {
|
||||
ret = common::OB_ERR_UNEXPECTED;
|
||||
SQL_DAS_LOG(WARN, "val not found in rtdefs", K(ret), K(val), KPC(val));
|
||||
} else if (OB_FAIL(common::serialization::encode_i32(buf, buf_len, pos, static_cast<int32_t>(idx)))) {
|
||||
SQL_DAS_LOG(WARN, "encode idx failed", K(ret), K(idx));
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(common::serialization::encode_i32(buf, buf_len, pos, static_cast<int32_t>(idx)))) {
|
||||
SQL_DAS_LOG(WARN, "encode idx failed", K(ret), K(idx));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -485,6 +504,8 @@ struct DASRtEncoder
|
||||
SQL_DAS_LOG(WARN, "remote_info is nullptr", K(ret), K(remote_info));
|
||||
} else if (OB_FAIL(common::serialization::decode_i32(buf, data_len, pos, &idx))) {
|
||||
SQL_DAS_LOG(WARN, "decode idx failed", K(ret), K(idx));
|
||||
} else if (OB_UNLIKELY(common::OB_INVALID_INDEX == idx)) {
|
||||
val = nullptr;
|
||||
} else if (OB_UNLIKELY(idx < 0) || OB_UNLIKELY(idx >= remote_info->rtdefs_.count())) {
|
||||
ret = common::OB_ERR_UNEXPECTED;
|
||||
SQL_DAS_LOG(WARN, "idx is invalid", K(ret), K(idx), K(remote_info->rtdefs_.count()));
|
||||
|
||||
Reference in New Issue
Block a user