Do not report ERROR when sample rate equals 100
This commit is contained in:
@ -19,7 +19,6 @@
|
||||
#include "storage/lob/ob_lob_util.h"
|
||||
#include "storage/tx/ob_trans_define_v4.h"
|
||||
#include "storage/tx/ob_trans_service.h"
|
||||
#include "storage/lob/ob_lob_manager.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
@ -66,8 +65,8 @@ ObTextStringIter::~ObTextStringIter()
|
||||
|
||||
int ObTextStringIter::init(uint32_t buffer_len,
|
||||
const sql::ObBasicSessionInfo *session,
|
||||
ObIAllocator *res_allocator,
|
||||
ObIAllocator *tmp_allocator)
|
||||
ObIAllocator *allocator,
|
||||
bool clone_remote /* false */)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (is_init_) {
|
||||
@ -81,7 +80,6 @@ int ObTextStringIter::init(uint32_t buffer_len,
|
||||
} else {
|
||||
ObLobLocatorV2 locator(datum_str_, has_lob_header_);
|
||||
is_lob_ = true;
|
||||
tmp_alloc_ = tmp_allocator;
|
||||
if (!has_lob_header_) {
|
||||
is_outrow_ = false;
|
||||
|
||||
@ -90,18 +88,17 @@ int ObTextStringIter::init(uint32_t buffer_len,
|
||||
COMMON_LOG(WARN,"Lob: invalid lob", K(ret));
|
||||
} else if (FALSE_IT(is_outrow_ = !locator.has_inrow_data())) {
|
||||
} else if (!is_outrow_) { // inrow lob always get full data, no need ctx_
|
||||
} else if (OB_ISNULL(res_allocator)) {
|
||||
} else if (OB_ISNULL(allocator)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
COMMON_LOG(WARN, "Lob: iter with null allocator", K(ret));
|
||||
} else { // outrow lob
|
||||
ObIAllocator *allocator = (tmp_allocator == nullptr) ? res_allocator : tmp_allocator;
|
||||
char *ctx_buffer = static_cast<char *>(allocator->alloc(sizeof(ObLobTextIterCtx)));
|
||||
if (OB_ISNULL(ctx_buffer)) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
COMMON_LOG(WARN,"Lob: failed to alloc output buffer", K(ret), KP(ctx_buffer));
|
||||
} else {
|
||||
ctx_ = new (ctx_buffer) ObLobTextIterCtx(locator, session, res_allocator, buffer_len);
|
||||
ctx_ ->init();
|
||||
ctx_ = new (ctx_buffer) ObLobTextIterCtx(locator, session, allocator, buffer_len);
|
||||
ctx_ ->init(clone_remote);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -197,7 +194,7 @@ int ObTextStringIter::get_outrow_lob_full_data(ObIAllocator *allocator /*nullptr
|
||||
COMMON_LOG(WARN, "Lob: get lob manager failed.", K(ret));
|
||||
} else { // outrow persist lob
|
||||
storage::ObLobAccessParam param;
|
||||
if (OB_SUCC(init_lob_access_param(param, ctx_, cs_type_, tmp_alloc_))) {
|
||||
if (OB_SUCC(init_lob_access_param(param, ctx_, cs_type_, allocator))) {
|
||||
param.len_ = (ctx_->total_access_len_ == 0 ? param.byte_size_ : ctx_->total_access_len_);
|
||||
|
||||
if (!param.ls_id_.is_valid() || !param.tablet_id_.is_valid()) {
|
||||
@ -252,7 +249,7 @@ int ObTextStringIter::get_outrow_prefix_data(uint32_t prefix_char_len)
|
||||
COMMON_LOG(WARN, "Lob: get lob manager failed.", K(ret));
|
||||
} else { // outrow persist lob
|
||||
storage::ObLobAccessParam param;
|
||||
if (OB_SUCC(init_lob_access_param(param, ctx_, cs_type_, tmp_alloc_))) {
|
||||
if (OB_SUCC(init_lob_access_param(param, ctx_, cs_type_))) {
|
||||
param.len_ = prefix_char_len;
|
||||
|
||||
if (!param.ls_id_.is_valid() || !param.tablet_id_.is_valid()) {
|
||||
@ -301,7 +298,7 @@ int ObTextStringIter::get_current_block(ObString &str)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObTextStringIter::get_full_data(ObString &data_str)
|
||||
int ObTextStringIter::get_full_data(ObString &data_str, ObIAllocator *allocator)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (!is_init_ || state_ != TEXTSTRING_ITER_INIT) {
|
||||
@ -319,7 +316,7 @@ int ObTextStringIter::get_full_data(ObString &data_str)
|
||||
}
|
||||
} else {
|
||||
// outrow lob, read full data into a inrow local tmp lob currently
|
||||
if (OB_FAIL(get_outrow_lob_full_data())) {
|
||||
if (OB_FAIL(get_outrow_lob_full_data(allocator))) {
|
||||
COMMON_LOG(WARN, "Lob: get lob outrow data failed", K(ret));
|
||||
} else {
|
||||
data_str.assign_ptr(ctx_->buff_, ctx_->content_byte_len_);
|
||||
@ -343,17 +340,7 @@ int ObTextStringIter::get_inrow_or_outrow_prefix_data(ObString &data_str, uint32
|
||||
data_str.assign(NULL, 0);
|
||||
COMMON_LOG(DEBUG, "Lob: iter with null input", K(ret), K(*this));
|
||||
} else if (!is_lob_ || !has_lob_header_) { // string types
|
||||
if (prefix_char_len == DEAFULT_LOB_PREFIX_CHAR_LEN) {
|
||||
data_str.assign_ptr(datum_str_.ptr(), datum_str_.length());
|
||||
} else {
|
||||
int64_t mb_len = ObCharset::strlen_char(cs_type_, datum_str_.ptr(), datum_str_.length());
|
||||
if (mb_len <= prefix_char_len) {
|
||||
data_str.assign_ptr(datum_str_.ptr(), datum_str_.length());
|
||||
} else {
|
||||
int64_t truncated_str_len = ObCharset::charpos(cs_type_, datum_str_.ptr(), datum_str_.length(), prefix_char_len);
|
||||
data_str.assign_ptr(datum_str_.ptr(), truncated_str_len);
|
||||
}
|
||||
}
|
||||
data_str.assign_ptr(datum_str_.ptr(), datum_str_.length());
|
||||
} else if (!is_outrow_) { // inrow lob
|
||||
ObLobLocatorV2 loc(datum_str_, has_lob_header_);
|
||||
if (OB_FAIL(loc.get_inrow_data(data_str))) {
|
||||
@ -404,7 +391,7 @@ int ObTextStringIter::get_first_block(ObString &str)
|
||||
COMMON_LOG(WARN, "Lob: get lob manager failed.", K(ret));
|
||||
} else {
|
||||
storage::ObLobAccessParam param;
|
||||
if (OB_SUCC(init_lob_access_param(param, ctx_, cs_type_, tmp_alloc_))) {
|
||||
if (OB_SUCC(init_lob_access_param(param, ctx_, cs_type_))) {
|
||||
param.scan_backward_ = ctx_->is_backward_;
|
||||
param.offset_ = ctx_->start_offset_;
|
||||
param.len_ = (ctx_->total_access_len_ == 0 ? param.byte_size_ : ctx_->total_access_len_);
|
||||
@ -843,7 +830,7 @@ int ObTextStringIter::get_char_len(int64_t &char_length)
|
||||
COMMON_LOG(WARN, "Lob: get lob manager failed.", K(ret));
|
||||
} else {
|
||||
storage::ObLobAccessParam param;
|
||||
if (OB_SUCC(init_lob_access_param(param, ctx_, cs_type_, tmp_alloc_))) {
|
||||
if (OB_SUCC(init_lob_access_param(param, ctx_, cs_type_))) {
|
||||
uint64_t length = 0;
|
||||
if (!param.ls_id_.is_valid() || !param.tablet_id_.is_valid()) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
@ -924,12 +911,10 @@ int ObTextStringIter::append_outrow_lob_fulldata(ObObj &obj,
|
||||
mem_loc_extern->payload_size_ = static_cast<uint32_t>(lob_data_byte_len);
|
||||
|
||||
// copy inrow data
|
||||
int64_t tenant_id = (session == nullptr) ? MTL_ID() : session->get_effective_tenant_id();
|
||||
ObArenaAllocator tmp_alloc("ObLobRead", OB_MALLOC_NORMAL_BLOCK_SIZE, tenant_id);
|
||||
ObTextStringIterState state;
|
||||
ObString src_block_data;
|
||||
ObTextStringIter instr_iter(obj);
|
||||
if (OB_FAIL(instr_iter.init(0, session, &allocator, &tmp_alloc))) {
|
||||
if (OB_FAIL(instr_iter.init(0, session, &allocator))) {
|
||||
COMMON_LOG(WARN, "Lob: init text string iter failed", K(instr_iter));
|
||||
} else {
|
||||
while (OB_SUCC(ret)
|
||||
|
||||
Reference in New Issue
Block a user