yiguolei commented on code in PR #11704:
URL: https://github.com/apache/doris/pull/11704#discussion_r944040389


##########
be/src/common/status.h:
##########
@@ -241,47 +240,36 @@ enum ErrorCode {
 };
 
 class Status {
-    enum {
-        // If the error and log returned by the query are truncated, the 
status to string may be too long.
-        STATE_CAPACITY = 2048,
-        HEADER_LEN = 7,
-        MESSAGE_LEN = STATE_CAPACITY - HEADER_LEN
-    };
-
 public:
-    Status() : _length(0) {}
+    Status() : _code(0) {}
 
     // copy c'tor makes copy of error detail so Status can be returned by value
-    Status(const Status& rhs) { *this = rhs; }
+    Status(const Status& rhs) = default;
 
     // move c'tor
-    Status(Status&& rhs) { *this = rhs; }
+    Status(Status&& rhs) noexcept = default;
 
     // same as copy c'tor
-    Status& operator=(const Status& rhs) {
-        if (rhs._length) {
-            memcpy(_state, rhs._state, rhs._length);
-        } else {
-            _length = 0;
-        }
-        return *this;
-    }
+    Status& operator=(const Status& rhs) = default;
 
     // move assign
-    Status& operator=(Status&& rhs) {
-        this->operator=(rhs);
-        return *this;
-    }
+    Status& operator=(Status&& rhs) noexcept = default;
 
     // "Copy" c'tor from TStatus.
     Status(const TStatus& status);
 
     Status(const PStatus& pstatus);
 
+    Status(TStatusCode::type code, std::string_view msg, int16_t precise_code 
= 1)

Review Comment:
   If these method is public, then user could call this method directly. Error 
stack is missing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to