-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #934: multithread compactiong support
- Loading branch information
caijieming
committed
Aug 29, 2016
1 parent
b66c065
commit 4ee16ed
Showing
101 changed files
with
4,426 additions
and
4,429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,50 @@ | ||
// Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
// | ||
// A ErrorCode encapsulates the result of an operation. | ||
|
||
#ifndef TERA_ERROR_CODE_H_ | ||
#define TERA_ERROR_CODE_H_ | ||
#ifndef TERA_ERROR_CODE_ | ||
#define TERA_ERROR_CODE_ | ||
|
||
#include <stdint.h> | ||
#include <list> | ||
#include <map> | ||
#include <set> | ||
#include <string> | ||
#include <vector> | ||
|
||
#pragma GCC visibility push(default) | ||
|
||
namespace tera { | ||
|
||
class ErrorCode { | ||
public: | ||
enum ErrorCodeType { | ||
kOK = 0, | ||
kNotFound = 1, | ||
kBadParam = 2, | ||
kSystem = 3, | ||
kTimeout = 4, | ||
kBusy = 5, | ||
kNoQuota = 6, | ||
kNoAuth = 7, | ||
kUnknown = 8, | ||
kNotImpl = 9, | ||
kTxnFail = 10 | ||
kOK = 0, | ||
kNotFound, | ||
kBadParam, | ||
kSystem, | ||
kTimeout, | ||
kBusy, | ||
kNoQuota, | ||
kNoAuth, | ||
kUnknown, | ||
kNotImpl, | ||
kTxnFail | ||
}; | ||
|
||
public: | ||
// Returns a string includes type&reason | ||
// Format: "type [kOK], reason [success]" | ||
ErrorCode(); | ||
std::string ToString() const; | ||
|
||
ErrorCodeType GetType() const; | ||
std::string GetReason() const; | ||
|
||
// Internal funcion, do not use | ||
ErrorCode(); | ||
ErrorCodeType GetType() const; | ||
void SetFailed(ErrorCodeType err, const std::string& reason = ""); | ||
|
||
private: | ||
ErrorCodeType _err; | ||
std::string _reason; | ||
}; | ||
|
||
// DEPRECATED. Use error_code.ToString() instead. | ||
const char* strerr(ErrorCode error_code); | ||
|
||
} // namespace tera | ||
#pragma GCC visibility pop | ||
#endif // TERA_ERROR_CODE_H_ | ||
|
||
#endif // TERA_ERROR_CODE_ |
Oops, something went wrong.