Kudu C++ client API
Public Member Functions | Static Public Member Functions | List of all members
kudu::Status Class Reference

A representation of an operation's outcome. More...

#include <status.h>

Public Member Functions

 Status ()
 Create an object representing success status.
 
 Status (const Status &s)
 
void operator= (const Status &s)
 
bool ok () const
 
bool IsNotFound () const
 
bool IsCorruption () const
 
bool IsNotSupported () const
 
bool IsIOError () const
 
bool IsInvalidArgument () const
 
bool IsAlreadyPresent () const
 
bool IsRuntimeError () const
 
bool IsNetworkError () const
 
bool IsIllegalState () const
 
bool IsNotAuthorized () const
 
bool IsAborted () const
 
bool IsRemoteError () const
 
bool IsServiceUnavailable () const
 
bool IsTimedOut () const
 
bool IsUninitialized () const
 
bool IsConfigurationError () const
 
bool IsIncomplete () const
 
bool IsEndOfFile () const
 
std::string ToString () const
 
std::string CodeAsString () const
 
Slice message () const
 
int16_t posix_code () const
 
Status CloneAndPrepend (const Slice &msg) const
 
Status CloneAndAppend (const Slice &msg) const
 
size_t memory_footprint_excluding_this () const
 
size_t memory_footprint_including_this () const
 

Static Public Member Functions

static Status OK ()
 
Methods to build status objects for various types of errors.
Parameters
[in]msgThe informational message on the error.
[in]msg2Additional information on the error (optional).
[in]posix_codePOSIX error code, if applicable (optional).
Returns
The error status of an appropriate type.
static Status NotFound (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status Corruption (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status NotSupported (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status InvalidArgument (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status IOError (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status AlreadyPresent (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status RuntimeError (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status NetworkError (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status IllegalState (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status NotAuthorized (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status Aborted (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status RemoteError (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status ServiceUnavailable (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status TimedOut (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status Uninitialized (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status ConfigurationError (const Slice &msg, const Slice &msg2=Slice(), int16_t posix_code=-1)
 
static Status Incomplete (const Slice &msg, const Slice &msg2=Slice(), int64_t posix_code=-1)
 
static Status EndOfFile (const Slice &msg, const Slice &msg2=Slice(), int64_t posix_code=-1)
 

Detailed Description

A representation of an operation's outcome.

Constructor & Destructor Documentation

kudu::Status::Status ( const Status s)
inline

Copy the specified status.

Parameters
[in]sThe status object to copy from.

Member Function Documentation

Status kudu::Status::CloneAndAppend ( const Slice msg) const

Clone the object and add the specified suffix to the clone's message.

Parameters
[in]msgThe message to append.
Returns
A new Status object with the same state plus an additional trailing message.
Status kudu::Status::CloneAndPrepend ( const Slice msg) const

Clone the object and add the specified prefix to the clone's message.

Parameters
[in]msgThe message to prepend.
Returns
A new Status object with the same state plus an additional leading message.
std::string kudu::Status::CodeAsString ( ) const
Returns
A string representation of the status code, without the message text or posix code information.
bool kudu::Status::IsAborted ( ) const
inline
Returns
true iff the status indicates an Aborted error.
bool kudu::Status::IsAlreadyPresent ( ) const
inline
Returns
true iff the status indicates an AlreadyPresent error.
bool kudu::Status::IsConfigurationError ( ) const
inline
Returns
true iff the status indicates ConfigurationError.
bool kudu::Status::IsCorruption ( ) const
inline
Returns
true iff the status indicates a Corruption error.
bool kudu::Status::IsEndOfFile ( ) const
inline
Returns
true iff the status indicates end of file.
bool kudu::Status::IsIllegalState ( ) const
inline
Returns
true iff the status indicates an IllegalState error.
bool kudu::Status::IsIncomplete ( ) const
inline
Returns
true iff the status indicates Incomplete.
bool kudu::Status::IsInvalidArgument ( ) const
inline
Returns
true iff the status indicates an InvalidArgument error.
bool kudu::Status::IsIOError ( ) const
inline
Returns
true iff the status indicates an IOError.
bool kudu::Status::IsNetworkError ( ) const
inline
Returns
true iff the status indicates a NetworkError.
bool kudu::Status::IsNotAuthorized ( ) const
inline
Returns
true iff the status indicates a NotAuthorized error.
bool kudu::Status::IsNotFound ( ) const
inline
Returns
true iff the status indicates a NotFound error.
bool kudu::Status::IsNotSupported ( ) const
inline
Returns
true iff the status indicates a NotSupported error.
bool kudu::Status::IsRemoteError ( ) const
inline
Returns
true iff the status indicates a RemoteError.
bool kudu::Status::IsRuntimeError ( ) const
inline
Returns
true iff the status indicates a RuntimeError.
bool kudu::Status::IsServiceUnavailable ( ) const
inline
Returns
true iff the status indicates ServiceUnavailable.
bool kudu::Status::IsTimedOut ( ) const
inline
Returns
true iff the status indicates TimedOut.
bool kudu::Status::IsUninitialized ( ) const
inline
Returns
true iff the status indicates Uninitialized.
size_t kudu::Status::memory_footprint_excluding_this ( ) const
Returns
The memory usage of this object without the object itself. Should be used when embedded inside another object.
size_t kudu::Status::memory_footprint_including_this ( ) const
Returns
The memory usage of this object including the object itself. Should be used when allocated on the heap.
Slice kudu::Status::message ( ) const

This is similar to ToString, except that it does not include the stringified error code or posix code.

Note
The returned Slice is only valid as long as this Status object remains live and unchanged.
Returns
The message portion of the Status. For OK statuses, this returns an empty string.
static Status kudu::Status::OK ( )
inlinestatic
Returns
A success status.
bool kudu::Status::ok ( ) const
inline
Returns
true iff the status indicates success.
void kudu::Status::operator= ( const Status s)
inline

Assign the specified status.

Parameters
[in]sThe status object to assign from.
int16_t kudu::Status::posix_code ( ) const
Returns
The POSIX code associated with this Status object, or -1 if there is none.
std::string kudu::Status::ToString ( ) const
Returns
A string representation of this status suitable for printing. Returns the string "OK" for success.

The documentation for this class was generated from the following file: