From bba41d1d45e7df1c83684c960ded4099fe414d17 Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Tue, 3 Jan 2023 14:04:55 +0800 Subject: [PATCH] revise dfatal. --- src/clients/meta/MetaClient.cpp | 2 +- src/codec/RowReaderV1.cpp | 3 +-- src/codec/RowReaderV2.cpp | 3 +-- src/codec/RowReaderWrapper.cpp | 2 +- src/codec/RowWriterV2.cpp | 10 +++++----- src/common/expression/ArithmeticExpression.cpp | 4 ++-- src/common/expression/Expression.cpp | 10 +++++----- src/common/expression/UnaryExpression.cpp | 4 ++-- src/meta/processors/schema/SchemaUtil.cpp | 2 +- 9 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/clients/meta/MetaClient.cpp b/src/clients/meta/MetaClient.cpp index 16482bdfb51..7446ab95f12 100644 --- a/src/clients/meta/MetaClient.cpp +++ b/src/clients/meta/MetaClient.cpp @@ -2571,7 +2571,7 @@ folly::Future> MetaClient::heartbeat() { if (FileBasedClusterIdMan::persistInFile(resp.get_cluster_id(), FLAGS_cluster_id_path)) { options_.clusterId_.store(resp.get_cluster_id()); } else { - LOG(DFATAL) << "Can't persist the clusterId in file " << FLAGS_cluster_id_path; + DLOG(FATAL) << "Can't persist the clusterId in file " << FLAGS_cluster_id_path; return false; } } diff --git a/src/codec/RowReaderV1.cpp b/src/codec/RowReaderV1.cpp index 0d17b3aef76..a8f9023c258 100644 --- a/src/codec/RowReaderV1.cpp +++ b/src/codec/RowReaderV1.cpp @@ -142,8 +142,7 @@ int64_t RowReaderV1::skipToNext(int64_t index, int64_t offset) const noexcept { break; } default: { - // TODO - LOG(DFATAL) << "Unimplemented"; + LOG(FATAL) << "Unimplemented"; return -1; } } diff --git a/src/codec/RowReaderV2.cpp b/src/codec/RowReaderV2.cpp index cdfe207f1e7..384a171494f 100644 --- a/src/codec/RowReaderV2.cpp +++ b/src/codec/RowReaderV2.cpp @@ -208,8 +208,7 @@ Value RowReaderV2::getValueByIndex(const int64_t index) const noexcept { case PropertyType::UNKNOWN: break; } - LOG(DFATAL) << "Should not reach here, illegal property type: " - << static_cast(field->type()); + LOG(FATAL) << "Should not reach here, illegal property type: " << static_cast(field->type()); return Value::kNullBadType; } diff --git a/src/codec/RowReaderWrapper.cpp b/src/codec/RowReaderWrapper.cpp index 77abcf81323..5a100fabcfb 100644 --- a/src/codec/RowReaderWrapper.cpp +++ b/src/codec/RowReaderWrapper.cpp @@ -89,7 +89,7 @@ RowReaderWrapper::RowReaderWrapper(const meta::SchemaProviderIf* schema, readerV2_.resetImpl(schema, row); currReader_ = &readerV2_; } else { - LOG(DFATAL) << "Should not reach here"; + LOG(FATAL) << "Should not reach here"; readerV2_.resetImpl(schema, row); currReader_ = &readerV2_; } diff --git a/src/codec/RowWriterV2.cpp b/src/codec/RowWriterV2.cpp index c6466191f55..17bc7c3a6d4 100644 --- a/src/codec/RowWriterV2.cpp +++ b/src/codec/RowWriterV2.cpp @@ -63,7 +63,7 @@ RowWriterV2::RowWriterV2(const meta::SchemaProviderIf* schema) header = 0x0F; // 0x08 | 0x07, seven bytes for the schema version headerLen_ = 8; } else { - LOG(DFATAL) << "Schema version too big"; + LOG(FATAL) << "Schema version too big"; header = 0x0F; // 0x08 | 0x07, seven bytes for the schema version headerLen_ = 8; } @@ -139,7 +139,7 @@ RowWriterV2::RowWriterV2(RowReader& reader) : RowWriterV2(reader.getSchema()) { set(i, v.moveDuration()); break; default: - LOG(DFATAL) << "Invalid data: " << v << ", type: " << v.typeName(); + LOG(FATAL) << "Invalid data: " << v << ", type: " << v.typeName(); isSet_[i] = false; continue; } @@ -856,9 +856,9 @@ WriteResult RowWriterV2::checkUnsetFields() noexcept { r = write(i, defVal.getDuration()); break; default: - LOG(DFATAL) << "Unsupported default value type: " << defVal.typeName() - << ", default value: " << defVal - << ", default value expr: " << field->defaultValue(); + LOG(FATAL) << "Unsupported default value type: " << defVal.typeName() + << ", default value: " << defVal + << ", default value expr: " << field->defaultValue(); return WriteResult::TYPE_MISMATCH; } } else { diff --git a/src/common/expression/ArithmeticExpression.cpp b/src/common/expression/ArithmeticExpression.cpp index 06e1f63dedb..0a4c0b52b2e 100644 --- a/src/common/expression/ArithmeticExpression.cpp +++ b/src/common/expression/ArithmeticExpression.cpp @@ -55,8 +55,8 @@ std::string ArithmeticExpression::toString() const { op = "%"; break; default: - LOG(DFATAL) << "Illegal kind for arithmetic expression: " << static_cast(kind()); - op = "illegal symbol "; + DLOG(FATAL) << "Illegal kind for arithmetic expression: " << static_cast(kind()); + op = " Invalid arithmetic expression "; } std::stringstream out; out << "(" << (lhs_ ? lhs_->toString() : "") << op << (rhs_ ? rhs_->toString() : "") << ")"; diff --git a/src/common/expression/Expression.cpp b/src/common/expression/Expression.cpp index 2a6ef5dbfb1..ec36dab0b67 100644 --- a/src/common/expression/Expression.cpp +++ b/src/common/expression/Expression.cpp @@ -395,7 +395,7 @@ Expression* Expression::decode(ObjectPool* pool, Expression::Decoder& decoder) { return exp; } case Expression::Kind::kInputProperty: { - LOG(DFATAL) << "Should not decode input property expression"; + LOG(FATAL) << "Should not decode input property expression"; return exp; } case Expression::Kind::kVarProperty: { @@ -459,7 +459,7 @@ Expression* Expression::decode(ObjectPool* pool, Expression::Decoder& decoder) { return exp; } case Expression::Kind::kVersionedVar: { - LOG(DFATAL) << "Should not decode version variable expression"; + LOG(FATAL) << "Should not decode version variable expression"; return exp; } case Expression::Kind::kUUID: { @@ -516,17 +516,17 @@ Expression* Expression::decode(ObjectPool* pool, Expression::Decoder& decoder) { case Expression::Kind::kTSWildcard: case Expression::Kind::kTSRegexp: case Expression::Kind::kTSFuzzy: { - LOG(DFATAL) << "Should not decode text search expression"; + LOG(FATAL) << "Should not decode text search expression"; return exp; } case Expression::Kind::kMatchPathPattern: { - LOG(DFATAL) << "Should not decode match path pattern expression."; + LOG(FATAL) << "Should not decode match path pattern expression."; return exp; } // no default so the compiler will warning when lack } - LOG(DFATAL) << "Unknown expression: " << decoder.getHexStr(); + LOG(FATAL) << "Unknown expression: " << decoder.getHexStr(); return exp; } diff --git a/src/common/expression/UnaryExpression.cpp b/src/common/expression/UnaryExpression.cpp index 01735b41adf..d230111ad0d 100644 --- a/src/common/expression/UnaryExpression.cpp +++ b/src/common/expression/UnaryExpression.cpp @@ -121,8 +121,8 @@ std::string UnaryExpression::toString() const { case Kind::kIsNotEmpty: return (operand_ ? operand_->toString() : "") + " IS NOT EMPTY"; default: - LOG(DFATAL) << "Illegal kind for unary expression: " << static_cast(kind()); - op = "illegal symbol "; + DLOG(FATAL) << "Illegal kind for unary expression: " << static_cast(kind()); + op = " Invalid unary expression "; } std::stringstream out; out << op << "(" << (operand_ ? operand_->toString() : "") << ")"; diff --git a/src/meta/processors/schema/SchemaUtil.cpp b/src/meta/processors/schema/SchemaUtil.cpp index c482b1a5fd8..526efc1fe34 100644 --- a/src/meta/processors/schema/SchemaUtil.cpp +++ b/src/meta/processors/schema/SchemaUtil.cpp @@ -187,7 +187,7 @@ bool SchemaUtil::checkType(std::vector& columns) { return false; // no default so compiler will warning when lack } // switch - LOG(DFATAL) << "Unknown property type " << static_cast(column.get_type().get_type()); + DLOG(FATAL) << "Unknown property type " << static_cast(column.get_type().get_type()); return false; }