From b737e52aef8ed01fe7f60ab35df0250d34aa00c4 Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Tue, 3 Jan 2023 12:54:00 +0800 Subject: [PATCH 1/3] Revise the usages of FATAL, DFATAL, LOG, DLOG. --- src/common/base/Arena.cpp | 2 +- src/common/base/Status.cpp | 2 +- src/common/datatypes/Value.cpp | 26 ++++++++-------- .../expression/ArithmeticExpression.cpp | 2 +- .../expression/LabelAttributeExpression.h | 6 ++-- src/common/expression/LogicalExpression.cpp | 6 ++-- src/common/expression/LogicalExpression.h | 2 +- .../expression/MatchPathPatternExpression.h | 4 +-- src/common/expression/PropertyExpression.cpp | 2 +- .../expression/RelationalExpression.cpp | 6 ++-- .../expression/TextSearchExpression.cpp | 4 +-- src/common/expression/TextSearchExpression.h | 8 ++--- src/common/expression/UnaryExpression.cpp | 2 +- src/common/expression/VariableExpression.h | 4 +-- src/common/function/FunctionManager.cpp | 8 ++--- src/common/geo/GeoIndex.cpp | 2 +- src/common/geo/GeoUtils.h | 2 +- src/common/geo/io/wkb/WKBReader.cpp | 2 +- src/common/geo/io/wkb/WKBWriter.cpp | 2 +- src/common/id/Snowflake.cpp | 2 +- src/common/meta/GflagsManager.cpp | 2 +- src/common/meta/NebulaSchemaProvider.cpp | 2 +- src/common/stats/StatsManager-inl.h | 2 +- src/common/stats/StatsManager.h | 4 +-- src/common/utils/DefaultValueContext.h | 30 +++++++++---------- src/common/utils/IndexKeyUtils.cpp | 2 +- src/common/utils/IndexKeyUtils.h | 4 +-- src/graph/context/Iterator.cpp | 2 +- src/graph/context/Iterator.h | 18 +++++------ src/graph/executor/Executor.cpp | 2 +- .../executor/admin/SubmitJobExecutor.cpp | 2 +- .../executor/query/DataCollectExecutor.cpp | 2 +- .../optimizer/rule/PushEFilterDownRule.cpp | 4 ++- .../optimizer/rule/PushFilterDownNodeRule.cpp | 6 ++-- .../rule/UnionAllIndexScanBaseRule.cpp | 2 +- src/graph/planner/match/SegmentsConnector.cpp | 2 +- src/graph/planner/plan/PlanNode.cpp | 2 +- src/graph/planner/plan/PlanNode.h | 8 ++--- src/graph/util/ParserUtil.cpp | 2 +- src/graph/util/ToJson.cpp | 2 +- src/graph/validator/LookupValidator.cpp | 2 +- src/graph/validator/Validator.cpp | 4 +-- src/graph/visitor/DeduceTypeVisitor.cpp | 6 ++-- src/graph/visitor/ExtractPropExprVisitor.cpp | 6 ++-- src/parser/AdminSentences.cpp | 26 ++++++++-------- src/parser/MaintainSentences.cpp | 8 ++--- src/parser/TraverseSentences.cpp | 4 +-- src/storage/GraphStorageServiceHandler.cpp | 2 +- src/storage/StorageServer.cpp | 6 ++-- .../context/StorageExpressionContext.h | 8 ++--- src/storage/exec/IndexExprContext.h | 4 +-- src/storage/exec/MultiTagNode.h | 6 ++-- src/storage/exec/QueryUtils.h | 4 +-- src/storage/exec/StorageIterator.h | 2 +- .../transaction/ChainProcessorFactory.cpp | 8 ++--- src/storage/transaction/ConsistUtil.cpp | 2 +- 56 files changed, 147 insertions(+), 145 deletions(-) diff --git a/src/common/base/Arena.cpp b/src/common/base/Arena.cpp index ff2f49e6806..0775438bdfe 100644 --- a/src/common/base/Arena.cpp +++ b/src/common/base/Arena.cpp @@ -16,7 +16,7 @@ void* Arena::allocateAligned(const std::size_t alloc) { kAlignment - (reinterpret_cast(currentPtr_) & (kAlignment - 1)); const std::size_t consumption = alloc + pad; if (UNLIKELY(consumption > kMaxChunkSize)) { - LOG(DFATAL) << "Arena can't allocate so large memory."; + DLOG(FATAL) << "Arena can't allocate so large memory."; return nullptr; } if (LIKELY(consumption <= availableSize_)) { diff --git a/src/common/base/Status.cpp b/src/common/base/Status.cpp index 3954b113e94..d80c31cf370 100644 --- a/src/common/base/Status.cpp +++ b/src/common/base/Status.cpp @@ -100,7 +100,7 @@ const char *Status::toString(Code code) { case kSessionNotFound: return "SessionNotFound"; } - LOG(DFATAL) << "Invalid status code: " << static_cast(code); + DLOG(FATAL) << "Invalid status code: " << static_cast(code); return ""; } diff --git a/src/common/datatypes/Value.cpp b/src/common/datatypes/Value.cpp index 583c1c1575f..b0cd600effe 100644 --- a/src/common/datatypes/Value.cpp +++ b/src/common/datatypes/Value.cpp @@ -1507,7 +1507,7 @@ folly::dynamic Value::toJson() const { // no default so the compiler will warning when lack } - LOG(DFATAL) << "Unknown value type " << static_cast(type_); + DLOG(FATAL) << "Unknown value type " << static_cast(type_); return folly::dynamic(nullptr); } @@ -1553,7 +1553,7 @@ folly::dynamic Value::getMetaData() const { break; } - LOG(DFATAL) << "Unknown value type " << static_cast(type_); + DLOG(FATAL) << "Unknown value type " << static_cast(type_); return folly::dynamic(nullptr); } @@ -1581,7 +1581,7 @@ std::string Value::toString() const { case NullType::OUT_OF_RANGE: return "__NULL_OUT_OF_RANGE__"; } - LOG(DFATAL) << "Unknown Null type " << static_cast(getNull()); + DLOG(FATAL) << "Unknown Null type " << static_cast(getNull()); return "__NULL_BAD_TYPE__"; } case Value::Type::BOOL: { @@ -1635,7 +1635,7 @@ std::string Value::toString() const { // no default so the compiler will warning when lack } - LOG(DFATAL) << "Unknown value type " << static_cast(type_); + DLOG(FATAL) << "Unknown value type " << static_cast(type_); return "__NULL_BAD_TYPE__"; } @@ -1858,7 +1858,7 @@ Value Value::lessThan(const Value& v) const { return kNullBadType; } } - LOG(DFATAL) << "Unknown type " << static_cast(v.type()); + DLOG(FATAL) << "Unknown type " << static_cast(v.type()); return Value::kNullBadType; } @@ -1957,7 +1957,7 @@ Value Value::equal(const Value& v) const { return false; } } - LOG(DFATAL) << "Unknown type " << static_cast(v.type()); + DLOG(FATAL) << "Unknown type " << static_cast(v.type()); return Value::kNullBadType; } @@ -1979,7 +1979,7 @@ bool Value::implicitBool() const { case Type::LIST: return !getList().empty(); default: - LOG(DFATAL) << "Impossible to reach here!"; + DLOG(FATAL) << "Impossible to reach here!"; return false; } } @@ -2262,7 +2262,7 @@ Value operator+(const Value& lhs, const Value& rhs) { return Value::kNullValue; } } - LOG(DFATAL) << "Unknown type: " << rhs.type(); + DLOG(FATAL) << "Unknown type: " << rhs.type(); return Value::kNullBadType; } case Value::Type::VERTEX: { @@ -2696,7 +2696,7 @@ bool operator<(const Value& lhs, const Value& rhs) { return lhs.getGeography() < rhs.getGeography(); } case Value::Type::DURATION: { - LOG(DFATAL) << "Duration is not comparable."; + DLOG(FATAL) << "Duration is not comparable."; return false; } case Value::Type::NULLVALUE: @@ -2704,7 +2704,7 @@ bool operator<(const Value& lhs, const Value& rhs) { return false; } } - LOG(DFATAL) << "Unknown type " << static_cast(lType); + DLOG(FATAL) << "Unknown type " << static_cast(lType); return false; } @@ -2800,7 +2800,7 @@ bool Value::equals(const Value& rhs) const { return false; } } - LOG(DFATAL) << "Unknown type " << static_cast(type()); + DLOG(FATAL) << "Unknown type " << static_cast(type()); return false; } @@ -2858,11 +2858,11 @@ std::size_t Value::hash() const { return std::hash()(getDuration()); } case Type::DATASET: { - LOG(DFATAL) << "Hash for DATASET has not been implemented"; + DLOG(FATAL) << "Hash for DATASET has not been implemented"; break; } default: { - LOG(DFATAL) << "Unknown type"; + DLOG(FATAL) << "Unknown type"; } } return ~0UL; diff --git a/src/common/expression/ArithmeticExpression.cpp b/src/common/expression/ArithmeticExpression.cpp index 492d63cf3a8..06e1f63dedb 100644 --- a/src/common/expression/ArithmeticExpression.cpp +++ b/src/common/expression/ArithmeticExpression.cpp @@ -30,7 +30,7 @@ const Value& ArithmeticExpression::eval(ExpressionContext& ctx) { result_ = lhs % rhs; break; default: - LOG(DFATAL) << "Unknown type: " << kind_; + DLOG(FATAL) << "Unknown type: " << kind_; result_ = Value::kNullBadType; } return result_; diff --git a/src/common/expression/LabelAttributeExpression.h b/src/common/expression/LabelAttributeExpression.h index 43105f0c04f..40cee0d7fb0 100644 --- a/src/common/expression/LabelAttributeExpression.h +++ b/src/common/expression/LabelAttributeExpression.h @@ -34,7 +34,7 @@ class LabelAttributeExpression final : public Expression { } const Value& eval(ExpressionContext&) override { - DLOG(DFATAL) << "LabelAttributeExpression has to be rewritten"; + DLOG(FATAL) << "LabelAttributeExpression has to be rewritten"; return Value::kNullBadData; } @@ -76,11 +76,11 @@ class LabelAttributeExpression final : public Expression { } void writeTo(Encoder&) const override { - LOG(DFATAL) << "LabelAttributeExpression not supported to encode."; + LOG(FATAL) << "LabelAttributeExpression not supported to encode."; } void resetFrom(Decoder&) override { - LOG(DFATAL) << "LabelAttributeExpression not supported to decode."; + LOG(FATAL) << "LabelAttributeExpression not supported to decode."; } private: diff --git a/src/common/expression/LogicalExpression.cpp b/src/common/expression/LogicalExpression.cpp index a157f040347..bec11fac8e5 100644 --- a/src/common/expression/LogicalExpression.cpp +++ b/src/common/expression/LogicalExpression.cpp @@ -19,7 +19,7 @@ const Value &LogicalExpression::eval(ExpressionContext &ctx) { case Kind::kLogicalXor: return evalXor(ctx); default: - LOG(DFATAL) << "Illegal kind for logical expression: " << static_cast(kind()); + DLOG(FATAL) << "Illegal kind for logical expression: " << static_cast(kind()); return Value::kNullBadType; } } @@ -116,8 +116,8 @@ std::string LogicalExpression::toString() const { op = " XOR "; break; default: - LOG(DFATAL) << "Illegal kind for logical expression: " << static_cast(kind()); - op = " illegal symbol "; + DLOG(FATAL) << "Illegal kind for logical expression: " << static_cast(kind()); + op = " Invalid logical expression "; } std::string buf; buf.reserve(256); diff --git a/src/common/expression/LogicalExpression.h b/src/common/expression/LogicalExpression.h index c1aa889b8e4..22cf72143e9 100644 --- a/src/common/expression/LogicalExpression.h +++ b/src/common/expression/LogicalExpression.h @@ -99,7 +99,7 @@ class LogicalExpression final : public Expression { } else if (kind_ == Kind::kLogicalOr) { kind_ = Kind::kLogicalAnd; } else { - LOG(DFATAL) << "Should not reverse logical expression except and/or kind."; + DLOG(FATAL) << "Should not reverse logical expression except and/or kind."; } } diff --git a/src/common/expression/MatchPathPatternExpression.h b/src/common/expression/MatchPathPatternExpression.h index c4547a51d76..1438ddcc293 100644 --- a/src/common/expression/MatchPathPatternExpression.h +++ b/src/common/expression/MatchPathPatternExpression.h @@ -60,12 +60,12 @@ class MatchPathPatternExpression final : public Expression { // This expression contains variable implicitly, so we don't support persist or transform it. void writeTo(Encoder&) const override { - LOG(DFATAL) << "Not implemented"; + LOG(FATAL) << "Not implemented"; } // This expression contains variable implicitly, so we don't support persist or transform it. void resetFrom(Decoder&) override { - LOG(DFATAL) << "Not implemented"; + LOG(FATAL) << "Not implemented"; } private: diff --git a/src/common/expression/PropertyExpression.cpp b/src/common/expression/PropertyExpression.cpp index 81afd944433..09ec28eb4a6 100644 --- a/src/common/expression/PropertyExpression.cpp +++ b/src/common/expression/PropertyExpression.cpp @@ -46,7 +46,7 @@ void PropertyExpression::resetFrom(Decoder& decoder) { const Value& PropertyExpression::eval(ExpressionContext& ctx) { // TODO maybe cypher need it. UNUSED(ctx); - LOG(DFATAL) << "Unimplemented"; + DLOG(FATAL) << "Unimplemented"; return Value::kNullBadType; } diff --git a/src/common/expression/RelationalExpression.cpp b/src/common/expression/RelationalExpression.cpp index 0c328f72d86..887562f1cb3 100644 --- a/src/common/expression/RelationalExpression.cpp +++ b/src/common/expression/RelationalExpression.cpp @@ -195,7 +195,7 @@ const Value& RelationalExpression::eval(ExpressionContext& ctx) { break; } default: - LOG(DFATAL) << "Unknown type: " << kind_; + DLOG(FATAL) << "Unknown type: " << kind_; result_ = Value::kNullBadType; } return result_; @@ -250,8 +250,8 @@ std::string RelationalExpression::toString() const { op = " NOT ENDS WITH "; break; default: - LOG(DFATAL) << "Illegal kind for relational expression: " << static_cast(kind()); - op = " illegal symbol "; + DLOG(FATAL) << "Illegal kind for relational expression: " << static_cast(kind()); + op = " Invalid relational expression "; } std::stringstream out; out << "(" << (lhs_ ? lhs_->toString() : "") << op << (rhs_ ? rhs_->toString() : "") << ")"; diff --git a/src/common/expression/TextSearchExpression.cpp b/src/common/expression/TextSearchExpression.cpp index f10557cc4b2..a8e556def24 100644 --- a/src/common/expression/TextSearchExpression.cpp +++ b/src/common/expression/TextSearchExpression.cpp @@ -66,8 +66,8 @@ std::string TextSearchExpression::toString() const { break; } default: { - LOG(DFATAL) << "Illegal kind for text search expression: " << static_cast(kind()); - buf = "illegal symbol("; + DLOG(FATAL) << "Illegal kind for text search expression: " << static_cast(kind()); + buf = "invalid text search expression("; } } buf += arg_ ? arg_->toString() : ""; diff --git a/src/common/expression/TextSearchExpression.h b/src/common/expression/TextSearchExpression.h index 281c8a15bb6..078068111ae 100644 --- a/src/common/expression/TextSearchExpression.h +++ b/src/common/expression/TextSearchExpression.h @@ -114,12 +114,12 @@ class TextSearchExpression : public Expression { bool operator==(const Expression& rhs) const override; const Value& eval(ExpressionContext&) override { - LOG(DFATAL) << "TextSearchExpression has to be rewritten"; + DLOG(FATAL) << "TextSearchExpression has to be rewritten"; return Value::kNullBadData; } void accept(ExprVisitor*) override { - LOG(DFATAL) << "TextSearchExpression has to be rewritten"; + DLOG(FATAL) << "TextSearchExpression has to be rewritten"; } std::string toString() const override; @@ -149,11 +149,11 @@ class TextSearchExpression : public Expression { } void writeTo(Encoder&) const override { - LOG(DFATAL) << "TextSearchExpression has to be rewritten"; + LOG(FATAL) << "TextSearchExpression has to be rewritten"; } void resetFrom(Decoder&) override { - LOG(DFATAL) << "TextSearchExpression has to be reset"; + LOG(FATAL) << "TextSearchExpression has to be reset"; } private: diff --git a/src/common/expression/UnaryExpression.cpp b/src/common/expression/UnaryExpression.cpp index 75223036d05..01735b41adf 100644 --- a/src/common/expression/UnaryExpression.cpp +++ b/src/common/expression/UnaryExpression.cpp @@ -87,7 +87,7 @@ const Value& UnaryExpression::eval(ExpressionContext& ctx) { break; } default: { - LOG(DFATAL) << "Unknown type: " << kind_; + DLOG(FATAL) << "Unknown type: " << kind_; result_ = Value::kNullBadType; } } diff --git a/src/common/expression/VariableExpression.h b/src/common/expression/VariableExpression.h index 5c73000d15c..52e6a3907f0 100644 --- a/src/common/expression/VariableExpression.h +++ b/src/common/expression/VariableExpression.h @@ -107,11 +107,11 @@ class VersionedVariableExpression final : public Expression { : Expression(pool, Kind::kVersionedVar), var_(var), version_(version) {} void writeTo(Encoder&) const override { - LOG(DFATAL) << "VersionedVariableExpression not support to encode."; + LOG(FATAL) << "VersionedVariableExpression not support to encode."; } void resetFrom(Decoder&) override { - LOG(DFATAL) << "VersionedVariableExpression not support to decode."; + LOG(FATAL) << "VersionedVariableExpression not support to decode."; } private: diff --git a/src/common/function/FunctionManager.cpp b/src/common/function/FunctionManager.cpp index d985a3a8079..74a762a93d9 100644 --- a/src/common/function/FunctionManager.cpp +++ b/src/common/function/FunctionManager.cpp @@ -1692,7 +1692,7 @@ FunctionManager::FunctionManager() { } } default: - LOG(DFATAL) << "Unexpected arguments count " << args.size(); + DLOG(FATAL) << "Unexpected arguments count " << args.size(); return Value::kNullBadType; } }; @@ -1733,7 +1733,7 @@ FunctionManager::FunctionManager() { } } default: - LOG(DFATAL) << "Unexpected arguments count " << args.size(); + DLOG(FATAL) << "Unexpected arguments count " << args.size(); return Value::kNullBadType; } }; @@ -1775,7 +1775,7 @@ FunctionManager::FunctionManager() { } } default: - LOG(DFATAL) << "Unexpected arguments count " << args.size(); + DLOG(FATAL) << "Unexpected arguments count " << args.size(); return Value::kNullBadType; } }; @@ -2793,7 +2793,7 @@ FunctionManager::FunctionManager() { const auto &p = args[0].get().getPath(); const std::size_t nodeIndex = args[1].get().getInt(); if (nodeIndex < 0 || nodeIndex >= (1 + p.steps.size())) { - LOG(DFATAL) << "Out of range node index."; + DLOG(FATAL) << "Out of range node index."; return Value::kNullOutOfRange; } if (nodeIndex == 0) { diff --git a/src/common/geo/GeoIndex.cpp b/src/common/geo/GeoIndex.cpp index 67080c169fd..0995afc99eb 100644 --- a/src/common/geo/GeoIndex.cpp +++ b/src/common/geo/GeoIndex.cpp @@ -118,7 +118,7 @@ std::vector GeoIndex::dWithin(const Geography& g, double distance) co return intersects(gBuffer); } default: - LOG(DFATAL) + DLOG(FATAL) << "Geography shapes other than Point/LineString/Polygon are not currently supported"; return {}; } diff --git a/src/common/geo/GeoUtils.h b/src/common/geo/GeoUtils.h index f140fe10138..cf4e9cf3863 100644 --- a/src/common/geo/GeoUtils.h +++ b/src/common/geo/GeoUtils.h @@ -47,7 +47,7 @@ class GeoUtils final { return std::make_unique(std::move(s2Loops), S2Debug::DISABLE); } default: - LOG(DFATAL) + DLOG(FATAL) << "Geography shapes other than Point/LineString/Polygon are not currently supported"; return nullptr; } diff --git a/src/common/geo/io/wkb/WKBReader.cpp b/src/common/geo/io/wkb/WKBReader.cpp index 434c0d13c0e..1a9c092f179 100644 --- a/src/common/geo/io/wkb/WKBReader.cpp +++ b/src/common/geo/io/wkb/WKBReader.cpp @@ -31,7 +31,7 @@ StatusOr WKBReader::read(const std::string &wkb) { return readPolygon(); } default: - LOG(DFATAL) + DLOG(FATAL) << "Geography shapes other than Point/LineString/Polygon are not currently supported"; return Status::Error( "Geography shapes other than Point/LineString/Polygon are not currently supported"); diff --git a/src/common/geo/io/wkb/WKBWriter.cpp b/src/common/geo/io/wkb/WKBWriter.cpp index cac1d44ec2e..7873f06fbc1 100644 --- a/src/common/geo/io/wkb/WKBWriter.cpp +++ b/src/common/geo/io/wkb/WKBWriter.cpp @@ -32,7 +32,7 @@ std::string WKBWriter::write(const Geography& geog, ByteOrder byteOrder) { return os_.str(); } default: - LOG(DFATAL) + DLOG(FATAL) << "Geometry shapes other than Point/LineString/Polygon are not currently supported"; return ""; } diff --git a/src/common/id/Snowflake.cpp b/src/common/id/Snowflake.cpp index 4aacedb5b43..4701c9b0d0e 100644 --- a/src/common/id/Snowflake.cpp +++ b/src/common/id/Snowflake.cpp @@ -10,7 +10,7 @@ bool Snowflake::initWorkerId(meta::MetaClient* client) { const std::string& ip = client->getLocalIp(); auto result = client->getWorkerId(ip).get(); if (!result.ok()) { - LOG(DFATAL) << "Failed to get workerId from meta server"; + DLOG(FATAL) << "Failed to get workerId from meta server"; return false; } workerId_ = result.value(); diff --git a/src/common/meta/GflagsManager.cpp b/src/common/meta/GflagsManager.cpp index a25d2708fef..b1e100aabf0 100644 --- a/src/common/meta/GflagsManager.cpp +++ b/src/common/meta/GflagsManager.cpp @@ -209,7 +209,7 @@ std::string GflagsManager::ValueToGflagString(const Value& val) { return os.str(); } default: { - LOG(DFATAL) << "Unsupported type for gflags"; + DLOG(FATAL) << "Unsupported type for gflags"; return ""; } } diff --git a/src/common/meta/NebulaSchemaProvider.cpp b/src/common/meta/NebulaSchemaProvider.cpp index 5cb9a891fdf..51bc08c7de5 100644 --- a/src/common/meta/NebulaSchemaProvider.cpp +++ b/src/common/meta/NebulaSchemaProvider.cpp @@ -176,7 +176,7 @@ std::size_t NebulaSchemaProvider::fieldSize(PropertyType type, std::size_t fixed case PropertyType::UNKNOWN: break; } - LOG(DFATAL) << "Incorrect field type " << static_cast(type); + DLOG(FATAL) << "Incorrect field type " << static_cast(type); return 0; } diff --git a/src/common/stats/StatsManager-inl.h b/src/common/stats/StatsManager-inl.h index 0415735e2f4..e5725152958 100644 --- a/src/common/stats/StatsManager-inl.h +++ b/src/common/stats/StatsManager-inl.h @@ -26,7 +26,7 @@ StatsManager::VT StatsManager::readValue(StatsHolder& stats, return stats.template rate(level); } - LOG(DFATAL) << "Unknown statistic method"; + DLOG(FATAL) << "Unknown statistic method"; return StatsManager::VT(0); } diff --git a/src/common/stats/StatsManager.h b/src/common/stats/StatsManager.h index b6bd4f038a9..07177651328 100644 --- a/src/common/stats/StatsManager.h +++ b/src/common/stats/StatsManager.h @@ -29,11 +29,11 @@ class CounterId final { CounterId& operator=(const CounterId& right) { if (!right.valid()) { - LOG(FATAL) << "Invalid counter id"; + DLOG(FATAL) << "Invalid counter id"; } if (valid()) { // Already assigned - LOG(DFATAL) << "CounterId cannot be assigned twice"; + DLOG(FATAL) << "CounterId cannot be assigned twice"; } index_ = right.index_; isHisto_ = right.isHisto_; diff --git a/src/common/utils/DefaultValueContext.h b/src/common/utils/DefaultValueContext.h index 89a5aad4d9b..e72278858b5 100644 --- a/src/common/utils/DefaultValueContext.h +++ b/src/common/utils/DefaultValueContext.h @@ -14,66 +14,66 @@ namespace nebula { class DefaultValueContext final : public ExpressionContext { public: const Value& getVar(const std::string&) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } void setInnerVar(const std::string&, Value) override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; } const Value& getInnerVar(const std::string&) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } const Value& getVersionedVar(const std::string&, int64_t) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } const Value& getVarProp(const std::string&, const std::string&) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } StatusOr getVarPropIndex(const std::string&, const std::string&) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Status::Error("Unimplemented"); } Value getEdgeProp(const std::string&, const std::string&) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } Value getTagProp(const std::string&, const std::string&) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } Value getSrcProp(const std::string&, const std::string&) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } const Value& getDstProp(const std::string&, const std::string&) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } const Value& getInputProp(const std::string&) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } StatusOr getInputPropIndex(const std::string&) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Status::Error("Unimplemented"); } const Value& getColumn(int32_t) const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } @@ -81,12 +81,12 @@ class DefaultValueContext final : public ExpressionContext { Value getVertex(const std::string& name = "") const override { UNUSED(name); - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } Value getEdge() const override { - LOG(DFATAL) << "Not allowed to call"; + DLOG(FATAL) << "Not allowed to call"; return Value::kEmpty; } }; diff --git a/src/common/utils/IndexKeyUtils.cpp b/src/common/utils/IndexKeyUtils.cpp index 912d4125d25..9b0fa4eda31 100644 --- a/src/common/utils/IndexKeyUtils.cpp +++ b/src/common/utils/IndexKeyUtils.cpp @@ -258,7 +258,7 @@ Status IndexKeyUtils::checkValue(const Value& v, bool isNullable) { return Status::Error("Out of range"); } } - LOG(DFATAL) << "Unknown Null type " << static_cast(v.getNull()); + DLOG(FATAL) << "Unknown Null type " << static_cast(v.getNull()); return Status::Error("Unknown Null type"); } diff --git a/src/common/utils/IndexKeyUtils.h b/src/common/utils/IndexKeyUtils.h index 977800a20fc..8a8b1753c20 100644 --- a/src/common/utils/IndexKeyUtils.h +++ b/src/common/utils/IndexKeyUtils.h @@ -142,11 +142,11 @@ class IndexKeyUtils final { return encodeDateTime(v.getDateTime()); } case Value::Type::GEOGRAPHY: { - LOG(DFATAL) << "Should call encodeGeography separately"; + DLOG(FATAL) << "Should call encodeGeography separately"; return ""; } default: - LOG(DFATAL) << "Unsupported default value type"; + DLOG(FATAL) << "Unsupported default value type"; } return ""; } diff --git a/src/graph/context/Iterator.cpp b/src/graph/context/Iterator.cpp index 187a73ee81a..5b2b94ffac1 100644 --- a/src/graph/context/Iterator.cpp +++ b/src/graph/context/Iterator.cpp @@ -758,7 +758,7 @@ PropIter::PropIter(std::shared_ptr value, bool checkMemory) auto& ds = value->getDataSet(); auto status = makeDataSetIndex(ds); if (UNLIKELY(!status.ok())) { - LOG(DFATAL) << status; + DLOG(FATAL) << status; clear(); return; } diff --git a/src/graph/context/Iterator.h b/src/graph/context/Iterator.h index 77441e289e2..1b4119f0a32 100644 --- a/src/graph/context/Iterator.h +++ b/src/graph/context/Iterator.h @@ -136,12 +136,12 @@ class Iterator { } virtual const Value& getTagProp(const std::string&, const std::string&) const { - LOG(DFATAL) << "Shouldn't call the unimplemented method"; + DLOG(FATAL) << "Shouldn't call the unimplemented method"; return Value::kEmpty; } virtual const Value& getEdgeProp(const std::string&, const std::string&) const { - LOG(DFATAL) << "Shouldn't call the unimplemented method"; + DLOG(FATAL) << "Shouldn't call the unimplemented method"; return Value::kEmpty; } @@ -203,11 +203,11 @@ class DefaultIter final : public Iterator { } void select(std::size_t, std::size_t) override { - LOG(DFATAL) << "Unimplemented method for default iterator."; + DLOG(FATAL) << "Unimplemented method for default iterator."; } void sample(int64_t) override { - LOG(DFATAL) << "Unimplemented default iterator."; + DLOG(FATAL) << "Unimplemented default iterator."; } void clear() override { @@ -219,27 +219,27 @@ class DefaultIter final : public Iterator { } const Value& getColumn(const std::string& /* col */) const override { - LOG(DFATAL) << "This method should not be invoked"; + DLOG(FATAL) << "This method should not be invoked"; return Value::kEmpty; } const Value& getColumn(int32_t) const override { - LOG(DFATAL) << "This method should not be invoked"; + DLOG(FATAL) << "This method should not be invoked"; return Value::kEmpty; } StatusOr getColumnIndex(const std::string&) const override { - LOG(DFATAL) << "This method should not be invoked"; + DLOG(FATAL) << "This method should not be invoked"; return Status::Error("Unimplemented method"); } const Row* row() const override { - LOG(DFATAL) << "This method should not be invoked"; + DLOG(FATAL) << "This method should not be invoked"; return nullptr; } Row moveRow() override { - LOG(DFATAL) << "This method should not be invoked"; + DLOG(FATAL) << "This method should not be invoked"; return Row{}; } diff --git a/src/graph/executor/Executor.cpp b/src/graph/executor/Executor.cpp index 64bd3064b18..e3d62265b8b 100644 --- a/src/graph/executor/Executor.cpp +++ b/src/graph/executor/Executor.cpp @@ -566,7 +566,7 @@ Executor *Executor::makeExecutor(QueryContext *qctx, const PlanNode *node) { return pool->makeAndAdd(node, qctx); } case PlanNode::Kind::kUnknown: { - LOG(DFATAL) << "Unknown plan node kind " << static_cast(node->kind()); + DLOG(FATAL) << "Unknown plan node kind " << static_cast(node->kind()); break; } } diff --git a/src/graph/executor/admin/SubmitJobExecutor.cpp b/src/graph/executor/admin/SubmitJobExecutor.cpp index 6d41c9913f1..2af4b6cc741 100644 --- a/src/graph/executor/admin/SubmitJobExecutor.cpp +++ b/src/graph/executor/admin/SubmitJobExecutor.cpp @@ -101,7 +101,7 @@ StatusOr SubmitJobExecutor::buildResult(meta::cpp2::JobOp jobOp, } // no default so the compiler will warning when lack } - LOG(DFATAL) << "Unknown job operation " << static_cast(jobOp); + DLOG(FATAL) << "Unknown job operation " << static_cast(jobOp); return Status::Error("Unknown job job operation %d.", static_cast(jobOp)); } diff --git a/src/graph/executor/query/DataCollectExecutor.cpp b/src/graph/executor/query/DataCollectExecutor.cpp index 9281e05d33b..7e15bf23459 100644 --- a/src/graph/executor/query/DataCollectExecutor.cpp +++ b/src/graph/executor/query/DataCollectExecutor.cpp @@ -50,7 +50,7 @@ folly::Future DataCollectExecutor::doCollect() { break; } default: - LOG(DFATAL) << "Unknown data collect type: " << static_cast(dc->kind()); + DLOG(FATAL) << "Unknown data collect type: " << static_cast(dc->kind()); return Status::Error("Unknown data collect type: %d.", static_cast(dc->kind())); } ResultBuilder builder; diff --git a/src/graph/optimizer/rule/PushEFilterDownRule.cpp b/src/graph/optimizer/rule/PushEFilterDownRule.cpp index f18ae8798eb..32b67c8de59 100644 --- a/src/graph/optimizer/rule/PushEFilterDownRule.cpp +++ b/src/graph/optimizer/rule/PushEFilterDownRule.cpp @@ -174,7 +174,9 @@ std::string PushEFilterDownRule::toString() const { ret = EdgePropertyExpression::make(pool, std::move(edgeNameResult).value(), exp->prop()); break; default: - LOG(DFATAL) << "Unexpected expr: " << exp->kind(); + DLOG(FATAL) << "Unexpected expr: " << exp->kind(); + // in case the exp cannot be rewritten, return the original exp + ret = exp; } return ret; } diff --git a/src/graph/optimizer/rule/PushFilterDownNodeRule.cpp b/src/graph/optimizer/rule/PushFilterDownNodeRule.cpp index 20fcfb4a7d2..9c89cd16c63 100644 --- a/src/graph/optimizer/rule/PushFilterDownNodeRule.cpp +++ b/src/graph/optimizer/rule/PushFilterDownNodeRule.cpp @@ -55,7 +55,7 @@ StatusOr PushFilterDownNodeRule::transform( auto *append = static_cast(node); vFilter = append->vFilter()->clone(); } else { - LOG(DFATAL) << "Unsupported node kind: " << node->kind(); + DLOG(FATAL) << "Unsupported node kind: " << node->kind(); return TransformResult::noTransform(); } auto visitor = graph::ExtractFilterExprVisitor::makePushGetVertices(pool); @@ -83,7 +83,7 @@ StatusOr PushFilterDownNodeRule::transform( append->setVertexFilter(remainedExpr); append->setFilter(vFilter); } else { - LOG(DFATAL) << "Unsupported node kind: " << newExplore->kind(); + DLOG(FATAL) << "Unsupported node kind: " << newExplore->kind(); return TransformResult::noTransform(); } @@ -111,7 +111,7 @@ bool PushFilterDownNodeRule::match(OptContext *octx, const MatchedResult &matche return false; } } else { - LOG(DFATAL) << "Unexpected node kind: " << node->kind(); + DLOG(FATAL) << "Unexpected node kind: " << node->kind(); return false; } return true; diff --git a/src/graph/optimizer/rule/UnionAllIndexScanBaseRule.cpp b/src/graph/optimizer/rule/UnionAllIndexScanBaseRule.cpp index 93928c8d68b..cc1bb6a41fd 100644 --- a/src/graph/optimizer/rule/UnionAllIndexScanBaseRule.cpp +++ b/src/graph/optimizer/rule/UnionAllIndexScanBaseRule.cpp @@ -167,7 +167,7 @@ StatusOr UnionAllIndexScanBaseRule::transform(OptContext* ctx, break; } default: - LOG(DFATAL) << "Invalid expression kind: " << static_cast(conditionType); + DLOG(FATAL) << "Invalid expression kind: " << static_cast(conditionType); return TransformResult::noTransform(); } diff --git a/src/graph/planner/match/SegmentsConnector.cpp b/src/graph/planner/match/SegmentsConnector.cpp index 2c6ecb73707..cc29fb85cb1 100644 --- a/src/graph/planner/match/SegmentsConnector.cpp +++ b/src/graph/planner/match/SegmentsConnector.cpp @@ -142,7 +142,7 @@ SubPlan SegmentsConnector::addInput(const SubPlan& left, const SubPlan& right, b siLeft->setLeftDep(const_cast(right.root)); siLeft->setLeftVar(right.root->outputVar()); } else { - LOG(DFATAL) << "Unsupported plan node: " << left.tail->kind(); + DLOG(FATAL) << "Unsupported plan node: " << left.tail->kind(); return newPlan; } newPlan.tail = right.tail; diff --git a/src/graph/planner/plan/PlanNode.cpp b/src/graph/planner/plan/PlanNode.cpp index 76f49d07a83..009812a5ab5 100644 --- a/src/graph/planner/plan/PlanNode.cpp +++ b/src/graph/planner/plan/PlanNode.cpp @@ -309,7 +309,7 @@ const char* PlanNode::toString(PlanNode::Kind kind) { return "GetDstBySrc"; // no default so the compiler will warning when lack } - LOG(DFATAL) << "Impossible kind plan node " << static_cast(kind); + DLOG(FATAL) << "Impossible kind plan node " << static_cast(kind); return "Unknown"; } diff --git a/src/graph/planner/plan/PlanNode.h b/src/graph/planner/plan/PlanNode.h index 4fad0c71074..aa4a8a78cd7 100644 --- a/src/graph/planner/plan/PlanNode.h +++ b/src/graph/planner/plan/PlanNode.h @@ -351,7 +351,7 @@ class SingleDependencyNode : public PlanNode { } PlanNode* clone() const override { - LOG(DFATAL) << "Shouldn't call the unimplemented method"; + DLOG(FATAL) << "Shouldn't call the unimplemented method"; return nullptr; } @@ -373,7 +373,7 @@ class SingleInputNode : public SingleDependencyNode { std::unique_ptr explain() const override; PlanNode* clone() const override { - LOG(DFATAL) << "Shouldn't call the unimplemented method"; + DLOG(FATAL) << "Shouldn't call the unimplemented method"; return nullptr; } @@ -423,7 +423,7 @@ class BinaryInputNode : public PlanNode { } PlanNode* clone() const override { - LOG(DFATAL) << "Shouldn't call the unimplemented method for " << kind_; + DLOG(FATAL) << "Shouldn't call the unimplemented method for " << kind_; return nullptr; } @@ -445,7 +445,7 @@ class VariableDependencyNode : public PlanNode { std::unique_ptr explain() const override; PlanNode* clone() const override { - LOG(DFATAL) << "Shouldn't call the unimplemented method"; + DLOG(FATAL) << "Shouldn't call the unimplemented method"; return nullptr; } diff --git a/src/graph/util/ParserUtil.cpp b/src/graph/util/ParserUtil.cpp index 1ab8c3b07ce..83a7490aba1 100644 --- a/src/graph/util/ParserUtil.cpp +++ b/src/graph/util/ParserUtil.cpp @@ -62,7 +62,7 @@ void ParserUtil::rewriteLC(QueryContext *qctx, return static_cast(mpp); } break; default: - LOG(DFATAL) << "Unexpected expression kind: " << expr->kind(); + DLOG(FATAL) << "Unexpected expression kind: " << expr->kind(); } return ret; }; diff --git a/src/graph/util/ToJson.cpp b/src/graph/util/ToJson.cpp index 5cc8cbea458..5c6b574690a 100644 --- a/src/graph/util/ToJson.cpp +++ b/src/graph/util/ToJson.cpp @@ -82,7 +82,7 @@ folly::dynamic toJson(const Value &value) { // TODO store to object or array return value.toString(); } - LOG(DFATAL) << "Impossible reach."; + DLOG(FATAL) << "Impossible reach."; return folly::dynamic::object(); } diff --git a/src/graph/validator/LookupValidator.cpp b/src/graph/validator/LookupValidator.cpp index 40694e1348b..4f185327280 100644 --- a/src/graph/validator/LookupValidator.cpp +++ b/src/graph/validator/LookupValidator.cpp @@ -534,7 +534,7 @@ Expression* LookupValidator::reverseRelKind(RelationalExpression* expr) { reversedKind = ExprKind::kRelLE; break; default: - LOG(DFATAL) << "Invalid relational expression kind: " << static_cast(kind); + DLOG(FATAL) << "Invalid relational expression kind: " << static_cast(kind); return expr; } diff --git a/src/graph/validator/Validator.cpp b/src/graph/validator/Validator.cpp index 4ed21d4d436..18b4732273a 100644 --- a/src/graph/validator/Validator.cpp +++ b/src/graph/validator/Validator.cpp @@ -260,10 +260,10 @@ std::unique_ptr Validator::makeValidator(Sentence* sentence, QueryCon case Sentence::Kind::kUnknown: case Sentence::Kind::kReturn: { // nothing - LOG(DFATAL) << "Unimplemented sentence " << kind; + DLOG(FATAL) << "Unimplemented sentence " << kind; } } - LOG(DFATAL) << "Unknown sentence " << static_cast(kind); + DLOG(FATAL) << "Unknown sentence " << static_cast(kind); return std::make_unique(sentence, context); } diff --git a/src/graph/visitor/DeduceTypeVisitor.cpp b/src/graph/visitor/DeduceTypeVisitor.cpp index d8689337d51..f6c3c5dba86 100644 --- a/src/graph/visitor/DeduceTypeVisitor.cpp +++ b/src/graph/visitor/DeduceTypeVisitor.cpp @@ -219,7 +219,7 @@ void DeduceTypeVisitor::visit(UnaryExpression *expr) { break; } default: { - LOG(DFATAL) << "Invalid unary expression kind: " << static_cast(expr->kind()); + DLOG(FATAL) << "Invalid unary expression kind: " << static_cast(expr->kind()); std::stringstream ss; ss << "`" << expr->toString() << "' is invalid unary expression, kind is " << static_cast(expr->kind()) << "."; @@ -284,7 +284,7 @@ void DeduceTypeVisitor::visit(ArithmeticExpression *expr) { break; } default: { - LOG(DFATAL) << "Invalid arithmetic expression kind: " << static_cast(expr->kind()); + DLOG(FATAL) << "Invalid arithmetic expression kind: " << static_cast(expr->kind()); std::stringstream ss; ss << "`" << expr->toString() << "' is invalid arithmetic expression, kind is " << static_cast(expr->kind()) << "."; @@ -430,7 +430,7 @@ void DeduceTypeVisitor::visit(LogicalExpression *expr) { break; } default: { - LOG(DFATAL) << "Invalid logical expression kind: " << static_cast(expr->kind()); + DLOG(FATAL) << "Invalid logical expression kind: " << static_cast(expr->kind()); std::stringstream ss; ss << "`" << expr->toString() << "' is invalid logical expression, kind is " << static_cast(expr->kind()) << "."; diff --git a/src/graph/visitor/ExtractPropExprVisitor.cpp b/src/graph/visitor/ExtractPropExprVisitor.cpp index 44531ddd02f..61e79c11c61 100644 --- a/src/graph/visitor/ExtractPropExprVisitor.cpp +++ b/src/graph/visitor/ExtractPropExprVisitor.cpp @@ -93,7 +93,7 @@ void ExtractPropExprVisitor::visit(UnaryExpression* expr) { break; } default: { - LOG(DFATAL) << "Invalid Kind " << expr->kind(); + DLOG(FATAL) << "Invalid Kind " << expr->kind(); reportError(expr); } } @@ -111,7 +111,7 @@ void ExtractPropExprVisitor::visitPropertyExpr(PropertyExpression* expr) { break; } default: { - LOG(DFATAL) << "Invalid Kind " << expr->kind(); + DLOG(FATAL) << "Invalid Kind " << expr->kind(); reportError(expr); return; } @@ -165,7 +165,7 @@ void ExtractPropExprVisitor::visitVertexEdgePropExpr(PropertyExpression* expr) { break; } default: { - LOG(DFATAL) << "Invalid Kind " << expr->kind(); + DLOG(FATAL) << "Invalid Kind " << expr->kind(); reportError(expr); return; } diff --git a/src/parser/AdminSentences.cpp b/src/parser/AdminSentences.cpp index 99ad3c3a306..f8581e98739 100644 --- a/src/parser/AdminSentences.cpp +++ b/src/parser/AdminSentences.cpp @@ -76,7 +76,7 @@ std::string SpaceOptItem::toString() const { case OptionType::GROUP_NAME: return ""; } - LOG(DFATAL) << "Space parameter illegal"; + DLOG(FATAL) << "Space parameter illegal"; return "Unknown"; } @@ -215,8 +215,8 @@ std::string AddListenerSentence::toString() const { buf += "ELASTICSEARCH "; break; case meta::cpp2::ListenerType::UNKNOWN: - LOG(DFATAL) << "Unknown listener type."; - return "Unknown"; + DLOG(FATAL) << "Unknown listener type."; + return ""; } buf += listeners_->toString(); return buf; @@ -231,8 +231,8 @@ std::string RemoveListenerSentence::toString() const { buf += "ELASTICSEARCH "; break; case meta::cpp2::ListenerType::UNKNOWN: - LOG(DFATAL) << "Unknown listener type."; - return "Unknown"; + DLOG(FATAL) << "Unknown listener type."; + return ""; } return buf; } @@ -309,8 +309,8 @@ std::string AdminJobSentence::toString() const { return str; } } - LOG(DFATAL) << "Unknown job operation " << static_cast(op_); - return "Unknown"; + DLOG(FATAL) << "Unknown job operation " << static_cast(op_); + return ""; } meta::cpp2::JobOp AdminJobSentence::getOp() const { @@ -351,8 +351,8 @@ std::string ShowServiceClientsSentence::toString() const { case meta::cpp2::ExternalServiceType::ELASTICSEARCH: return "SHOW TEXT SEARCH CLIENTS"; default: - LOG(DFATAL) << "Unknown service type " << static_cast(type_); - return "Unknown"; + DLOG(FATAL) << "Unknown service type " << static_cast(type_); + return ""; } } @@ -364,8 +364,8 @@ std::string SignInServiceSentence::toString() const { buf += "SIGN IN TEXT SERVICE "; break; default: - LOG(DFATAL) << "Unknown service type " << static_cast(type_); - return "Unknown"; + DLOG(FATAL) << "Unknown service type " << static_cast(type_); + return ""; } for (auto &client : clients_->clients()) { @@ -404,8 +404,8 @@ std::string SignOutServiceSentence::toString() const { case meta::cpp2::ExternalServiceType::ELASTICSEARCH: return "SIGN OUT TEXT SERVICE"; default: - LOG(DFATAL) << "Unknown service type " << static_cast(type_); - return "Unknown"; + DLOG(FATAL) << "Unknown service type " << static_cast(type_); + return ""; } } diff --git a/src/parser/MaintainSentences.cpp b/src/parser/MaintainSentences.cpp index ea881b09e70..7167a536f49 100644 --- a/src/parser/MaintainSentences.cpp +++ b/src/parser/MaintainSentences.cpp @@ -25,8 +25,8 @@ std::string SchemaPropItem::toString() const { case COMMENT: return folly::stringPrintf("comment = \"%s\"", std::get(propValue_).c_str()); } - LOG(DFATAL) << "Schema property type illegal"; - return "Unknown"; + DLOG(FATAL) << "Schema property type illegal"; + return ""; } std::string SchemaPropList::toString() const { @@ -239,8 +239,8 @@ std::string IndexParamItem::toString() const { case S2_MAX_CELLS: return folly::stringPrintf("s2_max_cells = \"%ld\"", paramValue_.getInt()); } - LOG(DFATAL) << "Index param type illegal"; - return "Unknown"; + DLOG(FATAL) << "Index param type illegal"; + return ""; } std::string IndexParamList::toString() const { diff --git a/src/parser/TraverseSentences.cpp b/src/parser/TraverseSentences.cpp index a773e5e9d82..fcd12a862ea 100644 --- a/src/parser/TraverseSentences.cpp +++ b/src/parser/TraverseSentences.cpp @@ -124,8 +124,8 @@ std::string OrderFactor::toString() const { case DESCEND: return folly::stringPrintf("%s DESC,", expr_->toString().c_str()); default: - LOG(DFATAL) << "Unknown Order Type: " << orderType_; - return "Unknown"; + DLOG(FATAL) << "Unknown Order Type: " << orderType_; + return ""; } } diff --git a/src/storage/GraphStorageServiceHandler.cpp b/src/storage/GraphStorageServiceHandler.cpp index d03ce0bc5dc..d9e6688f0c0 100644 --- a/src/storage/GraphStorageServiceHandler.cpp +++ b/src/storage/GraphStorageServiceHandler.cpp @@ -160,7 +160,7 @@ folly::Future GraphStorageServiceHandler::future_scanEdge( folly::Future GraphStorageServiceHandler::future_getUUID( const cpp2::GetUUIDReq&) { - LOG(DFATAL) << "Unsupported in version 2.0"; + DLOG(FATAL) << "Unsupported in version 2.0"; cpp2::GetUUIDResp resp; cpp2::ResponseCommon result; diff --git a/src/storage/StorageServer.cpp b/src/storage/StorageServer.cpp index 40226d42d95..6bb98f9f76f 100644 --- a/src/storage/StorageServer.cpp +++ b/src/storage/StorageServer.cpp @@ -107,10 +107,10 @@ std::unique_ptr StorageServer::getStoreInstance() { } return nbStore; } else if (FLAGS_store_type == "hbase") { - LOG(DFATAL) << "HBase store has not been implemented"; + DLOG(FATAL) << "HBase store has not been implemented"; return nullptr; } else { - LOG(DFATAL) << "Unknown store type \"" << FLAGS_store_type << "\""; + DLOG(FATAL) << "Unknown store type \"" << FLAGS_store_type << "\""; return nullptr; } return nullptr; @@ -163,7 +163,7 @@ int32_t StorageServer::getAdminStoreSeqId() { newVal.append(reinterpret_cast(&curSeqId), sizeof(int32_t)); auto ret = env_->adminStore_->put(key, newVal); if (ret != nebula::cpp2::ErrorCode::SUCCEEDED) { - LOG(DFATAL) << "Write put in admin-storage seq id " << curSeqId << " failed."; + DLOG(FATAL) << "Write put in admin-storage seq id " << curSeqId << " failed."; return -1; } return curSeqId; diff --git a/src/storage/context/StorageExpressionContext.h b/src/storage/context/StorageExpressionContext.h index a51db60105c..ca84ace9fce 100644 --- a/src/storage/context/StorageExpressionContext.h +++ b/src/storage/context/StorageExpressionContext.h @@ -89,7 +89,7 @@ class StorageExpressionContext final : public ExpressionContext { // Get index of property in variable tuple StatusOr getVarPropIndex(const std::string&, const std::string&) const override { - LOG(DFATAL) << "Unimplemented"; + DLOG(FATAL) << "Unimplemented"; return Status::Error("Unimplemented"); } @@ -114,7 +114,7 @@ class StorageExpressionContext final : public ExpressionContext { // Get index of property in input tuple StatusOr getInputPropIndex(const std::string&) const override { - LOG(DFATAL) << "Unimplemented"; + DLOG(FATAL) << "Unimplemented"; return Status::Error("Unimplemented"); } @@ -192,7 +192,7 @@ class StorageExpressionContext final : public ExpressionContext { */ Value getVertex(const std::string& name = "") const override { UNUSED(name); - LOG(DFATAL) << "Unimplemented"; + DLOG(FATAL) << "Unimplemented"; return Value::kNullBadData; } @@ -202,7 +202,7 @@ class StorageExpressionContext final : public ExpressionContext { * @return Value */ Value getEdge() const override { - LOG(DFATAL) << "Unimplemented"; + DLOG(FATAL) << "Unimplemented"; return Value::kNullBadData; } diff --git a/src/storage/exec/IndexExprContext.h b/src/storage/exec/IndexExprContext.h index a96b231c261..6dbe7539f9f 100644 --- a/src/storage/exec/IndexExprContext.h +++ b/src/storage/exec/IndexExprContext.h @@ -63,7 +63,7 @@ class IndexExprContext : public ExpressionContext { StatusOr getVarPropIndex(const std::string &var, const std::string &prop) const override { UNUSED(var), UNUSED(prop); - LOG(DFATAL) << "Unimplemented"; + DLOG(FATAL) << "Unimplemented"; return Status::Error("Unimplemented"); } Value getSrcProp(const std::string &tag, const std::string &prop) const override { @@ -80,7 +80,7 @@ class IndexExprContext : public ExpressionContext { } StatusOr getInputPropIndex(const std::string &prop) const override { UNUSED(prop); - LOG(DFATAL) << "Unimplemented"; + DLOG(FATAL) << "Unimplemented"; return Status::Error("Unimplemented"); } Value getVertex(const std::string &) const override { diff --git a/src/storage/exec/MultiTagNode.h b/src/storage/exec/MultiTagNode.h index 50698469994..9398a556f7b 100644 --- a/src/storage/exec/MultiTagNode.h +++ b/src/storage/exec/MultiTagNode.h @@ -95,17 +95,17 @@ class MultiTagNode : public IterateNode { } folly::StringPiece key() const override { - LOG(DFATAL) << "not allowed to do this"; + DLOG(FATAL) << "not allowed to do this"; return ""; } folly::StringPiece val() const override { - LOG(DFATAL) << "not allowed to do this"; + DLOG(FATAL) << "not allowed to do this"; return ""; } RowReader* reader() const override { - LOG(DFATAL) << "not allowed to do this"; + DLOG(FATAL) << "not allowed to do this"; return nullptr; } diff --git a/src/storage/exec/QueryUtils.h b/src/storage/exec/QueryUtils.h index 42d433c7ae3..cbc685bb1e9 100644 --- a/src/storage/exec/QueryUtils.h +++ b/src/storage/exec/QueryUtils.h @@ -163,7 +163,7 @@ class QueryUtils final { } } default: - LOG(DFATAL) << "Should not read here"; + LOG(FATAL) << "Should not read here"; } return Status::Error(folly::stringPrintf("Invalid property %s", prop.name_.c_str())); } @@ -191,7 +191,7 @@ class QueryUtils final { return tag; } default: - LOG(DFATAL) << "Should not read here"; + LOG(FATAL) << "Should not read here"; } return Status::Error(folly::stringPrintf("Invalid property %s", prop.name_.c_str())); } diff --git a/src/storage/exec/StorageIterator.h b/src/storage/exec/StorageIterator.h index e26833b27a4..195bd8f5c52 100644 --- a/src/storage/exec/StorageIterator.h +++ b/src/storage/exec/StorageIterator.h @@ -173,7 +173,7 @@ class SingleEdgeKeyIterator : public SingleEdgeIterator { } RowReader* reader() const override { - LOG(DFATAL) << "This iterator should not read value"; + DLOG(FATAL) << "This iterator should not read value"; return nullptr; } }; diff --git a/src/storage/transaction/ChainProcessorFactory.cpp b/src/storage/transaction/ChainProcessorFactory.cpp index ed660d60992..ee347f896e2 100644 --- a/src/storage/transaction/ChainProcessorFactory.cpp +++ b/src/storage/transaction/ChainProcessorFactory.cpp @@ -61,7 +61,7 @@ ChainBaseProcessor* ChainProcessorFactory::makeProcessor(StorageEnv* env, break; } case ResumeType::UNKNOWN: { - LOG(DFATAL) << "ResumeType::UNKNOWN: not supposed run here"; + DLOG(FATAL) << "ResumeType::UNKNOWN: not supposed run here"; return nullptr; } } @@ -80,7 +80,7 @@ ChainBaseProcessor* ChainProcessorFactory::makeProcessor(StorageEnv* env, break; } case ResumeType::UNKNOWN: { - LOG(DFATAL) << "ResumeType::UNKNOWN: not supposed run here"; + DLOG(FATAL) << "ResumeType::UNKNOWN: not supposed run here"; return nullptr; } } @@ -99,14 +99,14 @@ ChainBaseProcessor* ChainProcessorFactory::makeProcessor(StorageEnv* env, break; } case ResumeType::UNKNOWN: { - LOG(DFATAL) << "ResumeType::UNKNOWN: not supposed run here"; + DLOG(FATAL) << "ResumeType::UNKNOWN: not supposed run here"; return nullptr; } } break; } case RequestType::UNKNOWN: { - LOG(DFATAL) << "RequestType::UNKNOWN: not supposed run here"; + DLOG(FATAL) << "RequestType::UNKNOWN: not supposed run here"; return nullptr; } } diff --git a/src/storage/transaction/ConsistUtil.cpp b/src/storage/transaction/ConsistUtil.cpp index d1aa3c0a3cb..3ba7ba9bdd5 100644 --- a/src/storage/transaction/ConsistUtil.cpp +++ b/src/storage/transaction/ConsistUtil.cpp @@ -72,7 +72,7 @@ RequestType ConsistUtil::parseType(folly::StringPiece val) { case 'd': return RequestType::DELETE; default: - LOG(DFATAL) << "should not happen, identifier is " << identifier; + LOG(FATAL) << "should not happen, identifier is " << identifier; return RequestType::UNKNOWN; } } From 07e3e92f73f3ecdae7e5cfbf5f534d137a120df6 Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Tue, 3 Jan 2023 13:12:21 +0800 Subject: [PATCH 2/3] fix. --- src/graph/optimizer/rule/PushEFilterDownRule.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/graph/optimizer/rule/PushEFilterDownRule.cpp b/src/graph/optimizer/rule/PushEFilterDownRule.cpp index 32b67c8de59..ac886530210 100644 --- a/src/graph/optimizer/rule/PushEFilterDownRule.cpp +++ b/src/graph/optimizer/rule/PushEFilterDownRule.cpp @@ -175,8 +175,6 @@ std::string PushEFilterDownRule::toString() const { break; default: DLOG(FATAL) << "Unexpected expr: " << exp->kind(); - // in case the exp cannot be rewritten, return the original exp - ret = exp; } return ret; } 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 3/3] 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; }