Kudu C++ client API
|
#include <errno.h>
#include <stdint.h>
#include <cstddef>
#include <string>
#include "kudu/client/stubs.h"
#include "kudu/util/kudu_export.h"
#include "kudu/util/slice.h"
Go to the source code of this file.
Classes | |
class | kudu::Status |
A representation of an operation's outcome. More... | |
Macros | |
#define | KUDU_RETURN_NOT_OK(s) |
Return the given status if it is not OK . More... | |
#define | KUDU_RETURN_NOT_OK_PREPEND(s, msg) |
Return the given status if it is not OK, but first clone it and prepend the given message. More... | |
#define | KUDU_RETURN_NOT_OK_RET(to_call, to_return) |
Return to_return if to_call returns a bad status. The substitution for 'to_return' may reference the variable s for the bad status. More... | |
#define | KUDU_WARN_NOT_OK(to_call, warning_prefix) |
Emit a warning if to_call returns a bad status. More... | |
#define | KUDU_LOG_AND_RETURN(level, status) |
Log the given status and return immediately. More... | |
#define | KUDU_RETURN_NOT_OK_LOG(s, level, msg) |
If the given status is not OK, log it and 'msg' at 'level' and return the status. More... | |
#define | KUDU_CHECK_OK_PREPEND(to_call, msg) |
If to_call returns a bad status, CHECK immediately with a logged message of msg followed by the status. More... | |
#define | KUDU_CHECK_OK(s) KUDU_CHECK_OK_PREPEND(s, "Bad status") |
If the status is bad, CHECK immediately, appending the status to the logged message. | |
#define | KUDU_DCHECK_OK_PREPEND(to_call, msg) |
If to_call returns a bad status, DCHECK immediately with a logged message of msg followed by the status. More... | |
#define | KUDU_DCHECK_OK(s) KUDU_DCHECK_OK_PREPEND(s, "Bad status") |
If the status is bad, DCHECK immediately, appending the status to the logged 'Bad status' message. | |
This header is used in both the Kudu build as well as in builds of applications that use the Kudu C++ client. In the latter we need to be careful to "namespace" our macros, to avoid colliding or overriding with similarly named macros belonging to the application.
KUDU_HEADERS_USE_SHORT_STATUS_MACROS handles this behavioral change. When defined, we're building Kudu and:
#define KUDU_CHECK_OK_PREPEND | ( | to_call, | |
msg | |||
) |
If to_call
returns a bad status, CHECK immediately with a logged message of msg
followed by the status.
#define KUDU_DCHECK_OK_PREPEND | ( | to_call, | |
msg | |||
) |
If to_call
returns a bad status, DCHECK immediately with a logged message of msg
followed by the status.
#define KUDU_LOG_AND_RETURN | ( | level, | |
status | |||
) |
Log the given status and return immediately.
#define KUDU_RETURN_NOT_OK | ( | s | ) |
Return the given status if it is not OK
.
#define KUDU_RETURN_NOT_OK_LOG | ( | s, | |
level, | |||
msg | |||
) |
If the given status is not OK, log it and 'msg' at 'level' and return the status.
#define KUDU_RETURN_NOT_OK_PREPEND | ( | s, | |
msg | |||
) |
Return the given status if it is not OK, but first clone it and prepend the given message.
#define KUDU_RETURN_NOT_OK_RET | ( | to_call, | |
to_return | |||
) |
Return to_return
if to_call
returns a bad status. The substitution for 'to_return' may reference the variable s
for the bad status.
#define KUDU_WARN_NOT_OK | ( | to_call, | |
warning_prefix | |||
) |
Emit a warning if to_call
returns a bad status.