Kudu C++ client API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions
kudu Namespace Reference

Classes

class  KuduPartialRow
 A row which may only contain values for a subset of the columns. More...
 
class  MonoDelta
 A representation of a time interval. More...
 
class  MonoTime
 Representation of a particular point in time. More...
 
class  Slice
 A wrapper around externally allocated data. More...
 
struct  SliceMap
 STL map whose keys are Slices. More...
 
class  Status
 A representation of an operation's outcome. More...
 

Functions

void KUDU_EXPORT SleepFor (const MonoDelta &delta)
 
bool operator== (const Slice &x, const Slice &y)
 
bool operator!= (const Slice &x, const Slice &y)
 
std::ostream & operator<< (std::ostream &o, const Slice &s)
 

Detailed Description

Kudu uses c++11 features internally, but provides a client interface which does not require c++11. We use std::tr1::shared_ptr in our public interface to hold shared instances of KuduClient, KuduSession, and KuduTable.

Unfortunately, on OS X, libc++ is the default c++ standard library implementation and is required when compiling with c++11, but it does not include the tr1 APIs. As a workaround, we use std::shared_ptr on OS X, since OS X is for development only, and it is acceptable to require clients to compile with c++11.

In order to allow applications to compile against Kudu on both Linux and OS X, we provide this typedef which resolves to std::tr1::shared_ptr on Linux and std::shared_ptr on OS X. Clients are encouraged to use these typedefs in order to ensure that applications will compile on both Linux and OS X.

Function Documentation

bool kudu::operator!= ( const Slice &  x,
const Slice &  y 
)
inline

Check whether two slices are not identical.

Parameters
[in]xOne slice.
[in]yAnother slice.
Returns
true iff slices contain different data.
std::ostream& kudu::operator<< ( std::ostream &  o,
const Slice &  s 
)
inline

Output printable representation of the slice into the given output stream.

Parameters
[out]oThe output stream to print the info.
[in]sThe slice to print.
Returns
Reference to the updated output stream.
bool kudu::operator== ( const Slice &  x,
const Slice &  y 
)
inline

Check whether two slices are identical.

Parameters
[in]xOne slice.
[in]yAnother slice.
Returns
true iff two slices contain byte-for-byte identical data.
void KUDU_EXPORT kudu::SleepFor ( const MonoDelta &  delta)

Sleep for an interval specified by a MonoDelta instance.

This is preferred over sleep(3), usleep(3), and nanosleep(3). It's less prone to mixups with units since it uses the MonoDelta for interval specification. Besides, it ignores signals/EINTR, so will reliably sleep at least for the MonoDelta duration.

Parameters
[in]deltaThe time interval to sleep for.