[refactor] modify all OLAP_LOG_WARNING to LOG(WARNING) (#9473)
Co-authored-by: BePPPower <fangtiewei@selectdb.com>
This commit is contained in:
@ -104,7 +104,7 @@ Status HeartbeatServer::_heartbeat(const TMasterInfo& master_info) {
|
||||
}
|
||||
} else {
|
||||
if (_master_info->cluster_id != master_info.cluster_id) {
|
||||
OLAP_LOG_WARNING("invalid cluster id: %d. ignore.", master_info.cluster_id);
|
||||
LOG(WARNING) << "invalid cluster id: " << master_info.cluster_id << ". ignore.";
|
||||
return Status::InternalError("invalid cluster id. ignore.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,10 +41,8 @@ Status BloomFilterIndexReader::init(char* buffer, size_t buffer_size, bool is_us
|
||||
_hash_function_num = hash_function_num;
|
||||
_start_offset = sizeof(BloomFilterIndexHeader);
|
||||
if (_step_size * _entry_count + _start_offset > _buffer_size) {
|
||||
OLAP_LOG_WARNING(
|
||||
"invalid param found. "
|
||||
"[buffer_size=%lu bit_num=%u block_count=%lu header_size=%lu]",
|
||||
buffer_size, bit_num, _entry_count, _start_offset);
|
||||
LOG(WARNING) << "invalid param found.[buffer_size=" << buffer_size << " bit_num=" << bit_num
|
||||
<< " block_count=" << _entry_count << " header_size=" << _start_offset << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ Status BloomFilterIndexWriter::add_bloom_filter(BloomFilter* bf) {
|
||||
try {
|
||||
_bloom_filters.push_back(bf);
|
||||
} catch (...) {
|
||||
OLAP_LOG_WARNING("add bloom filter to vector fail");
|
||||
LOG(WARNING) << "add bloom filter to vector fail";
|
||||
return Status::OLAPInternalError(OLAP_ERR_STL_ERROR);
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ uint64_t BloomFilterIndexWriter::estimate_buffered_memory() {
|
||||
Status BloomFilterIndexWriter::write_to_buffer(OutStream* out_stream) {
|
||||
Status res = Status::OK();
|
||||
if (nullptr == out_stream) {
|
||||
OLAP_LOG_WARNING("out stream is null");
|
||||
LOG(WARNING) << "out stream is null";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ Status BloomFilterIndexWriter::write_to_buffer(OutStream* out_stream) {
|
||||
_header.block_count = _bloom_filters.size();
|
||||
res = out_stream->write(reinterpret_cast<char*>(&_header), sizeof(_header));
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("write bloom filter index header fail");
|
||||
LOG(WARNING) << "write bloom filter index header fail";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ Status BloomFilterIndexWriter::write_to_buffer(OutStream* out_stream) {
|
||||
uint32_t data_len = _bloom_filters[i]->bit_set_data_len();
|
||||
res = out_stream->write(reinterpret_cast<char*>(data), sizeof(uint64_t) * data_len);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("write bloom filter index fail, i=%u", i);
|
||||
LOG(WARNING) << "write bloom filter index fail, i=" << i;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -80,13 +80,13 @@ Status BloomFilterIndexWriter::write_to_buffer(OutStream* out_stream) {
|
||||
Status BloomFilterIndexWriter::write_to_buffer(char* buffer, size_t buffer_size) {
|
||||
Status res = Status::OK();
|
||||
if (nullptr == buffer) {
|
||||
OLAP_LOG_WARNING("out stream is nullptr.");
|
||||
LOG(WARNING) << "out stream is nullptr.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
if (estimate_buffered_memory() > buffer_size) {
|
||||
OLAP_LOG_WARNING("need more buffer. [scr_size=%lu buffer_size=%lu]",
|
||||
estimate_buffered_memory(), buffer_size);
|
||||
LOG(WARNING) << "need more buffer. [scr_size=" << estimate_buffered_memory()
|
||||
<< " buffer_size=" << buffer_size << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@ -100,7 +100,8 @@ StorageByteBuffer* StorageByteBuffer::mmap(void* start, uint64_t length, int pro
|
||||
char* memory = (char*)::mmap(start, length, prot, flags, fd, offset);
|
||||
|
||||
if (MAP_FAILED == memory) {
|
||||
OLAP_LOG_WARNING("fail to mmap. [errno='%d' errno_str='%s']", Errno::no(), Errno::str());
|
||||
LOG(WARNING) << "fail to mmap. [errno='" << Errno::no() << "' errno_str='" << Errno::str()
|
||||
<< "']";
|
||||
RELEASE_THREAD_LOCAL_MEM_TRACKER(length);
|
||||
return nullptr;
|
||||
}
|
||||
@ -112,7 +113,7 @@ StorageByteBuffer* StorageByteBuffer::mmap(void* start, uint64_t length, int pro
|
||||
|
||||
if (nullptr == buf) {
|
||||
deleter(memory);
|
||||
OLAP_LOG_WARNING("fail to allocate StorageByteBuffer.");
|
||||
LOG(WARNING) << "fail to allocate StorageByteBuffer.";
|
||||
RELEASE_THREAD_LOCAL_MEM_TRACKER(length);
|
||||
return nullptr;
|
||||
}
|
||||
@ -128,7 +129,7 @@ StorageByteBuffer* StorageByteBuffer::mmap(void* start, uint64_t length, int pro
|
||||
StorageByteBuffer* StorageByteBuffer::mmap(FileHandler* handler, uint64_t offset, int prot,
|
||||
int flags) {
|
||||
if (nullptr == handler) {
|
||||
OLAP_LOG_WARNING("invalid file handler");
|
||||
LOG(WARNING) << "invalid file handler";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -138,7 +139,8 @@ StorageByteBuffer* StorageByteBuffer::mmap(FileHandler* handler, uint64_t offset
|
||||
char* memory = (char*)::mmap(nullptr, length, prot, flags, fd, offset);
|
||||
|
||||
if (MAP_FAILED == memory) {
|
||||
OLAP_LOG_WARNING("fail to mmap. [errno='%d' errno_str='%s']", Errno::no(), Errno::str());
|
||||
LOG(WARNING) << "fail to mmap. [errno='" << Errno::no() << "' errno_str='" << Errno::str()
|
||||
<< "']";
|
||||
RELEASE_THREAD_LOCAL_MEM_TRACKER(length);
|
||||
return nullptr;
|
||||
}
|
||||
@ -150,7 +152,7 @@ StorageByteBuffer* StorageByteBuffer::mmap(FileHandler* handler, uint64_t offset
|
||||
|
||||
if (nullptr == buf) {
|
||||
deleter(memory);
|
||||
OLAP_LOG_WARNING("fail to allocate StorageByteBuffer.");
|
||||
LOG(WARNING) << "fail to allocate StorageByteBuffer.";
|
||||
RELEASE_THREAD_LOCAL_MEM_TRACKER(length);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -814,8 +814,9 @@ Status DataDir::move_to_trash(const FilePathDesc& segment_path_desc) {
|
||||
std::filesystem::path trash_local_path(trash_local_file);
|
||||
string trash_local_dir = trash_local_path.parent_path().string();
|
||||
if (!FileUtils::check_exist(trash_local_dir) && !FileUtils::create_dir(trash_local_dir).ok()) {
|
||||
OLAP_LOG_WARNING("delete file failed. due to mkdir failed. [file=%s new_dir=%s]",
|
||||
segment_path_desc.filepath.c_str(), trash_local_dir.c_str());
|
||||
LOG(WARNING) << "delete file failed. due to mkdir failed. [file="
|
||||
<< segment_path_desc.filepath.c_str() << " new_dir=" << trash_local_dir.c_str()
|
||||
<< "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_OS_ERROR);
|
||||
}
|
||||
|
||||
@ -843,9 +844,9 @@ Status DataDir::move_to_trash(const FilePathDesc& segment_path_desc) {
|
||||
Status rename_status = storage_backend->rename_dir(segment_path_desc.remote_path,
|
||||
trash_path_desc.remote_path);
|
||||
if (!rename_status.ok()) {
|
||||
OLAP_LOG_WARNING("Move remote file to trash failed. [file=%s target='%s']",
|
||||
segment_path_desc.remote_path.c_str(),
|
||||
trash_path_desc.remote_path.c_str());
|
||||
LOG(WARNING) << "Move remote file to trash failed. [file="
|
||||
<< segment_path_desc.remote_path << " target='"
|
||||
<< trash_path_desc.remote_path << "']";
|
||||
return Status::OLAPInternalError(OLAP_ERR_OS_ERROR);
|
||||
}
|
||||
} else if (status.is_not_found()) {
|
||||
@ -860,8 +861,8 @@ Status DataDir::move_to_trash(const FilePathDesc& segment_path_desc) {
|
||||
VLOG_NOTICE << "move file to trash. " << segment_path_desc.filepath << " -> "
|
||||
<< trash_local_file;
|
||||
if (rename(segment_path_desc.filepath.c_str(), trash_local_file.c_str()) < 0) {
|
||||
OLAP_LOG_WARNING("move file to trash failed. [file=%s target='%s' err='%m']",
|
||||
segment_path_desc.filepath.c_str(), trash_local_file.c_str());
|
||||
LOG(WARNING) << "move file to trash failed. [file=" << segment_path_desc.filepath
|
||||
<< " target='" << trash_local_file << "' err='" << Errno::str() << "']";
|
||||
return Status::OLAPInternalError(OLAP_ERR_OS_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ struct decimal12_t {
|
||||
fraction += (sign ? -FRAC_RATIO : FRAC_RATIO);
|
||||
}
|
||||
|
||||
//OLAP_LOG_WARNING("agg: int=%ld, frac=%d", integer, fraction);
|
||||
//LOG(WARNING) << "agg: int=" << integer << ", frac=" << fraction;
|
||||
//_set_flag();
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ bool DeleteConditionHandler::is_condition_value_valid(const TabletColumn& column
|
||||
case OLAP_FIELD_TYPE_BOOL:
|
||||
return valid_bool(value_str);
|
||||
default:
|
||||
OLAP_LOG_WARNING("unknown field type. [type=%d]", field_type);
|
||||
LOG(WARNING) << "unknown field type. [type=" << field_type << "]";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -160,7 +160,7 @@ Status DeleteConditionHandler::check_condition_valid(const TabletSchema& schema,
|
||||
// Check whether the column exists
|
||||
int32_t field_index = schema.field_index(cond.column_name);
|
||||
if (field_index < 0) {
|
||||
OLAP_LOG_WARNING("field is not existent. [field_index=%d]", field_index);
|
||||
LOG(WARNING) << "field is not existent. [field_index=" << field_index << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_DELETE_INVALID_CONDITION);
|
||||
}
|
||||
|
||||
@ -178,7 +178,8 @@ Status DeleteConditionHandler::check_condition_valid(const TabletSchema& schema,
|
||||
// Check operator and operands size are matched.
|
||||
if ("*=" != cond.condition_op && "!*=" != cond.condition_op &&
|
||||
cond.condition_values.size() != 1) {
|
||||
OLAP_LOG_WARNING("invalid condition value size. [size=%ld]", cond.condition_values.size());
|
||||
LOG(WARNING) << "invalid condition value size. [size=" << cond.condition_values.size()
|
||||
<< "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_DELETE_INVALID_CONDITION);
|
||||
}
|
||||
|
||||
@ -253,7 +254,7 @@ Status DeleteHandler::init(const TabletSchema& schema, const DelPredicateArray&
|
||||
for (const auto& sub_predicate : delete_condition.sub_predicates()) {
|
||||
TCondition condition;
|
||||
if (!_parse_condition(sub_predicate, &condition)) {
|
||||
OLAP_LOG_WARNING("fail to parse condition. [condition=%s]", sub_predicate.c_str());
|
||||
LOG(WARNING) << "fail to parse condition. [condition=" << sub_predicate << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_DELETE_INVALID_PARAMETERS);
|
||||
}
|
||||
|
||||
|
||||
@ -292,7 +292,7 @@ off_t FileHandler::length() const {
|
||||
struct stat stat_data;
|
||||
|
||||
if (fstat(_fd, &stat_data) < 0) {
|
||||
OLAP_LOG_WARNING("fstat error. [fd=%d]", _fd);
|
||||
LOG(WARNING) << "fstat error. [fd=" << _fd << "]";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -356,7 +356,7 @@ Status FileHandlerWithBuf::close() {
|
||||
|
||||
Status FileHandlerWithBuf::read(void* buf, size_t size) {
|
||||
if (OLAP_UNLIKELY(nullptr == _fp)) {
|
||||
OLAP_LOG_WARNING("Fail to write, fp is nullptr!");
|
||||
LOG(WARNING) << "Fail to write, fp is nullptr!";
|
||||
return Status::OLAPInternalError(OLAP_ERR_NOT_INITED);
|
||||
}
|
||||
|
||||
@ -380,7 +380,7 @@ Status FileHandlerWithBuf::read(void* buf, size_t size) {
|
||||
|
||||
Status FileHandlerWithBuf::pread(void* buf, size_t size, size_t offset) {
|
||||
if (OLAP_UNLIKELY(nullptr == _fp)) {
|
||||
OLAP_LOG_WARNING("Fail to write, fp is nullptr!");
|
||||
LOG(WARNING) << "Fail to write, fp is nullptr!";
|
||||
return Status::OLAPInternalError(OLAP_ERR_NOT_INITED);
|
||||
}
|
||||
|
||||
@ -397,7 +397,7 @@ Status FileHandlerWithBuf::pread(void* buf, size_t size, size_t offset) {
|
||||
|
||||
Status FileHandlerWithBuf::write(const void* buf, size_t buf_size) {
|
||||
if (OLAP_UNLIKELY(nullptr == _fp)) {
|
||||
OLAP_LOG_WARNING("Fail to write, fp is nullptr!");
|
||||
LOG(WARNING) << "Fail to write, fp is nullptr!";
|
||||
return Status::OLAPInternalError(OLAP_ERR_NOT_INITED);
|
||||
}
|
||||
|
||||
@ -415,7 +415,7 @@ Status FileHandlerWithBuf::write(const void* buf, size_t buf_size) {
|
||||
|
||||
Status FileHandlerWithBuf::pwrite(const void* buf, size_t buf_size, size_t offset) {
|
||||
if (OLAP_UNLIKELY(nullptr == _fp)) {
|
||||
OLAP_LOG_WARNING("Fail to write, fp is nullptr!");
|
||||
LOG(WARNING) << "Fail to write, fp is nullptr!";
|
||||
return Status::OLAPInternalError(OLAP_ERR_NOT_INITED);
|
||||
}
|
||||
|
||||
|
||||
@ -63,12 +63,12 @@ Status ReadOnlyFileStream::_assure_data() {
|
||||
SCOPED_RAW_TIMER(&_stats->io_ns);
|
||||
res = _file_cursor.read(reinterpret_cast<char*>(&header), sizeof(header));
|
||||
if (OLAP_UNLIKELY(!res.ok())) {
|
||||
OLAP_LOG_WARNING("read header fail");
|
||||
LOG(WARNING) << "read header fail";
|
||||
return res;
|
||||
}
|
||||
res = _fill_compressed(header.length);
|
||||
if (OLAP_UNLIKELY(!res.ok())) {
|
||||
OLAP_LOG_WARNING("read header fail");
|
||||
LOG(WARNING) << "read header fail";
|
||||
return res;
|
||||
}
|
||||
_stats->compressed_bytes_read += sizeof(header) + header.length;
|
||||
@ -122,7 +122,7 @@ Status ReadOnlyFileStream::seek(PositionProvider* position) {
|
||||
VLOG_TRACE << "file stream eof.";
|
||||
return res;
|
||||
} else {
|
||||
OLAP_LOG_WARNING("fail to assure data after seek");
|
||||
LOG(WARNING) << "fail to assure data after seek";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -171,7 +171,7 @@ Status ReadOnlyFileStream::_fill_compressed(size_t length) {
|
||||
|
||||
Status res = _file_cursor.read((*_shared_buffer)->array(), length);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to fill compressed buffer.");
|
||||
LOG(WARNING) << "fail to fill compressed buffer.";
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ public:
|
||||
Status init() {
|
||||
_compressed_helper = StorageByteBuffer::create(_compress_buffer_size);
|
||||
if (nullptr == _compressed_helper) {
|
||||
OLAP_LOG_WARNING("fail to create compressed buffer");
|
||||
LOG(WARNING) << "fail to create compressed buffer";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ Status InStream::_slice(uint64_t chunk_size, StorageByteBuffer** out_slice) {
|
||||
return Status::OK();
|
||||
} else if (_current_range >= _inputs.size() - 1) {
|
||||
// 如果buffer用完了
|
||||
OLAP_LOG_WARNING("EOF in InStream. [Need=%lu]", chunk_size);
|
||||
LOG(WARNING) << "EOF in InStream. [Need=" << chunk_size << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_OUT_OF_BOUND);
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ Status InStream::_slice(uint64_t chunk_size, StorageByteBuffer** out_slice) {
|
||||
// 到这里就意味着上边的循环里没有取到足够的buf
|
||||
// 回退到进来之前的状态
|
||||
_seek(old_offset);
|
||||
OLAP_LOG_WARNING("EOF in InStream. [Need=%lu]", chunk_size);
|
||||
LOG(WARNING) << "EOF in InStream. [Need=" << chunk_size << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_OUT_OF_BOUND);
|
||||
}
|
||||
|
||||
@ -146,8 +146,8 @@ Status InStream::_assure_data() {
|
||||
_compressed->get((char*)&head, sizeof(head));
|
||||
|
||||
if (head.length > _compress_buffer_size) {
|
||||
OLAP_LOG_WARNING("chunk size is larger than buffer size. [chunk=%u buffer_size=%u]",
|
||||
head.length, _compress_buffer_size);
|
||||
LOG(WARNING) << "chunk size is larger than buffer size. [chunk=" << head.length
|
||||
<< " buffer_size=" << _compress_buffer_size << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_READ_STREAM);
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ Status InStream::_assure_data() {
|
||||
// 根据head取一块buf,这里应该要调整_current_offset
|
||||
res = _slice(head.length, &slice);
|
||||
if (OLAP_LIKELY(!res.ok())) {
|
||||
OLAP_LOG_WARNING("fail to slice data from stream.");
|
||||
LOG(WARNING) << "fail to slice data from stream.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_READ_STREAM);
|
||||
}
|
||||
|
||||
@ -179,10 +179,10 @@ Status InStream::_assure_data() {
|
||||
SAFE_DELETE(slice);
|
||||
}
|
||||
} else {
|
||||
OLAP_LOG_WARNING(
|
||||
"compressed remaining size less than stream head size. "
|
||||
"[compressed_remaining_size=%lu stream_head_size=%lu]",
|
||||
_compressed->remaining(), sizeof(StreamHead));
|
||||
LOG(WARNING) << "compressed remaining size less than stream head size. "
|
||||
"[compressed_remaining_size="
|
||||
<< _compressed->remaining() << " stream_head_size=" << sizeof(StreamHead)
|
||||
<< "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_READ_STREAM);
|
||||
}
|
||||
|
||||
|
||||
@ -20,28 +20,28 @@
|
||||
|
||||
namespace doris {
|
||||
|
||||
#define OLAP_CACHE_STRING_TO_BUF(cur, str, r_len) \
|
||||
do { \
|
||||
if (r_len > str.size()) { \
|
||||
memcpy(cur, str.c_str(), str.size()); \
|
||||
r_len -= str.size(); \
|
||||
cur += str.size(); \
|
||||
} else { \
|
||||
OLAP_LOG_WARNING("construct cache key buf not enough."); \
|
||||
return CacheKey(nullptr, 0); \
|
||||
} \
|
||||
#define OLAP_CACHE_STRING_TO_BUF(cur, str, r_len) \
|
||||
do { \
|
||||
if (r_len > str.size()) { \
|
||||
memcpy(cur, str.c_str(), str.size()); \
|
||||
r_len -= str.size(); \
|
||||
cur += str.size(); \
|
||||
} else { \
|
||||
LOG(WARNING) << "construct cache key buf not enough."; \
|
||||
return CacheKey(nullptr, 0); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define OLAP_CACHE_NUMERIC_TO_BUF(cur, numeric, r_len) \
|
||||
do { \
|
||||
if (r_len > sizeof(numeric)) { \
|
||||
memcpy(cur, &numeric, sizeof(numeric)); \
|
||||
r_len -= sizeof(numeric); \
|
||||
cur += sizeof(numeric); \
|
||||
} else { \
|
||||
OLAP_LOG_WARNING("construct cache key buf not enough."); \
|
||||
return CacheKey(nullptr, 0); \
|
||||
} \
|
||||
#define OLAP_CACHE_NUMERIC_TO_BUF(cur, numeric, r_len) \
|
||||
do { \
|
||||
if (r_len > sizeof(numeric)) { \
|
||||
memcpy(cur, &numeric, sizeof(numeric)); \
|
||||
r_len -= sizeof(numeric); \
|
||||
cur += sizeof(numeric); \
|
||||
} else { \
|
||||
LOG(WARNING) << "construct cache key buf not enough."; \
|
||||
return CacheKey(nullptr, 0); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
class Cache;
|
||||
|
||||
@ -100,8 +100,8 @@ Status Cond::init(const TCondition& tcond, const TabletColumn& column) {
|
||||
// Parse op type
|
||||
op = parse_op_type(tcond.condition_op);
|
||||
if (op == OP_NULL || (op != OP_IN && op != OP_NOT_IN && tcond.condition_values.size() != 1)) {
|
||||
OLAP_LOG_WARNING("Condition op type is invalid. [name=%s, op=%d, size=%d]",
|
||||
tcond.column_name.c_str(), op, tcond.condition_values.size());
|
||||
LOG(WARNING) << "Condition op type is invalid. [name=" << tcond.column_name << ", op=" << op
|
||||
<< ", size=" << tcond.condition_values.size() << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
if (op == OP_IS) {
|
||||
@ -110,8 +110,8 @@ Status Cond::init(const TCondition& tcond, const TabletColumn& column) {
|
||||
auto operand = tcond.condition_values.begin();
|
||||
std::unique_ptr<WrapperField> f(WrapperField::create(column, operand->length()));
|
||||
if (f == nullptr) {
|
||||
OLAP_LOG_WARNING("Create field failed. [name=%s, operand=%s, op_type=%d]",
|
||||
tcond.column_name.c_str(), operand->c_str(), op);
|
||||
LOG(WARNING) << "Create field failed. [name=" << tcond.column_name
|
||||
<< ", operand=" << operand->c_str() << ", op_type=" << op << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
if (strcasecmp(operand->c_str(), "NULL") == 0) {
|
||||
@ -125,14 +125,14 @@ Status Cond::init(const TCondition& tcond, const TabletColumn& column) {
|
||||
auto operand = tcond.condition_values.begin();
|
||||
std::unique_ptr<WrapperField> f(WrapperField::create(column, operand->length()));
|
||||
if (f == nullptr) {
|
||||
OLAP_LOG_WARNING("Create field failed. [name=%s, operand=%s, op_type=%d]",
|
||||
tcond.column_name.c_str(), operand->c_str(), op);
|
||||
LOG(WARNING) << "Create field failed. [name=" << tcond.column_name
|
||||
<< ", operand=" << operand->c_str() << ", op_type=" << op << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
Status res = f->from_string(*operand);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("Convert from string failed. [name=%s, operand=%s, op_type=%d]",
|
||||
tcond.column_name.c_str(), operand->c_str(), op);
|
||||
LOG(WARNING) << "Convert from string failed. [name=" << tcond.column_name
|
||||
<< ", operand=" << operand->c_str() << ", op_type=" << op << "]";
|
||||
return res;
|
||||
}
|
||||
operand_field = f.release();
|
||||
@ -142,14 +142,14 @@ Status Cond::init(const TCondition& tcond, const TabletColumn& column) {
|
||||
for (auto& operand : tcond.condition_values) {
|
||||
std::unique_ptr<WrapperField> f(WrapperField::create(column, operand.length()));
|
||||
if (f == nullptr) {
|
||||
OLAP_LOG_WARNING("Create field failed. [name=%s, operand=%s, op_type=%d]",
|
||||
tcond.column_name.c_str(), operand.c_str(), op);
|
||||
LOG(WARNING) << "Create field failed. [name=" << tcond.column_name
|
||||
<< ", operand=" << operand.c_str() << ", op_type=" << op << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
Status res = f->from_string(operand);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("Convert from string failed. [name=%s, operand=%s, op_type=%d]",
|
||||
tcond.column_name.c_str(), operand.c_str(), op);
|
||||
LOG(WARNING) << "Convert from string failed. [name=" << tcond.column_name
|
||||
<< ", operand=" << operand.c_str() << ", op_type=" << op << "]";
|
||||
return res;
|
||||
}
|
||||
if (min_value_field == nullptr || f->cmp(min_value_field) < 0) {
|
||||
|
||||
@ -391,8 +391,8 @@ const OLAPIndexOffset MemIndex::find(const RowCursor& k, RowCursor* helper_curso
|
||||
VLOG_NOTICE << "show result offset. seg_off=" << offset.segment
|
||||
<< ", off=" << offset.offset;
|
||||
} catch (...) {
|
||||
OLAP_LOG_WARNING("fail to compare value in memindex. [cursor='%s' find_last=%d]",
|
||||
k.to_string().c_str(), find_last);
|
||||
LOG(WARNING) << "fail to compare value in memindex. [cursor='" << k.to_string()
|
||||
<< "' find_last=" << find_last << "]";
|
||||
return end();
|
||||
}
|
||||
|
||||
@ -475,11 +475,11 @@ Status MemIndex::get_row_block_position(const OLAPIndexOffset& pos, RowBlockPosi
|
||||
}
|
||||
|
||||
if (pos.segment >= segment_count() || pos.offset >= _meta[pos.segment].count()) {
|
||||
OLAP_LOG_WARNING(
|
||||
"fail to get RowBlockPosition from OLAPIndexOffset. "
|
||||
"[IndexOffset={segment=%u offset=%u} segment_count=%lu items_count=%lu]",
|
||||
pos.segment, pos.offset, segment_count(),
|
||||
pos.segment < segment_count() ? _meta[pos.segment].count() : 0);
|
||||
LOG(WARNING) << "fail to get RowBlockPosition from OLAPIndexOffset. "
|
||||
"[IndexOffset={segment="
|
||||
<< pos.segment << " offset=" << pos.offset
|
||||
<< "} segment_count=" << segment_count() << " items_count="
|
||||
<< (pos.segment < segment_count() ? _meta[pos.segment].count() : 0) << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INDEX_EOF);
|
||||
}
|
||||
|
||||
|
||||
@ -134,10 +134,8 @@ void StorageEngine::_fd_cache_clean_callback() {
|
||||
while (!_stop_background_threads_latch.wait_for(std::chrono::seconds(interval))) {
|
||||
interval = config::cache_clean_interval;
|
||||
if (interval <= 0) {
|
||||
OLAP_LOG_WARNING(
|
||||
"config of file descriptor clean interval is illegal: [%d], "
|
||||
"force set to 3600",
|
||||
interval);
|
||||
LOG(WARNING) << "config of file descriptor clean interval is illegal: [" << interval
|
||||
<< "], force set to 3600 ";
|
||||
interval = 3600;
|
||||
}
|
||||
|
||||
@ -153,8 +151,8 @@ void StorageEngine::_garbage_sweeper_thread_callback() {
|
||||
uint32_t min_interval = config::min_garbage_sweep_interval;
|
||||
|
||||
if (!(max_interval >= min_interval && min_interval > 0)) {
|
||||
OLAP_LOG_WARNING("garbage sweep interval config is illegal: [max=%d min=%d].", max_interval,
|
||||
min_interval);
|
||||
LOG(WARNING) << "garbage sweep interval config is illegal: [max=" << max_interval
|
||||
<< " min=" << min_interval << "].";
|
||||
min_interval = 1;
|
||||
max_interval = max_interval >= min_interval ? max_interval : min_interval;
|
||||
LOG(INFO) << "force reset garbage sweep interval. "
|
||||
|
||||
@ -64,7 +64,7 @@ OutStream* OutStreamFactory::create_stream(uint32_t column_unique_id,
|
||||
}
|
||||
|
||||
if (nullptr == stream) {
|
||||
OLAP_LOG_WARNING("fail to allocate OutStream.");
|
||||
LOG(WARNING) << "fail to allocate OutStream.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ Status OutStream::_spill() {
|
||||
res = _compress(_current, _compressed, _overflow, &smaller);
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to compress data.");
|
||||
LOG(WARNING) << "fail to compress data.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COMPRESS_ERROR);
|
||||
}
|
||||
|
||||
@ -268,7 +268,7 @@ Status OutStream::write(const char* buffer, uint64_t length) {
|
||||
if (OLAP_LIKELY(0 != to_put)) {
|
||||
res = _current->put(&buffer[offset], to_put);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to put buffer.");
|
||||
LOG(WARNING) << "fail to put buffer.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -279,7 +279,7 @@ Status OutStream::write(const char* buffer, uint64_t length) {
|
||||
if (_current->remaining() == 0) {
|
||||
res = _spill();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to spill current buffer.");
|
||||
LOG(WARNING) << "fail to spill current buffer.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -346,7 +346,7 @@ Status OutStream::write_to_file(FileHandler* file_handle, uint32_t write_mbytes_
|
||||
|
||||
res = file_handle->write((*it)->array(), (*it)->limit());
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write stream to fail.");
|
||||
LOG(WARNING) << "fail to write stream to fail.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -372,7 +372,7 @@ Status OutStream::flush() {
|
||||
|
||||
res = _spill();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to spill stream.");
|
||||
LOG(WARNING) << "fail to spill stream.";
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
if (_current->remaining() < 1) {
|
||||
res = _spill();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to spill current buffer.");
|
||||
LOG(WARNING) << "fail to spill current buffer.";
|
||||
return res;
|
||||
}
|
||||
if (_current == nullptr) {
|
||||
|
||||
@ -331,8 +331,8 @@ Status TabletReader::_init_return_columns(const ReaderParams& read_params) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
OLAP_LOG_WARNING("fail to init return columns. [reader_type=%d return_columns_size=%u]",
|
||||
read_params.reader_type, read_params.return_columns.size());
|
||||
LOG(WARNING) << "fail to init return columns. [reader_type=" << read_params.reader_type
|
||||
<< " return_columns_size=" << read_params.return_columns.size() << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -390,8 +390,9 @@ Status TabletReader::_init_keys_param(const ReaderParams& read_params) {
|
||||
|
||||
for (size_t i = 0; i < start_key_size; ++i) {
|
||||
if (read_params.start_key[i].size() != scan_key_size) {
|
||||
OLAP_LOG_WARNING("The start_key.at(%ld).size == %ld, not equals the %ld", i,
|
||||
read_params.start_key[i].size(), scan_key_size);
|
||||
LOG(WARNING) << "The start_key.at(" << i
|
||||
<< ").size == " << read_params.start_key[i].size() << ", not equals the "
|
||||
<< scan_key_size;
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -414,8 +415,8 @@ Status TabletReader::_init_keys_param(const ReaderParams& read_params) {
|
||||
std::vector<RowCursor>(end_key_size).swap(_keys_param.end_keys);
|
||||
for (size_t i = 0; i < end_key_size; ++i) {
|
||||
if (read_params.end_key[i].size() != scan_key_size) {
|
||||
OLAP_LOG_WARNING("The end_key.at(%ld).size == %ld, not equals the %ld", i,
|
||||
read_params.end_key[i].size(), scan_key_size);
|
||||
LOG(WARNING) << "The end_key.at(" << i << ").size == " << read_params.end_key[i].size()
|
||||
<< ", not equals the " << scan_key_size;
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@ -55,10 +55,9 @@ void RowBlock::init(const RowBlockInfo& block_info) {
|
||||
|
||||
Status RowBlock::finalize(uint32_t row_num) {
|
||||
if (row_num > _capacity) {
|
||||
OLAP_LOG_WARNING(
|
||||
"Input row num is larger than internal row num."
|
||||
"[row_num=%u; _info.row_num=%u]",
|
||||
row_num, _info.row_num);
|
||||
LOG(WARNING) << "Input row num is larger than internal row num."
|
||||
"[row_num="
|
||||
<< row_num << "; _info.row_num=" << _info.row_num << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
_info.row_num = row_num;
|
||||
|
||||
@ -327,19 +327,19 @@ Status RowCursor::_alloc_buf() {
|
||||
// variable_len for null bytes
|
||||
_variable_buf = new (nothrow) char[_variable_len]();
|
||||
if (_variable_buf == nullptr) {
|
||||
OLAP_LOG_WARNING("Fail to malloc _variable_buf.");
|
||||
LOG(WARNING) << "Fail to malloc _variable_buf.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
if (_string_field_count > 0) {
|
||||
_long_text_buf = (char**)malloc(_string_field_count * sizeof(char*));
|
||||
if (_long_text_buf == nullptr) {
|
||||
OLAP_LOG_WARNING("Fail to malloc _long_text_buf.");
|
||||
LOG(WARNING) << "Fail to malloc _long_text_buf.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
for (int i = 0; i < _string_field_count; ++i) {
|
||||
_long_text_buf[i] = (char*)malloc(DEFAULT_TEXT_LENGTH * sizeof(char));
|
||||
if (_long_text_buf[i] == nullptr) {
|
||||
OLAP_LOG_WARNING("Fail to malloc _long_text_buf.");
|
||||
LOG(WARNING) << "Fail to malloc _long_text_buf.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ Status BitFieldReader::init() {
|
||||
_byte_reader = new (std::nothrow) RunLengthByteReader(_input);
|
||||
|
||||
if (nullptr == _byte_reader) {
|
||||
OLAP_LOG_WARNING("fail to create RunLengthByteReader");
|
||||
LOG(WARNING) << "fail to create RunLengthByteReader";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
}
|
||||
@ -85,7 +85,7 @@ Status BitFieldReader::seek(PositionProvider* position) {
|
||||
int64_t consumed = position->get_next();
|
||||
|
||||
if (consumed > 8) {
|
||||
OLAP_LOG_WARNING("read past end of bit field");
|
||||
LOG(WARNING) << "read past end of bit field";
|
||||
return Status::OLAPInternalError(OLAP_ERR_DATA_EOF);
|
||||
} else if (consumed != 0) {
|
||||
if (!(res = _read_byte())) {
|
||||
|
||||
@ -34,7 +34,7 @@ Status BitFieldWriter::init() {
|
||||
_byte_writer = new (std::nothrow) RunLengthByteWriter(_output);
|
||||
|
||||
if (nullptr == _byte_writer) {
|
||||
OLAP_LOG_WARNING("fail to create RunLengthByteWriter");
|
||||
LOG(WARNING) << "fail to create RunLengthByteWriter";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ Status BitFieldWriter::_write_byte() {
|
||||
Status res = Status::OK();
|
||||
|
||||
if (!(res = _byte_writer->write(_current))) {
|
||||
OLAP_LOG_WARNING("fail to write byte to byte writer");
|
||||
LOG(WARNING) << "fail to write byte to byte writer";
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ Status ColumnData::_seek_to_block(const RowBlockPosition& block_pos, bool withou
|
||||
file_name, segment_group(), block_pos.segment, _seek_columns, _load_bf_columns,
|
||||
_conditions, _delete_handler, _delete_status, _lru_cache, _runtime_state, _stats);
|
||||
if (_segment_reader == nullptr) {
|
||||
OLAP_LOG_WARNING("fail to malloc segment reader.");
|
||||
LOG(WARNING) << "fail to malloc segment reader.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -455,7 +455,7 @@ Status ColumnData::get_first_row_block(RowBlock** row_block) {
|
||||
_eof = true;
|
||||
return res;
|
||||
}
|
||||
OLAP_LOG_WARNING("fail to find first row block with SegmentGroup.");
|
||||
LOG(WARNING) << "fail to find first row block with SegmentGroup.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -564,7 +564,7 @@ Status ColumnData::schema_change_init() {
|
||||
|
||||
auto res = _cursor.init(_segment_group->get_tablet_schema());
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to init row_cursor");
|
||||
LOG(WARNING) << "fail to init row_cursor";
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -217,7 +217,7 @@ Status ColumnDataWriter::_flush_row_block(bool finalize) {
|
||||
|
||||
// 在SegmentGroup中记录的不是数据文件的偏移,而是block的编号
|
||||
if (!_segment_group->add_row_block(*_row_block, _block_id++)) {
|
||||
OLAP_LOG_WARNING("fail to update index.");
|
||||
LOG(WARNING) << "fail to update index.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_WRITER_INDEX_WRITE_ERROR);
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ Status ColumnDataWriter::_add_segment() {
|
||||
std::string file_name;
|
||||
|
||||
if (nullptr != _segment_writer) {
|
||||
OLAP_LOG_WARNING("previous segment is not finalized before add new segment.");
|
||||
LOG(WARNING) << "previous segment is not finalized before add new segment.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_WRITER_SEGMENT_NOT_FINALIZED);
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ Status ColumnDataWriter::_add_segment() {
|
||||
_compress_kind, _bloom_filter_fpp);
|
||||
|
||||
if (nullptr == _segment_writer) {
|
||||
OLAP_LOG_WARNING("fail to allocate SegmentWriter");
|
||||
LOG(WARNING) << "fail to allocate SegmentWriter";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ Status ColumnDataWriter::_add_segment() {
|
||||
}
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to init segment writer");
|
||||
LOG(WARNING) << "fail to init segment writer";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -285,12 +285,12 @@ Status ColumnDataWriter::_finalize_segment() {
|
||||
uint32_t data_segment_size;
|
||||
Status res = _segment_writer->finalize(&data_segment_size);
|
||||
if (res != Status::OK()) {
|
||||
OLAP_LOG_WARNING("fail to finish segment from olap_data.");
|
||||
LOG(WARNING) << "fail to finish segment from olap_data.";
|
||||
return res;
|
||||
}
|
||||
res = _segment_group->finalize_segment(data_segment_size, _num_rows);
|
||||
if (res != Status::OK()) {
|
||||
OLAP_LOG_WARNING("fail to finish segment from olap_index.");
|
||||
LOG(WARNING) << "fail to finish segment from olap_index.";
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ IntegerColumnReader::~IntegerColumnReader() {
|
||||
|
||||
Status IntegerColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* streams, bool is_sign) {
|
||||
if (nullptr == streams) {
|
||||
OLAP_LOG_WARNING("input streams is nullptr");
|
||||
LOG(WARNING) << "input streams is nullptr";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -42,14 +42,14 @@ Status IntegerColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* stre
|
||||
extract_stream(_column_unique_id, StreamInfoMessage::DATA, streams);
|
||||
|
||||
if (data_stream == nullptr) {
|
||||
OLAP_LOG_WARNING("specified stream is nullptr");
|
||||
LOG(WARNING) << "specified stream is nullptr";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
_data_reader = new (std::nothrow) RunLengthIntegerReader(data_stream, is_sign);
|
||||
|
||||
if (nullptr == _data_reader) {
|
||||
OLAP_LOG_WARNING("fail to malloc RunLengthIntegerReader");
|
||||
LOG(WARNING) << "fail to malloc RunLengthIntegerReader";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ StringColumnDirectReader::~StringColumnDirectReader() {
|
||||
Status StringColumnDirectReader::init(std::map<StreamName, ReadOnlyFileStream*>* streams, int size,
|
||||
MemPool* mem_pool) {
|
||||
if (nullptr == streams) {
|
||||
OLAP_LOG_WARNING("input streams is nullptr");
|
||||
LOG(WARNING) << "input streams is nullptr";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ Status StringColumnDirectReader::init(std::map<StreamName, ReadOnlyFileStream*>*
|
||||
_data_stream = extract_stream(_column_unique_id, StreamInfoMessage::DATA, streams);
|
||||
|
||||
if (nullptr == _data_stream) {
|
||||
OLAP_LOG_WARNING("specified stream not found. [unique_id = %u]", _column_unique_id);
|
||||
LOG(WARNING) << "specified stream not found. [unique_id = " << _column_unique_id << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
@ -101,14 +101,14 @@ Status StringColumnDirectReader::init(std::map<StreamName, ReadOnlyFileStream*>*
|
||||
extract_stream(_column_unique_id, StreamInfoMessage::LENGTH, streams);
|
||||
|
||||
if (nullptr == length_stream) {
|
||||
OLAP_LOG_WARNING("specified stream not found. [unique_id = %u]", _column_unique_id);
|
||||
LOG(WARNING) << "specified stream not found. [unique_id = " << _column_unique_id << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
_length_reader = new (std::nothrow) RunLengthIntegerReader(length_stream, false);
|
||||
|
||||
if (nullptr == _length_reader) {
|
||||
OLAP_LOG_WARNING("fail to malloc RunLengthIntegerReader");
|
||||
LOG(WARNING) << "fail to malloc RunLengthIntegerReader";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -288,7 +288,8 @@ Status StringColumnDictionaryReader::init(std::map<StreamName, ReadOnlyFileStrea
|
||||
extract_stream(_column_unique_id, StreamInfoMessage::DICTIONARY_DATA, streams);
|
||||
|
||||
if (nullptr == dictionary_data_stream) {
|
||||
OLAP_LOG_WARNING("dictionary data stream not found. [unique id = %u]", _column_unique_id);
|
||||
LOG(WARNING) << "dictionary data stream not found. [unique id = " << _column_unique_id
|
||||
<< "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
@ -296,7 +297,8 @@ Status StringColumnDictionaryReader::init(std::map<StreamName, ReadOnlyFileStrea
|
||||
extract_stream(_column_unique_id, StreamInfoMessage::LENGTH, streams);
|
||||
|
||||
if (nullptr == dictionary_length_stream) {
|
||||
OLAP_LOG_WARNING("dictionary length stream not found. [unique id = %u]", _column_unique_id);
|
||||
LOG(WARNING) << "dictionary length stream not found. [unique id = " << _column_unique_id
|
||||
<< "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
@ -309,7 +311,7 @@ Status StringColumnDictionaryReader::init(std::map<StreamName, ReadOnlyFileStrea
|
||||
char* _read_buffer = new (std::nothrow) char[read_buffer_size];
|
||||
|
||||
if (nullptr == _read_buffer) {
|
||||
OLAP_LOG_WARNING("fail to malloc read buffer. [size = %lu]", read_buffer_size);
|
||||
LOG(WARNING) << "fail to malloc read buffer. [size = " << read_buffer_size << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -330,7 +332,7 @@ Status StringColumnDictionaryReader::init(std::map<StreamName, ReadOnlyFileStrea
|
||||
read_buffer_size = length;
|
||||
|
||||
if (nullptr == (_read_buffer = new (std::nothrow) char[read_buffer_size])) {
|
||||
OLAP_LOG_WARNING("fail to malloc read buffer. [size = %lu]", read_buffer_size);
|
||||
LOG(WARNING) << "fail to malloc read buffer. [size = " << read_buffer_size << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
}
|
||||
@ -339,7 +341,7 @@ Status StringColumnDictionaryReader::init(std::map<StreamName, ReadOnlyFileStrea
|
||||
dictionary_data_stream->read(_read_buffer, &read_length);
|
||||
|
||||
if (static_cast<int64_t>(read_length) != length) {
|
||||
OLAP_LOG_WARNING("read stream fail.");
|
||||
LOG(WARNING) << "read stream fail.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_READ_STREAM);
|
||||
}
|
||||
|
||||
@ -352,14 +354,14 @@ Status StringColumnDictionaryReader::init(std::map<StreamName, ReadOnlyFileStrea
|
||||
extract_stream(_column_unique_id, StreamInfoMessage::DATA, streams);
|
||||
|
||||
if (nullptr == data_stream) {
|
||||
OLAP_LOG_WARNING("data stream not found. [unique id = %u]", _column_unique_id);
|
||||
LOG(WARNING) << "data stream not found. [unique id = " << _column_unique_id << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
_data_reader = new (std::nothrow) RunLengthIntegerReader(data_stream, false);
|
||||
|
||||
if (nullptr == _data_reader) {
|
||||
OLAP_LOG_WARNING("fail to malloc data reader");
|
||||
LOG(WARNING) << "fail to malloc data reader";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -389,10 +391,9 @@ Status StringColumnDictionaryReader::next(char* buffer, uint32_t* length) {
|
||||
}
|
||||
|
||||
if (value >= static_cast<int64_t>(_dictionary.size())) {
|
||||
OLAP_LOG_WARNING(
|
||||
"value may indicated an invalid dictionary entry. "
|
||||
"[value = %lu, dictionary_size = %lu]",
|
||||
value, _dictionary.size());
|
||||
LOG(WARNING) << "value may indicated an invalid dictionary entry. "
|
||||
"[value = "
|
||||
<< value << ", dictionary_size = " << _dictionary.size() << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_BUFFER_OVERFLOW);
|
||||
}
|
||||
|
||||
@ -416,10 +417,9 @@ Status StringColumnDictionaryReader::next_vector(ColumnVector* column_vector, ui
|
||||
return res;
|
||||
}
|
||||
if (index[i] >= static_cast<int64_t>(_dictionary.size())) {
|
||||
OLAP_LOG_WARNING(
|
||||
"value may indicated an invalid dictionary entry. "
|
||||
"[index = %lu, dictionary_size = %lu]",
|
||||
index[i], _dictionary.size());
|
||||
LOG(WARNING) << "value may indicated an invalid dictionary entry. "
|
||||
"[index = "
|
||||
<< index[i] << ", dictionary_size = " << _dictionary.size() << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_BUFFER_OVERFLOW);
|
||||
}
|
||||
_values[i].size = _dictionary[index[i]].size();
|
||||
@ -441,10 +441,9 @@ Status StringColumnDictionaryReader::next_vector(ColumnVector* column_vector, ui
|
||||
return res;
|
||||
}
|
||||
if (index[i] >= static_cast<int64_t>(_dictionary.size())) {
|
||||
OLAP_LOG_WARNING(
|
||||
"value may indicated an invalid dictionary entry. "
|
||||
"[index = %lu, dictionary_size = %lu]",
|
||||
index[i], _dictionary.size());
|
||||
LOG(WARNING) << "value may indicated an invalid dictionary entry. "
|
||||
"[index = "
|
||||
<< index[i] << ", dictionary_size = " << _dictionary.size() << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_BUFFER_OVERFLOW);
|
||||
}
|
||||
_values[i].size = _dictionary[index[i]].size();
|
||||
@ -510,7 +509,7 @@ ColumnReader* ColumnReader::create(uint32_t column_id, const std::vector<TabletC
|
||||
} else if (column.is_nullable()) {
|
||||
return new (std::nothrow) NullValueReader(column_id, column_unique_id);
|
||||
} else {
|
||||
OLAP_LOG_WARNING("not null field has no default value");
|
||||
LOG(WARNING) << "not null field has no default value";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
@ -591,9 +590,8 @@ ColumnReader* ColumnReader::create(uint32_t column_id, const std::vector<TabletC
|
||||
reader = new (std::nothrow) FixLengthStringColumnReader<StringColumnDictionaryReader>(
|
||||
column_id, column_unique_id, column.length(), dictionary_size);
|
||||
} else {
|
||||
OLAP_LOG_WARNING(
|
||||
"known encoding format. data may be generated by higher version,"
|
||||
"try updating olap/ngine binary to solve this problem");
|
||||
LOG(WARNING) << "known encoding format. data may be generated by higher version,try "
|
||||
"updating olap/ngine binary to solve this problem";
|
||||
// TODO. define a new return code
|
||||
return nullptr;
|
||||
}
|
||||
@ -662,7 +660,7 @@ ColumnReader::~ColumnReader() {
|
||||
Status ColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* streams, int size,
|
||||
MemPool* mem_pool, OlapReaderStatistics* stats) {
|
||||
if (nullptr == streams) {
|
||||
OLAP_LOG_WARNING("null parameters given.");
|
||||
LOG(WARNING) << "null parameters given.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
_stats = stats;
|
||||
@ -682,12 +680,12 @@ Status ColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* streams, in
|
||||
_present_reader = new (std::nothrow) BitFieldReader(present_stream);
|
||||
|
||||
if (nullptr == _present_reader) {
|
||||
OLAP_LOG_WARNING("malloc present reader failed.");
|
||||
LOG(WARNING) << "malloc present reader failed.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
if (!_present_reader->init()) {
|
||||
OLAP_LOG_WARNING("fail to init present reader.");
|
||||
LOG(WARNING) << "fail to init present reader.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INIT_FAILED);
|
||||
}
|
||||
|
||||
@ -764,7 +762,7 @@ TinyColumnReader::~TinyColumnReader() {
|
||||
Status TinyColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* streams, int size,
|
||||
MemPool* mem_pool, OlapReaderStatistics* stats) {
|
||||
if (nullptr == streams) {
|
||||
OLAP_LOG_WARNING("input streams is nullptr");
|
||||
LOG(WARNING) << "input streams is nullptr";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -773,7 +771,7 @@ Status TinyColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* streams
|
||||
extract_stream(_column_unique_id, StreamInfoMessage::DATA, streams);
|
||||
|
||||
if (nullptr == data_stream) {
|
||||
OLAP_LOG_WARNING("specified stream not exist");
|
||||
LOG(WARNING) << "specified stream not exist";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
@ -781,7 +779,7 @@ Status TinyColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* streams
|
||||
_data_reader = new (std::nothrow) RunLengthByteReader(data_stream);
|
||||
|
||||
if (nullptr == _data_reader) {
|
||||
OLAP_LOG_WARNING("malloc data reader failed");
|
||||
LOG(WARNING) << "malloc data reader failed";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -868,7 +866,7 @@ DecimalColumnReader::~DecimalColumnReader() {
|
||||
Status DecimalColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* streams, int size,
|
||||
MemPool* mem_pool, OlapReaderStatistics* stats) {
|
||||
if (nullptr == streams) {
|
||||
OLAP_LOG_WARNING("input streams is nullptr");
|
||||
LOG(WARNING) << "input streams is nullptr";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -882,7 +880,7 @@ Status DecimalColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* stre
|
||||
extract_stream(_column_unique_id, StreamInfoMessage::DATA, streams);
|
||||
|
||||
if (nullptr == int_stream) {
|
||||
OLAP_LOG_WARNING("specified stream not found. [unique_id = %u]", _column_unique_id);
|
||||
LOG(WARNING) << "specified stream not found. [unique_id = " << _column_unique_id << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
@ -890,21 +888,21 @@ Status DecimalColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* stre
|
||||
extract_stream(_column_unique_id, StreamInfoMessage::SECONDARY, streams);
|
||||
|
||||
if (nullptr == frac_stream) {
|
||||
OLAP_LOG_WARNING("specified stream not found. [unique_id = %u]", _column_unique_id);
|
||||
LOG(WARNING) << "specified stream not found. [unique_id = " << _column_unique_id << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
_int_reader = new (std::nothrow) RunLengthIntegerReader(int_stream, true);
|
||||
|
||||
if (nullptr == _int_reader) {
|
||||
OLAP_LOG_WARNING("fail to malloc RunLengthIntegerReader");
|
||||
LOG(WARNING) << "fail to malloc RunLengthIntegerReader";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
_frac_reader = new (std::nothrow) RunLengthIntegerReader(frac_stream, true);
|
||||
|
||||
if (nullptr == _frac_reader) {
|
||||
OLAP_LOG_WARNING("fail to malloc RunLengthIntegerReader");
|
||||
LOG(WARNING) << "fail to malloc RunLengthIntegerReader";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -950,14 +948,14 @@ Status DecimalColumnReader::skip(uint64_t row_count) {
|
||||
Status res = _int_reader->skip(row_count);
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to create int part reader");
|
||||
LOG(WARNING) << "fail to create int part reader";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = _frac_reader->skip(row_count);
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to create frac part reader");
|
||||
LOG(WARNING) << "fail to create frac part reader";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -982,14 +980,14 @@ Status DecimalColumnReader::next_vector(ColumnVector* column_vector, uint32_t si
|
||||
int64_t value = 0;
|
||||
Status res = _int_reader->next(&value);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to read decimal int part");
|
||||
LOG(WARNING) << "fail to read decimal int part";
|
||||
break;
|
||||
}
|
||||
_values[i].integer = value;
|
||||
|
||||
res = _frac_reader->next(&value);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to read decimal frac part");
|
||||
LOG(WARNING) << "fail to read decimal frac part";
|
||||
break;
|
||||
}
|
||||
_values[i].fraction = value;
|
||||
@ -1000,14 +998,14 @@ Status DecimalColumnReader::next_vector(ColumnVector* column_vector, uint32_t si
|
||||
if (!is_null[i]) {
|
||||
Status res = _int_reader->next(&value);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to read decimal int part");
|
||||
LOG(WARNING) << "fail to read decimal int part";
|
||||
break;
|
||||
}
|
||||
_values[i].integer = value;
|
||||
|
||||
res = _frac_reader->next(&value);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to read decimal frac part");
|
||||
LOG(WARNING) << "fail to read decimal frac part";
|
||||
break;
|
||||
}
|
||||
_values[i].fraction = value;
|
||||
@ -1034,7 +1032,7 @@ LargeIntColumnReader::~LargeIntColumnReader() {
|
||||
Status LargeIntColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* streams, int size,
|
||||
MemPool* mem_pool, OlapReaderStatistics* stats) {
|
||||
if (nullptr == streams) {
|
||||
OLAP_LOG_WARNING("input streams is nullptr");
|
||||
LOG(WARNING) << "input streams is nullptr";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -1048,26 +1046,26 @@ Status LargeIntColumnReader::init(std::map<StreamName, ReadOnlyFileStream*>* str
|
||||
ReadOnlyFileStream* high_stream =
|
||||
extract_stream(_column_unique_id, StreamInfoMessage::DATA, streams);
|
||||
if (nullptr == high_stream) {
|
||||
OLAP_LOG_WARNING("specified stream not found. [unique_id = %u]", _column_unique_id);
|
||||
LOG(WARNING) << "specified stream not found. [unique_id = " << _column_unique_id << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
ReadOnlyFileStream* low_stream =
|
||||
extract_stream(_column_unique_id, StreamInfoMessage::SECONDARY, streams);
|
||||
if (nullptr == low_stream) {
|
||||
OLAP_LOG_WARNING("specified stream not found. [unique_id = %u]", _column_unique_id);
|
||||
LOG(WARNING) << "specified stream not found. [unique_id = " << _column_unique_id << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
_high_reader = new (std::nothrow) RunLengthIntegerReader(high_stream, true);
|
||||
if (nullptr == _high_reader) {
|
||||
OLAP_LOG_WARNING("fail to malloc RunLengthIntegerReader.");
|
||||
LOG(WARNING) << "fail to malloc RunLengthIntegerReader.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
_low_reader = new (std::nothrow) RunLengthIntegerReader(low_stream, true);
|
||||
if (nullptr == _low_reader) {
|
||||
OLAP_LOG_WARNING("fail to malloc RunLengthIntegerReader.");
|
||||
LOG(WARNING) << "fail to malloc RunLengthIntegerReader.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -1090,7 +1088,7 @@ Status LargeIntColumnReader::seek(PositionProvider* positions) {
|
||||
//all field in the segment can be nullptr, so the data stream is EOF
|
||||
res = ColumnReader::seek(positions);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to seek null stream of largeint");
|
||||
LOG(WARNING) << "fail to seek null stream of largeint";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -1145,13 +1143,13 @@ Status LargeIntColumnReader::next_vector(ColumnVector* column_vector, uint32_t s
|
||||
value = (int64_t*)(_values + i);
|
||||
res = _high_reader->next(value);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to read decimal int part");
|
||||
LOG(WARNING) << "fail to read decimal int part";
|
||||
break;
|
||||
}
|
||||
|
||||
res = _low_reader->next(++value);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to read decimal frac part");
|
||||
LOG(WARNING) << "fail to read decimal frac part";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1162,13 +1160,13 @@ Status LargeIntColumnReader::next_vector(ColumnVector* column_vector, uint32_t s
|
||||
value = (int64_t*)(_values + i);
|
||||
res = _high_reader->next(value);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to read decimal int part");
|
||||
LOG(WARNING) << "fail to read decimal int part";
|
||||
break;
|
||||
}
|
||||
|
||||
res = _low_reader->next(++value);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to read decimal frac part");
|
||||
LOG(WARNING) << "fail to read decimal frac part";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -666,7 +666,7 @@ public:
|
||||
virtual Status init(std::map<StreamName, ReadOnlyFileStream*>* streams, int size,
|
||||
MemPool* mem_pool, OlapReaderStatistics* stats) {
|
||||
if (nullptr == streams) {
|
||||
OLAP_LOG_WARNING("input streams is nullptr");
|
||||
LOG(WARNING) << "input streams is nullptr";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -675,7 +675,7 @@ public:
|
||||
_data_stream = extract_stream(_column_unique_id, StreamInfoMessage::DATA, streams);
|
||||
|
||||
if (nullptr == _data_stream) {
|
||||
OLAP_LOG_WARNING("specified stream not exist");
|
||||
LOG(WARNING) << "specified stream not exist";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_STREAM_NOT_EXIST);
|
||||
}
|
||||
|
||||
@ -684,12 +684,12 @@ public:
|
||||
}
|
||||
virtual Status seek(PositionProvider* position) {
|
||||
if (nullptr == position) {
|
||||
OLAP_LOG_WARNING("input positions is nullptr");
|
||||
LOG(WARNING) << "input positions is nullptr";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
if (nullptr == _data_stream) {
|
||||
OLAP_LOG_WARNING("reader not init.");
|
||||
LOG(WARNING) << "reader not init.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_NOT_INITED);
|
||||
}
|
||||
|
||||
@ -716,7 +716,7 @@ public:
|
||||
}
|
||||
virtual Status skip(uint64_t row_count) {
|
||||
if (nullptr == _data_stream) {
|
||||
OLAP_LOG_WARNING("reader not init.");
|
||||
LOG(WARNING) << "reader not init.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_NOT_INITED);
|
||||
}
|
||||
|
||||
@ -726,7 +726,7 @@ public:
|
||||
|
||||
virtual Status next_vector(ColumnVector* column_vector, uint32_t size, MemPool* mem_pool) {
|
||||
if (nullptr == _data_stream) {
|
||||
OLAP_LOG_WARNING("reader not init.");
|
||||
LOG(WARNING) << "reader not init.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_NOT_INITED);
|
||||
}
|
||||
|
||||
|
||||
@ -157,19 +157,19 @@ Status ColumnWriter::init() {
|
||||
_stream_factory->create_stream(unique_column_id(), StreamInfoMessage::PRESENT);
|
||||
|
||||
if (nullptr == _is_present_stream) {
|
||||
OLAP_LOG_WARNING("fail to allocate IS PRESENT STREAM");
|
||||
LOG(WARNING) << "fail to allocate IS PRESENT STREAM";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
_is_present = new (std::nothrow) BitFieldWriter(_is_present_stream);
|
||||
|
||||
if (nullptr == _is_present) {
|
||||
OLAP_LOG_WARNING("fail to allocate IS PRESENT Writer");
|
||||
LOG(WARNING) << "fail to allocate IS PRESENT Writer";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
if (!_is_present->init()) {
|
||||
OLAP_LOG_WARNING("fail to init IS PRESENT Writer");
|
||||
LOG(WARNING) << "fail to init IS PRESENT Writer";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INIT_FAILED);
|
||||
}
|
||||
}
|
||||
@ -177,14 +177,14 @@ Status ColumnWriter::init() {
|
||||
Status res = _block_statistics.init(_column.type(), true);
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("init block statistic failed");
|
||||
LOG(WARNING) << "init block statistic failed";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = _segment_statistics.init(_column.type(), true);
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("init segment statistic failed");
|
||||
LOG(WARNING) << "init segment statistic failed";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ Status ColumnWriter::init() {
|
||||
_stream_factory->create_stream(unique_column_id(), StreamInfoMessage::ROW_INDEX);
|
||||
|
||||
if (nullptr == _index_stream) {
|
||||
OLAP_LOG_WARNING("fail to allocate Index STREAM");
|
||||
LOG(WARNING) << "fail to allocate Index STREAM";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -201,19 +201,19 @@ Status ColumnWriter::init() {
|
||||
_bf_index_stream =
|
||||
_stream_factory->create_stream(unique_column_id(), StreamInfoMessage::BLOOM_FILTER);
|
||||
if (nullptr == _bf_index_stream) {
|
||||
OLAP_LOG_WARNING("fail to allocate bloom filter index stream");
|
||||
LOG(WARNING) << "fail to allocate bloom filter index stream";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
_bf = new (std::nothrow) BloomFilter();
|
||||
if (nullptr == _bf) {
|
||||
OLAP_LOG_WARNING("fail to allocate bloom filter");
|
||||
LOG(WARNING) << "fail to allocate bloom filter";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
if (!_bf->init(_num_rows_per_row_block, _bf_fpp)) {
|
||||
OLAP_LOG_WARNING("fail to init bloom filter. num rows: %u, fpp: %g",
|
||||
_num_rows_per_row_block, _bf_fpp);
|
||||
LOG(WARNING) << "fail to init bloom filter. num rows: " << _num_rows_per_row_block
|
||||
<< ", fpp: " << _bf_fpp;
|
||||
return Status::OLAPInternalError(OLAP_ERR_INIT_FAILED);
|
||||
}
|
||||
}
|
||||
@ -270,13 +270,13 @@ Status ColumnWriter::create_row_index_entry() {
|
||||
|
||||
_bf = new (std::nothrow) BloomFilter();
|
||||
if (nullptr == _bf) {
|
||||
OLAP_LOG_WARNING("fail to allocate bloom filter");
|
||||
LOG(WARNING) << "fail to allocate bloom filter";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
if (!_bf->init(_num_rows_per_row_block, _bf_fpp)) {
|
||||
OLAP_LOG_WARNING("fail to init bloom filter. num rows: %u, fpp: %g",
|
||||
_num_rows_per_row_block, _bf_fpp);
|
||||
LOG(WARNING) << "fail to init bloom filter. num rows: " << _num_rows_per_row_block
|
||||
<< ", fpp: " << _bf_fpp;
|
||||
return Status::OLAPInternalError(OLAP_ERR_INIT_FAILED);
|
||||
}
|
||||
}
|
||||
@ -284,7 +284,7 @@ Status ColumnWriter::create_row_index_entry() {
|
||||
for (std::vector<ColumnWriter*>::iterator it = _sub_writers.begin(); it != _sub_writers.end();
|
||||
++it) {
|
||||
if (!(res = (*it)->create_row_index_entry())) {
|
||||
OLAP_LOG_WARNING("fail to create sub column's index.");
|
||||
LOG(WARNING) << "fail to create sub column's index.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -342,7 +342,7 @@ Status ColumnWriter::finalize(ColumnDataHeaderMessage* header) {
|
||||
ColumnMessage* column = nullptr;
|
||||
|
||||
if (!_index.write_to_buffer(index_buf, pb_size)) {
|
||||
OLAP_LOG_WARNING("fail to serialize index");
|
||||
LOG(WARNING) << "fail to serialize index";
|
||||
res = Status::OLAPInternalError(OLAP_ERR_SERIALIZE_PROTOBUF_ERROR);
|
||||
goto FINALIZE_EXIT;
|
||||
}
|
||||
@ -350,14 +350,14 @@ Status ColumnWriter::finalize(ColumnDataHeaderMessage* header) {
|
||||
res = _index_stream->write(index_buf, pb_size);
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write index to stream");
|
||||
LOG(WARNING) << "fail to write index to stream";
|
||||
goto FINALIZE_EXIT;
|
||||
}
|
||||
|
||||
res = _index_stream->flush();
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to flush index stream");
|
||||
LOG(WARNING) << "fail to flush index stream";
|
||||
goto FINALIZE_EXIT;
|
||||
}
|
||||
|
||||
@ -365,13 +365,13 @@ Status ColumnWriter::finalize(ColumnDataHeaderMessage* header) {
|
||||
if (is_bf_column()) {
|
||||
res = _bf_index.write_to_buffer(_bf_index_stream);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write bloom filter stream");
|
||||
LOG(WARNING) << "fail to write bloom filter stream";
|
||||
OLAP_GOTO(FINALIZE_EXIT);
|
||||
}
|
||||
|
||||
res = _bf_index_stream->flush();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to flush bloom filter stream");
|
||||
LOG(WARNING) << "fail to flush bloom filter stream";
|
||||
OLAP_GOTO(FINALIZE_EXIT);
|
||||
}
|
||||
}
|
||||
@ -448,14 +448,14 @@ Status ByteColumnWriter::init() {
|
||||
OutStream* stream = factory->create_stream(unique_column_id(), StreamInfoMessage::DATA);
|
||||
|
||||
if (nullptr == stream) {
|
||||
OLAP_LOG_WARNING("fail to allocate DATA STREAM");
|
||||
LOG(WARNING) << "fail to allocate DATA STREAM";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
_writer = new (std::nothrow) RunLengthByteWriter(stream);
|
||||
|
||||
if (nullptr == _writer) {
|
||||
OLAP_LOG_WARNING("fail to allocate RunLengthByteWriter");
|
||||
LOG(WARNING) << "fail to allocate RunLengthByteWriter";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -467,12 +467,12 @@ Status ByteColumnWriter::finalize(ColumnDataHeaderMessage* header) {
|
||||
Status res = Status::OK();
|
||||
|
||||
if (!(res = ColumnWriter::finalize(header))) {
|
||||
OLAP_LOG_WARNING("fail to finalize ColumnWriter.");
|
||||
LOG(WARNING) << "fail to finalize ColumnWriter.";
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!(res = _writer->flush())) {
|
||||
OLAP_LOG_WARNING("fail to flush.");
|
||||
LOG(WARNING) << "fail to flush.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -501,14 +501,14 @@ Status IntegerColumnWriter::init() {
|
||||
OutStream* stream = _stream_factory->create_stream(_unique_column_id, StreamInfoMessage::DATA);
|
||||
|
||||
if (nullptr == stream) {
|
||||
OLAP_LOG_WARNING("fail to allocate DATA STREAM");
|
||||
LOG(WARNING) << "fail to allocate DATA STREAM";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
_writer = new (std::nothrow) RunLengthIntegerWriter(stream, _is_signed);
|
||||
|
||||
if (nullptr == _writer) {
|
||||
OLAP_LOG_WARNING("fail to allocate RunLengthIntegerWriter");
|
||||
LOG(WARNING) << "fail to allocate RunLengthIntegerWriter";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -547,7 +547,7 @@ Status VarStringColumnWriter::init() {
|
||||
stream_factory()->create_stream(unique_column_id(), StreamInfoMessage::LENGTH);
|
||||
|
||||
if (nullptr == _dict_stream || nullptr == length_stream || nullptr == _data_stream) {
|
||||
OLAP_LOG_WARNING("fail to create stream.");
|
||||
LOG(WARNING) << "fail to create stream.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -555,7 +555,7 @@ Status VarStringColumnWriter::init() {
|
||||
_id_writer = new (std::nothrow) RunLengthIntegerWriter(_data_stream, false);
|
||||
|
||||
if (nullptr == _length_writer || nullptr == _id_writer) {
|
||||
OLAP_LOG_WARNING("fail to create writer.");
|
||||
LOG(WARNING) << "fail to create writer.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -569,12 +569,12 @@ Status VarStringColumnWriter::write(const char* str, uint32_t len) {
|
||||
//std::string key(str, len);
|
||||
|
||||
if (!(res = _data_stream->write(str, len))) {
|
||||
OLAP_LOG_WARNING("fail to write string content.");
|
||||
LOG(WARNING) << "fail to write string content.";
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!(res = _length_writer->write(len))) {
|
||||
OLAP_LOG_WARNING("fail to write string length.");
|
||||
LOG(WARNING) << "fail to write string length.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -600,12 +600,12 @@ Status VarStringColumnWriter::_finalize_dict_encoding() {
|
||||
res = _dict_stream->write(key.c_str(), key.length());
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write string dict to stream.");
|
||||
LOG(WARNING) << "fail to write string dict to stream.";
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!(res = _length_writer->write(key.length()))) {
|
||||
OLAP_LOG_WARNING("fail to write string length to stream.");
|
||||
LOG(WARNING) << "fail to write string length to stream.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -623,7 +623,7 @@ Status VarStringColumnWriter::_finalize_dict_encoding() {
|
||||
res = _id_writer->write(dump_order[_string_id[i]]);
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write string id to stream.");
|
||||
LOG(WARNING) << "fail to write string id to stream.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -652,13 +652,13 @@ Status VarStringColumnWriter::finalize(ColumnDataHeaderMessage* header) {
|
||||
if (_use_dictionary_encoding) {
|
||||
res = _finalize_dict_encoding();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to finalize dict encoding.");
|
||||
LOG(WARNING) << "fail to finalize dict encoding.";
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
res = _finalize_direct_encoding();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to finalize direct encoding.");
|
||||
LOG(WARNING) << "fail to finalize direct encoding.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -666,14 +666,14 @@ Status VarStringColumnWriter::finalize(ColumnDataHeaderMessage* header) {
|
||||
// The index's supplementary writing has been completed, ColumnWriter::finalize will write the header
|
||||
res = ColumnWriter::finalize(header);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to finalize ColumnWriter.");
|
||||
LOG(WARNING) << "fail to finalize ColumnWriter.";
|
||||
return res;
|
||||
}
|
||||
|
||||
// id_writer is practical to data_stream, it doesn't matter if you repeat flush
|
||||
if (!_length_writer->flush() || !_id_writer->flush() || !_dict_stream->flush() ||
|
||||
!_data_stream->flush()) {
|
||||
OLAP_LOG_WARNING("fail to flush stream.");
|
||||
LOG(WARNING) << "fail to flush stream.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_WRITER_DATA_WRITE_ERROR);
|
||||
}
|
||||
|
||||
@ -745,7 +745,7 @@ Status DecimalColumnWriter::init() {
|
||||
stream_factory()->create_stream(unique_column_id(), StreamInfoMessage::SECONDARY);
|
||||
|
||||
if (nullptr == int_stream || nullptr == frac_stream) {
|
||||
OLAP_LOG_WARNING("fail to create stream.");
|
||||
LOG(WARNING) << "fail to create stream.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -753,7 +753,7 @@ Status DecimalColumnWriter::init() {
|
||||
_frac_writer = new (std::nothrow) RunLengthIntegerWriter(frac_stream, true);
|
||||
|
||||
if (nullptr == _int_writer || nullptr == _frac_writer) {
|
||||
OLAP_LOG_WARNING("fail to create writer.");
|
||||
LOG(WARNING) << "fail to create writer.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -766,19 +766,19 @@ Status DecimalColumnWriter::finalize(ColumnDataHeaderMessage* header) {
|
||||
|
||||
res = ColumnWriter::finalize(header);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to finalize ColumnWriter.");
|
||||
LOG(WARNING) << "fail to finalize ColumnWriter.";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = _int_writer->flush();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to flush integer writer.");
|
||||
LOG(WARNING) << "fail to flush integer writer.";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = _frac_writer->flush();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to flush fraction writer.");
|
||||
LOG(WARNING) << "fail to flush fraction writer.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -819,7 +819,7 @@ Status LargeIntColumnWriter::init() {
|
||||
stream_factory()->create_stream(unique_column_id(), StreamInfoMessage::SECONDARY);
|
||||
|
||||
if (nullptr == high_stream || nullptr == low_stream) {
|
||||
OLAP_LOG_WARNING("fail to create stream.");
|
||||
LOG(WARNING) << "fail to create stream.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -827,7 +827,7 @@ Status LargeIntColumnWriter::init() {
|
||||
_low_writer = new (std::nothrow) RunLengthIntegerWriter(low_stream, true);
|
||||
|
||||
if (nullptr == _high_writer || nullptr == _low_writer) {
|
||||
OLAP_LOG_WARNING("fail to create writer.");
|
||||
LOG(WARNING) << "fail to create writer.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -840,19 +840,19 @@ Status LargeIntColumnWriter::finalize(ColumnDataHeaderMessage* header) {
|
||||
|
||||
res = ColumnWriter::finalize(header);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to finalize ColumnWriter.");
|
||||
LOG(WARNING) << "fail to finalize ColumnWriter.";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = _high_writer->flush();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to flush integer writer.");
|
||||
LOG(WARNING) << "fail to flush integer writer.";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = _low_writer->flush();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to flush fraction writer.");
|
||||
LOG(WARNING) << "fail to flush fraction writer.";
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ public:
|
||||
|
||||
Status res = ColumnWriter::write(cursor);
|
||||
if (OLAP_UNLIKELY(!res.ok())) {
|
||||
OLAP_LOG_WARNING("fail to write ColumnWriter.");
|
||||
LOG(WARNING) << "fail to write ColumnWriter.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -381,7 +381,7 @@ public:
|
||||
block->get_row(i, cursor);
|
||||
Status res = ColumnWriter::write(cursor);
|
||||
if (OLAP_UNLIKELY(!res.ok())) {
|
||||
OLAP_LOG_WARNING("fail to write ColumnWriter.");
|
||||
LOG(WARNING) << "fail to write ColumnWriter.";
|
||||
return res;
|
||||
}
|
||||
bool is_null = cursor->is_null(column_id());
|
||||
@ -455,7 +455,7 @@ public:
|
||||
|
||||
Status res = ColumnWriter::write(cursor);
|
||||
if (OLAP_UNLIKELY(!res.ok())) {
|
||||
OLAP_LOG_WARNING("fail to write ColumnWriter.");
|
||||
LOG(WARNING) << "fail to write ColumnWriter.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -501,7 +501,7 @@ public:
|
||||
block->get_row(i, cursor);
|
||||
Status res = ColumnWriter::write(cursor);
|
||||
if (OLAP_UNLIKELY(!res.ok())) {
|
||||
OLAP_LOG_WARNING("fail to write ColumnWriter.");
|
||||
LOG(WARNING) << "fail to write ColumnWriter.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -511,12 +511,12 @@ public:
|
||||
decimal12_t value = *reinterpret_cast<const decimal12_t*>(cell.cell_ptr());
|
||||
res = _int_writer->write(value.integer);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write integer of Decimal.");
|
||||
LOG(WARNING) << "fail to write integer of Decimal.";
|
||||
return res;
|
||||
}
|
||||
res = _frac_writer->write(value.fraction);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write fraction of Decimal.");
|
||||
LOG(WARNING) << "fail to write fraction of Decimal.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -547,7 +547,7 @@ public:
|
||||
block->get_row(i, cursor);
|
||||
Status res = ColumnWriter::write(cursor);
|
||||
if (OLAP_UNLIKELY(!res.ok())) {
|
||||
OLAP_LOG_WARNING("fail to write ColumnWriter.");
|
||||
LOG(WARNING) << "fail to write ColumnWriter.";
|
||||
return res;
|
||||
}
|
||||
auto cell = cursor->cell(column_id());
|
||||
@ -556,12 +556,12 @@ public:
|
||||
const int64_t* value = reinterpret_cast<const int64_t*>(cell.cell_ptr());
|
||||
res = _high_writer->write(*value);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write integer of LargeInt.");
|
||||
LOG(WARNING) << "fail to write integer of LargeInt.";
|
||||
return res;
|
||||
}
|
||||
res = _low_writer->write(*(++value));
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write fraction of LargeInt.");
|
||||
LOG(WARNING) << "fail to write fraction of LargeInt.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,25 +35,25 @@ Status RunLengthByteWriter::_write_values() {
|
||||
if (_repeat) {
|
||||
res = _output->write(_num_literals - MIN_REPEAT_SIZE);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write control byte.");
|
||||
LOG(WARNING) << "fail to write control byte.";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = _output->write(_literals[0]);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write repeat byte");
|
||||
LOG(WARNING) << "fail to write repeat byte";
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
res = _output->write(-_num_literals);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write control byte.");
|
||||
LOG(WARNING) << "fail to write control byte.";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = _output->write(_literals, _num_literals);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write literals bytes.");
|
||||
LOG(WARNING) << "fail to write literals bytes.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@ -331,7 +331,7 @@ Status RunLengthIntegerWriter::_write_short_repeat_values() {
|
||||
|
||||
res = _output->write((char*)&head, sizeof(head));
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write SHORT_REPEAT head.");
|
||||
LOG(WARNING) << "fail to write SHORT_REPEAT head.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -340,7 +340,7 @@ Status RunLengthIntegerWriter::_write_short_repeat_values() {
|
||||
char byte = (char)(((uint64_t)repeat_value >> (i * 8)) & 0xff);
|
||||
|
||||
if (!(res = _output->write(byte))) {
|
||||
OLAP_LOG_WARNING("fail to write SHORT_REPEAT data.");
|
||||
LOG(WARNING) << "fail to write SHORT_REPEAT data.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -359,13 +359,13 @@ Status RunLengthIntegerWriter::_write_direct_values() {
|
||||
|
||||
res = _output->write((char*)&head, sizeof(head));
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write DIRECT head.");
|
||||
LOG(WARNING) << "fail to write DIRECT head.";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = ser::write_ints(_output, _zig_zag_literals, _num_literals, _zz_bits_100p);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to write DIRECT data.");
|
||||
LOG(WARNING) << "fail to write DIRECT data.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -623,7 +623,7 @@ Status RunLengthIntegerWriter::write(int64_t value) {
|
||||
_determined_encoding();
|
||||
|
||||
if (!(res = _write_values())) {
|
||||
OLAP_LOG_WARNING("fail to write values.");
|
||||
LOG(WARNING) << "fail to write values.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -637,7 +637,7 @@ Status RunLengthIntegerWriter::write(int64_t value) {
|
||||
_determined_encoding();
|
||||
|
||||
if (!(res = _write_values())) {
|
||||
OLAP_LOG_WARNING("fail to write values.");
|
||||
LOG(WARNING) << "fail to write values.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -656,7 +656,7 @@ Status RunLengthIntegerWriter::write(int64_t value) {
|
||||
}
|
||||
|
||||
if (!(res = _write_values())) {
|
||||
OLAP_LOG_WARNING("fail to write values.");
|
||||
LOG(WARNING) << "fail to write values.";
|
||||
return res;
|
||||
}
|
||||
} else if (_fixed_run_length > 0) {
|
||||
@ -679,7 +679,7 @@ Status RunLengthIntegerWriter::write(int64_t value) {
|
||||
_determined_encoding();
|
||||
|
||||
if (!(res = _write_values())) {
|
||||
OLAP_LOG_WARNING("fail to write values.");
|
||||
LOG(WARNING) << "fail to write values.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -710,7 +710,7 @@ Status RunLengthIntegerWriter::flush() {
|
||||
}
|
||||
|
||||
if (!(res = _write_values())) {
|
||||
OLAP_LOG_WARNING("fail to write values.");
|
||||
LOG(WARNING) << "fail to write values.";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,19 +41,19 @@ using std::vector;
|
||||
|
||||
namespace doris {
|
||||
|
||||
#define SEGMENT_GROUP_PARAM_VALIDATE() \
|
||||
do { \
|
||||
if (!_index_loaded) { \
|
||||
OLAP_LOG_WARNING("fail to find, index is not loaded. [segment_group_id=%d]", \
|
||||
_segment_group_id); \
|
||||
return Status::OLAPInternalError(OLAP_ERR_NOT_INITED); \
|
||||
} \
|
||||
#define SEGMENT_GROUP_PARAM_VALIDATE() \
|
||||
do { \
|
||||
if (!_index_loaded) { \
|
||||
LOG(WARNING) << "fail to find, index is not loaded. [segment_group_id=" \
|
||||
<< _segment_group_id << "]"; \
|
||||
return Status::OLAPInternalError(OLAP_ERR_NOT_INITED); \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define POS_PARAM_VALIDATE(pos) \
|
||||
do { \
|
||||
if (nullptr == pos) { \
|
||||
OLAP_LOG_WARNING("fail to find, nullptr position parameter."); \
|
||||
LOG(WARNING) << "fail to find, nullptr position parameter."; \
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR); \
|
||||
} \
|
||||
} while (0);
|
||||
@ -61,7 +61,7 @@ namespace doris {
|
||||
#define SLICE_PARAM_VALIDATE(slice) \
|
||||
do { \
|
||||
if (nullptr == slice) { \
|
||||
OLAP_LOG_WARNING("fail to find, nullptr slice parameter."); \
|
||||
LOG(WARNING) << "fail to find, nullptr slice parameter."; \
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR); \
|
||||
} \
|
||||
} while (0);
|
||||
@ -591,13 +591,13 @@ Status SegmentGroup::add_segment() {
|
||||
if (_short_key_buf == nullptr) {
|
||||
_short_key_buf = new (std::nothrow) char[_short_key_length];
|
||||
if (_short_key_buf == nullptr) {
|
||||
OLAP_LOG_WARNING("malloc short_key_buf error.");
|
||||
LOG(WARNING) << "malloc short_key_buf error.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
memset(_short_key_buf, 0, _short_key_length);
|
||||
if (_current_index_row.init(*_schema) != Status::OK()) {
|
||||
OLAP_LOG_WARNING("init _current_index_row fail.");
|
||||
LOG(WARNING) << "init _current_index_row fail.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INIT_FAILED);
|
||||
}
|
||||
}
|
||||
@ -638,13 +638,13 @@ Status SegmentGroup::add_short_key(const RowCursor& short_key, const uint32_t da
|
||||
|
||||
// 准备FileHeader
|
||||
if ((res = _file_header.prepare(&_current_file_handler)) != Status::OK()) {
|
||||
OLAP_LOG_WARNING("write file header error. [err=%m]");
|
||||
LOG(WARNING) << "write file header error. [err=" << Errno::str() << "]";
|
||||
return res;
|
||||
}
|
||||
|
||||
// 跳过FileHeader
|
||||
if (_current_file_handler.seek(_file_header.size(), SEEK_SET) == -1) {
|
||||
OLAP_LOG_WARNING("lseek header file error. [err=%m]");
|
||||
LOG(WARNING) << "lseek header file error. [err=" << Errno::str() << "]";
|
||||
res = Status::OLAPInternalError(OLAP_ERR_IO_ERROR);
|
||||
return res;
|
||||
}
|
||||
@ -662,14 +662,14 @@ Status SegmentGroup::add_short_key(const RowCursor& short_key, const uint32_t da
|
||||
|
||||
// 写入Short Key对应的数据
|
||||
if ((res = _current_file_handler.write(_short_key_buf, _short_key_length)) != Status::OK()) {
|
||||
OLAP_LOG_WARNING("write short key failed. [err=%m]");
|
||||
LOG(WARNING) << "write short key failed. [err=" << Errno::str() << "]";
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// 写入对应的数据文件偏移量
|
||||
if ((res = _current_file_handler.write(&data_offset, sizeof(data_offset))) != Status::OK()) {
|
||||
OLAP_LOG_WARNING("write data_offset failed. [err=%m]");
|
||||
LOG(WARNING) << "write data_offset failed. [err=" << Errno::str() << "]";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -697,7 +697,7 @@ Status SegmentGroup::finalize_segment(uint32_t data_segment_size, int64_t num_ro
|
||||
|
||||
// 写入更新之后的FileHeader
|
||||
if ((res = _file_header.serialize(&_current_file_handler)) != Status::OK()) {
|
||||
OLAP_LOG_WARNING("write file header error. [err=%m]");
|
||||
LOG(WARNING) << "write file header error. [err=" << Errno::str() << "]";
|
||||
|
||||
return res;
|
||||
}
|
||||
@ -706,7 +706,7 @@ Status SegmentGroup::finalize_segment(uint32_t data_segment_size, int64_t num_ro
|
||||
<< ", file_length=" << file_length;
|
||||
|
||||
if ((res = _current_file_handler.close()) != Status::OK()) {
|
||||
OLAP_LOG_WARNING("close file error. [err=%m]");
|
||||
LOG(WARNING) << "close file error. [err=" << Errno::str() << "]";
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -99,16 +99,15 @@ SegmentReader::~SegmentReader() {
|
||||
|
||||
Status SegmentReader::_check_file_version() {
|
||||
if (_header_message().magic_string().compare("COLUMN DATA") != 0) {
|
||||
OLAP_LOG_WARNING("not valid column data file, [magic_string = %s]",
|
||||
_header_message().magic_string().c_str());
|
||||
LOG(WARNING) << "not valid column data file, [magic_string = "
|
||||
<< _header_message().magic_string() << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_FILE_FORMAT_ERROR);
|
||||
}
|
||||
|
||||
if (_header_message().version() > CURRENT_COLUMN_DATA_VERSION) {
|
||||
OLAP_LOG_WARNING(
|
||||
"this file may generated by olap/ngine of higher version. "
|
||||
"reading it would cause some unexpected error, [found version = %d]",
|
||||
_header_message().version());
|
||||
LOG(WARNING) << "this file may generated by olap/ngine of higher version. "
|
||||
"reading it would cause some unexpected error, [found version = "
|
||||
<< _header_message().version() << "]";
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
@ -131,7 +130,7 @@ Status SegmentReader::_load_segment_file() {
|
||||
|
||||
res = _check_file_version();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("file header corrupted or generated by higher version olap/ngine.");
|
||||
LOG(WARNING) << "file header corrupted or generated by higher version olap/ngine.";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -140,7 +139,7 @@ Status SegmentReader::_load_segment_file() {
|
||||
_mmap_buffer = StorageByteBuffer::mmap(&_file_handler, 0, PROT_READ, MAP_PRIVATE);
|
||||
|
||||
if (nullptr == _mmap_buffer) {
|
||||
OLAP_LOG_WARNING("fail to call mmap, using default mode");
|
||||
LOG(WARNING) << "fail to call mmap, using default mode";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
}
|
||||
@ -165,7 +164,7 @@ Status SegmentReader::_set_decompressor() {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
OLAP_LOG_WARNING("unknown decompressor");
|
||||
LOG(WARNING) << "unknown decompressor";
|
||||
return Status::OLAPInternalError(OLAP_ERR_PARSE_PROTOBUF_ERROR);
|
||||
}
|
||||
}
|
||||
@ -181,7 +180,7 @@ Status SegmentReader::_set_segment_info() {
|
||||
_set_column_map();
|
||||
Status res = _set_decompressor();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to get decompressor.");
|
||||
LOG(WARNING) << "fail to get decompressor.";
|
||||
return res;
|
||||
}
|
||||
return Status::OK();
|
||||
@ -193,32 +192,32 @@ Status SegmentReader::init(bool is_using_cache) {
|
||||
Status res = Status::OK();
|
||||
res = _load_segment_file();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to load segment file. ");
|
||||
LOG(WARNING) << "fail to load segment file. ";
|
||||
return res;
|
||||
}
|
||||
// File header
|
||||
res = _set_segment_info();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to set segment info. ");
|
||||
LOG(WARNING) << "fail to set segment info. ";
|
||||
return res;
|
||||
}
|
||||
|
||||
_shared_buffer =
|
||||
StorageByteBuffer::create(_header_message().stream_buffer_size() + sizeof(StreamHead));
|
||||
if (_shared_buffer == nullptr) {
|
||||
OLAP_LOG_WARNING("fail to create shared buffer. [size=%lu]", sizeof(StorageByteBuffer));
|
||||
LOG(WARNING) << "fail to create shared buffer. [size=" << sizeof(StorageByteBuffer) << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
res = _pick_columns();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to pick columns");
|
||||
LOG(WARNING) << "fail to pick columns";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = _load_index(is_using_cache);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to load index stream");
|
||||
LOG(WARNING) << "fail to load index stream";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -233,13 +232,13 @@ Status SegmentReader::seek_to_block(uint32_t first_block, uint32_t last_block, b
|
||||
_reset_readers();
|
||||
res = _read_all_data_streams(&_buffer_size);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to read data stream");
|
||||
LOG(WARNING) << "fail to read data stream";
|
||||
return res;
|
||||
}
|
||||
|
||||
Status res = _create_reader(&_buffer_size);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to create reader");
|
||||
LOG(WARNING) << "fail to create reader";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -261,7 +260,7 @@ Status SegmentReader::seek_to_block(uint32_t first_block, uint32_t last_block, b
|
||||
_remain_block = last_block - first_block + 1;
|
||||
res = _pick_row_groups(first_block, last_block);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to pick row groups");
|
||||
LOG(WARNING) << "fail to pick row groups";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -431,7 +430,7 @@ Status SegmentReader::_init_include_blocks(uint32_t first_block, uint32_t last_b
|
||||
if (nullptr == _include_blocks) {
|
||||
_include_blocks = new (std::nothrow) uint8_t[_block_count];
|
||||
if (nullptr == _include_blocks) {
|
||||
OLAP_LOG_WARNING("fail to malloc include block array");
|
||||
LOG(WARNING) << "fail to malloc include block array";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
}
|
||||
@ -446,8 +445,8 @@ Status SegmentReader::_pick_row_groups(uint32_t first_block, uint32_t last_block
|
||||
VLOG_TRACE << "pick from " << first_block << " to " << last_block;
|
||||
|
||||
if (first_block > last_block) {
|
||||
OLAP_LOG_WARNING("invalid block offset. [first_block=%u last_block=%u]", first_block,
|
||||
last_block);
|
||||
LOG(WARNING) << "invalid block offset. [first_block=" << first_block
|
||||
<< " last_block=" << last_block << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -619,10 +618,9 @@ Status SegmentReader::_load_index(bool is_using_cache) {
|
||||
// 2. If it is not in lru, you need to create an index stream.
|
||||
stream_buffer = new (std::nothrow) char[stream_length];
|
||||
if (nullptr == stream_buffer) {
|
||||
OLAP_LOG_WARNING(
|
||||
"fail to malloc index stream. "
|
||||
"[column_unique_id = %u, offset = %lu]",
|
||||
unique_column_id, stream_offset);
|
||||
LOG(WARNING) << "fail to malloc index stream. "
|
||||
"[column_unique_id = "
|
||||
<< unique_column_id << ", offset = " << stream_offset << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -630,7 +628,7 @@ Status SegmentReader::_load_index(bool is_using_cache) {
|
||||
stream.reset(stream_offset, stream_length);
|
||||
res = stream.read_all(stream_buffer, &read_length);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("read index fail");
|
||||
LOG(WARNING) << "read index fail";
|
||||
return Status::OLAPInternalError(OLAP_ERR_FILE_FORMAT_ERROR);
|
||||
}
|
||||
|
||||
@ -649,14 +647,14 @@ Status SegmentReader::_load_index(bool is_using_cache) {
|
||||
if (message.kind() == StreamInfoMessage::ROW_INDEX) {
|
||||
StreamIndexReader* index_message = new (std::nothrow) StreamIndexReader;
|
||||
if (index_message == nullptr) {
|
||||
OLAP_LOG_WARNING("fail to malloc memory. [size=%lu]", sizeof(StreamIndexReader));
|
||||
LOG(WARNING) << "fail to malloc memory. [size=" << sizeof(StreamIndexReader) << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
res = index_message->init(stream_buffer, stream_length, type, is_using_cache,
|
||||
_null_supported);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("init index from cache fail");
|
||||
LOG(WARNING) << "init index from cache fail";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -667,8 +665,8 @@ Status SegmentReader::_load_index(bool is_using_cache) {
|
||||
} else {
|
||||
BloomFilterIndexReader* bf_message = new (std::nothrow) BloomFilterIndexReader;
|
||||
if (bf_message == nullptr) {
|
||||
OLAP_LOG_WARNING("fail to malloc memory. [size=%lu]",
|
||||
sizeof(BloomFilterIndexReader));
|
||||
LOG(WARNING) << "fail to malloc memory. [size=" << sizeof(BloomFilterIndexReader)
|
||||
<< "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -734,13 +732,13 @@ Status SegmentReader::_read_all_data_streams(size_t* buffer_size) {
|
||||
&_file_handler, &_shared_buffer, stream_offset, stream_length, _decompressor,
|
||||
_header_message().stream_buffer_size(), _stats));
|
||||
if (stream == nullptr) {
|
||||
OLAP_LOG_WARNING("fail to create stream");
|
||||
LOG(WARNING) << "fail to create stream";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
Status res = stream->init();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to init stream");
|
||||
LOG(WARNING) << "fail to init stream";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -761,13 +759,13 @@ Status SegmentReader::_create_reader(size_t* buffer_size) {
|
||||
table_column_id, _segment_group->get_tablet_schema(), _unique_id_to_tablet_id_map,
|
||||
_unique_id_to_segment_id_map, _encodings_map));
|
||||
if (reader == nullptr) {
|
||||
OLAP_LOG_WARNING("fail to create reader");
|
||||
LOG(WARNING) << "fail to create reader";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
auto res = reader->init(&_streams, _num_rows_in_block, _mem_pool.get(), _stats);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to init reader");
|
||||
LOG(WARNING) << "fail to init reader";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -803,11 +801,11 @@ Status SegmentReader::_seek_to_block_directly(int64_t block_id, const std::vecto
|
||||
<< ", block_id=" << block_id;
|
||||
return Status::OLAPInternalError(OLAP_ERR_DATA_EOF);
|
||||
} else {
|
||||
OLAP_LOG_WARNING(
|
||||
"fail to seek to block. "
|
||||
"[tablet_id=%ld column_id=%u block_id=%lu]",
|
||||
_segment_group->get_tablet_id(), _column_readers[cid]->column_unique_id(),
|
||||
block_id);
|
||||
LOG(WARNING) << "fail to seek to block. "
|
||||
"[tablet_id="
|
||||
<< _segment_group->get_tablet_id()
|
||||
<< " column_id=" << _column_readers[cid]->column_unique_id()
|
||||
<< " block_id=" << block_id << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_COLUMN_SEEK_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ Status SegmentWriter::init(uint32_t write_mbytes_per_sec) {
|
||||
_stream_factory = new (std::nothrow) OutStreamFactory(_compress_kind, _stream_buffer_size);
|
||||
|
||||
if (nullptr == _stream_factory) {
|
||||
OLAP_LOG_WARNING("fail to allocate out stream factory");
|
||||
LOG(WARNING) << "fail to allocate out stream factory";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ Status SegmentWriter::init(uint32_t write_mbytes_per_sec) {
|
||||
_segment_group->get_num_rows_per_row_block(), _bloom_filter_fpp);
|
||||
|
||||
if (nullptr == writer) {
|
||||
OLAP_LOG_WARNING("fail to create writer");
|
||||
LOG(WARNING) << "fail to create writer";
|
||||
return Status::OLAPInternalError(OLAP_ERR_MALLOC_ERROR);
|
||||
} else {
|
||||
_root_writers.push_back(writer);
|
||||
@ -244,13 +244,13 @@ Status SegmentWriter::finalize(uint32_t* segment_file_size) {
|
||||
|
||||
res = file_header.prepare(&file_handle);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("write file header error. [err=%m]");
|
||||
LOG(WARNING) << "write file header error. [err=" << Errno::str() << "]";
|
||||
return res;
|
||||
}
|
||||
|
||||
// 跳过FileHeader
|
||||
if (-1 == file_handle.seek(file_header.size(), SEEK_SET)) {
|
||||
OLAP_LOG_WARNING("lseek header file error. [err=%m]");
|
||||
LOG(WARNING) << "lseek header file error. [err=" << Errno::str() << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_IO_ERROR);
|
||||
}
|
||||
|
||||
@ -282,13 +282,13 @@ Status SegmentWriter::finalize(uint32_t* segment_file_size) {
|
||||
// 写入更新之后的FileHeader
|
||||
res = file_header.serialize(&file_handle);
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("write file header error. [err=%m]");
|
||||
LOG(WARNING) << "write file header error. [err=" << Errno::str() << "]";
|
||||
return res;
|
||||
}
|
||||
|
||||
res = file_handle.close();
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to close file. [err=%m]");
|
||||
LOG(WARNING) << "fail to close file. [err=" << Errno::str() << "]";
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ StreamIndexReader::~StreamIndexReader() {
|
||||
Status StreamIndexReader::init(char* buffer, size_t buffer_size, FieldType type,
|
||||
bool is_using_cache, bool null_supported) {
|
||||
if (nullptr == buffer) {
|
||||
OLAP_LOG_WARNING("buffer given is invalid.");
|
||||
LOG(WARNING) << "buffer given is invalid.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ Status StreamIndexReader::init(char* buffer, size_t buffer_size, FieldType type,
|
||||
Status res = _parse_header(type);
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to parse header");
|
||||
LOG(WARNING) << "fail to parse header";
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ size_t StreamIndexReader::entry_count() {
|
||||
|
||||
Status StreamIndexReader::_parse_header(FieldType type) {
|
||||
if (_buffer_size < sizeof(StreamIndexHeader)) {
|
||||
OLAP_LOG_WARNING("invalid length");
|
||||
LOG(WARNING) << "invalid length";
|
||||
return Status::OLAPInternalError(OLAP_ERR_OUT_OF_BOUND);
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ Status StreamIndexReader::_parse_header(FieldType type) {
|
||||
res = _entry.init(header, type, _null_supported);
|
||||
|
||||
if (!res.ok()) {
|
||||
OLAP_LOG_WARNING("fail to init statistic reader");
|
||||
LOG(WARNING) << "fail to init statistic reader";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INIT_FAILED);
|
||||
}
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ Status StreamIndexWriter::add_index_entry(const PositionEntryWriter& entry) {
|
||||
try {
|
||||
_index_to_write.push_back(entry);
|
||||
} catch (...) {
|
||||
OLAP_LOG_WARNING("add entry to index vector fail");
|
||||
LOG(WARNING) << "add entry to index vector fail";
|
||||
return Status::OLAPInternalError(OLAP_ERR_STL_ERROR);
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ Status StreamIndexWriter::reset() {
|
||||
try {
|
||||
_index_to_write.clear();
|
||||
} catch (...) {
|
||||
OLAP_LOG_WARNING("add entry to index vector fail");
|
||||
LOG(WARNING) << "add entry to index vector fail";
|
||||
return Status::OLAPInternalError(OLAP_ERR_STL_ERROR);
|
||||
}
|
||||
|
||||
@ -137,12 +137,12 @@ size_t StreamIndexWriter::output_size() {
|
||||
|
||||
Status StreamIndexWriter::write_to_buffer(char* buffer, size_t buffer_size) {
|
||||
if (nullptr == buffer) {
|
||||
OLAP_LOG_WARNING("given buffer is null");
|
||||
LOG(WARNING) << "given buffer is null";
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
if (output_size() > buffer_size) {
|
||||
OLAP_LOG_WARNING("need more buffer, size=%lu, given=%lu", output_size(), buffer_size);
|
||||
LOG(WARNING) << "need more buffer, size=" << output_size() << ", given=" << buffer_size;
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@ -271,7 +271,7 @@ uint32_t TabletColumn::get_field_length_by_type(TPrimitiveType::type type, uint3
|
||||
case TPrimitiveType::DECIMALV2:
|
||||
return 12; // use 12 bytes in olap engine.
|
||||
default:
|
||||
OLAP_LOG_WARNING("unknown field type. [type=%d]", type);
|
||||
LOG(WARNING) << "unknown field type. [type=" << type << "]";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ Status EngineBatchLoadTask::execute() {
|
||||
status = _process();
|
||||
// Internal error, need retry
|
||||
if (!status.ok()) {
|
||||
OLAP_LOG_WARNING("push internal error, need retry.signature: %ld", _signature);
|
||||
LOG(WARNING) << "push internal error, need retry.signature: " << _signature;
|
||||
retry_time += 1;
|
||||
} else {
|
||||
break;
|
||||
|
||||
@ -43,14 +43,14 @@ Status EngineChecksumTask::_compute_checksum() {
|
||||
Status res = Status::OK();
|
||||
|
||||
if (_checksum == nullptr) {
|
||||
OLAP_LOG_WARNING("invalid output parameter which is null pointer.");
|
||||
LOG(WARNING) << "invalid output parameter which is null pointer.";
|
||||
return Status::OLAPInternalError(OLAP_ERR_CE_CMD_PARAMS_ERROR);
|
||||
}
|
||||
|
||||
TabletSharedPtr tablet = StorageEngine::instance()->tablet_manager()->get_tablet(_tablet_id);
|
||||
if (nullptr == tablet.get()) {
|
||||
OLAP_LOG_WARNING("can't find tablet. [tablet_id=%ld schema_hash=%d]", _tablet_id,
|
||||
_schema_hash);
|
||||
LOG(WARNING) << "can't find tablet. [tablet_id=" << _tablet_id
|
||||
<< " schema_hash=" << _schema_hash << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_TABLE_NOT_FOUND);
|
||||
}
|
||||
|
||||
|
||||
@ -61,9 +61,8 @@ namespace doris {
|
||||
Status olap_compress(const char* src_buf, size_t src_len, char* dest_buf, size_t dest_len,
|
||||
size_t* written_len, OLAPCompressionType compression_type) {
|
||||
if (nullptr == src_buf || nullptr == dest_buf || nullptr == written_len) {
|
||||
OLAP_LOG_WARNING(
|
||||
"input param with nullptr pointer. [src_buf=%p dest_buf=%p written_len=%p]",
|
||||
src_buf, dest_buf, written_len);
|
||||
LOG(WARNING) << "input param with nullptr pointer. [src_buf=" << src_buf
|
||||
<< " dest_buf=" << dest_buf << " written_len=" << written_len << "]";
|
||||
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
@ -123,7 +122,7 @@ Status olap_compress(const char* src_buf, size_t src_len, char* dest_buf, size_t
|
||||
break;
|
||||
}
|
||||
default:
|
||||
OLAP_LOG_WARNING("unknown compression type. [type=%d]", compression_type);
|
||||
LOG(WARNING) << "unknown compression type. [type=" << compression_type << "]";
|
||||
break;
|
||||
}
|
||||
return Status::OK();
|
||||
@ -132,9 +131,8 @@ Status olap_compress(const char* src_buf, size_t src_len, char* dest_buf, size_t
|
||||
Status olap_decompress(const char* src_buf, size_t src_len, char* dest_buf, size_t dest_len,
|
||||
size_t* written_len, OLAPCompressionType compression_type) {
|
||||
if (nullptr == src_buf || nullptr == dest_buf || nullptr == written_len) {
|
||||
OLAP_LOG_WARNING(
|
||||
"input param with nullptr pointer. [src_buf=%p dest_buf=%p written_len=%p]",
|
||||
src_buf, dest_buf, written_len);
|
||||
LOG(WARNING) << "input param with nullptr pointer. [src_buf=" << src_buf
|
||||
<< " dest_buf=" << dest_buf << " written_len=" << written_len << "]";
|
||||
|
||||
return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
|
||||
}
|
||||
@ -151,9 +149,8 @@ Status olap_decompress(const char* src_buf, size_t src_len, char* dest_buf, size
|
||||
<< "; written_len=" << *written_len << "; lzo_res=" << lzo_res;
|
||||
return Status::OLAPInternalError(OLAP_ERR_DECOMPRESS_ERROR);
|
||||
} else if (*written_len > dest_len) {
|
||||
OLAP_LOG_WARNING("buffer overflow when decompressing. [dest_len=%lu written_len=%lu]",
|
||||
dest_len, *written_len);
|
||||
|
||||
LOG(WARNING) << "buffer overflow when decompressing. [dest_len=" << dest_len
|
||||
<< " written_len=" << *written_len << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_BUFFER_OVERFLOW);
|
||||
}
|
||||
break;
|
||||
@ -167,9 +164,8 @@ Status olap_decompress(const char* src_buf, size_t src_len, char* dest_buf, size
|
||||
<< "; written_len=" << *written_len << "; lzo_res=" << lzo_res;
|
||||
return Status::OLAPInternalError(OLAP_ERR_DECOMPRESS_ERROR);
|
||||
} else if (*written_len > dest_len) {
|
||||
OLAP_LOG_WARNING("buffer overflow when decompressing. [dest_len=%lu written_len=%lu]",
|
||||
dest_len, *written_len);
|
||||
|
||||
LOG(WARNING) << "buffer overflow when decompressing. [dest_len=" << dest_len
|
||||
<< " written_len=" << *written_len << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_BUFFER_OVERFLOW);
|
||||
}
|
||||
break;
|
||||
@ -556,12 +552,12 @@ Status gen_timestamp_string(string* out_string) {
|
||||
tm local_tm;
|
||||
|
||||
if (localtime_r(&now, &local_tm) == nullptr) {
|
||||
OLAP_LOG_WARNING("fail to localtime_r time. [time=%lu]", now);
|
||||
LOG(WARNING) << "fail to localtime_r time. [time=" << now << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_OS_ERROR);
|
||||
}
|
||||
char time_suffix[16] = {0}; // Example: 20150706111404, 长度是15个字符
|
||||
if (strftime(time_suffix, sizeof(time_suffix), "%Y%m%d%H%M%S", &local_tm) == 0) {
|
||||
OLAP_LOG_WARNING("fail to strftime time. [time=%lu]", now);
|
||||
LOG(WARNING) << "fail to strftime time. [time=" << now << "]";
|
||||
return Status::OLAPInternalError(OLAP_ERR_OS_ERROR);
|
||||
}
|
||||
|
||||
@ -667,7 +663,7 @@ const char* Errno::str() {
|
||||
|
||||
const char* Errno::str(int no) {
|
||||
if (0 != strerror_r(no, _buf, BUF_SIZE)) {
|
||||
OLAP_LOG_WARNING("fail to get errno string. [no='%d', errno='%d']", no, errno);
|
||||
LOG(WARNING) << "fail to get errno string. [no='" << no << "', errno='" << errno << "']";
|
||||
snprintf(_buf, BUF_SIZE, "unknown errno");
|
||||
}
|
||||
|
||||
@ -754,46 +750,46 @@ bool valid_datetime(const string& value_str) {
|
||||
|
||||
if (std::regex_match(value_str, what, e)) {
|
||||
if (what[0].str().size() != value_str.size()) {
|
||||
OLAP_LOG_WARNING("datetime str does not fully match. [value_str=%s match=%s]",
|
||||
value_str.c_str(), what[0].str().c_str());
|
||||
LOG(WARNING) << "datetime str does not fully match. [value_str=" << value_str
|
||||
<< " match=" << what[0].str() << "]";
|
||||
return false;
|
||||
}
|
||||
|
||||
int month = strtol(what[2].str().c_str(), nullptr, 10);
|
||||
if (month < 1 || month > 12) {
|
||||
OLAP_LOG_WARNING("invalid month. [month=%d]", month);
|
||||
LOG(WARNING) << "invalid month. [month=" << month << "]";
|
||||
return false;
|
||||
}
|
||||
|
||||
int day = strtol(what[3].str().c_str(), nullptr, 10);
|
||||
if (day < 1 || day > 31) {
|
||||
OLAP_LOG_WARNING("invalid day. [day=%d]", day);
|
||||
LOG(WARNING) << "invalid day. [day=" << day << "]";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (what[4].length()) {
|
||||
int hour = strtol(what[5].str().c_str(), nullptr, 10);
|
||||
if (hour < 0 || hour > 23) {
|
||||
OLAP_LOG_WARNING("invalid hour. [hour=%d]", hour);
|
||||
LOG(WARNING) << "invalid hour. [hour=" << hour << "]";
|
||||
return false;
|
||||
}
|
||||
|
||||
int minute = strtol(what[6].str().c_str(), nullptr, 10);
|
||||
if (minute < 0 || minute > 59) {
|
||||
OLAP_LOG_WARNING("invalid minute. [minute=%d]", minute);
|
||||
LOG(WARNING) << "invalid minute. [minute=" << minute << "]";
|
||||
return false;
|
||||
}
|
||||
|
||||
int second = strtol(what[7].str().c_str(), nullptr, 10);
|
||||
if (second < 0 || second > 59) {
|
||||
OLAP_LOG_WARNING("invalid second. [second=%d]", second);
|
||||
LOG(WARNING) << "invalid second. [second=" << second << "]";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
OLAP_LOG_WARNING("datetime string does not match");
|
||||
LOG(WARNING) << "datetime string does not match";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,8 +32,8 @@ WrapperField* WrapperField::create(const TabletColumn& column, uint32_t len) {
|
||||
? config::string_type_length_soft_limit_bytes
|
||||
: OLAP_VARCHAR_MAX_LENGTH;
|
||||
if (is_string_type && len > max_length) {
|
||||
OLAP_LOG_WARNING("length of string parameter is too long[len=%lu, max_len=%lu].", len,
|
||||
max_length);
|
||||
LOG(WARNING) << "length of string parameter is too long[len=" << len
|
||||
<< ", max_len=" << max_length << "].";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user