Kudu C++ client API
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
kudu::client::KuduWriteOperation Class Referenceabstract

A single-row write operation to be sent to a Kudu table. More...

#include <write_op.h>

Inheritance diagram for kudu::client::KuduWriteOperation:
kudu::client::KuduDelete kudu::client::KuduDeleteIgnore kudu::client::KuduInsert kudu::client::KuduInsertIgnore kudu::client::KuduUpdate kudu::client::KuduUpdateIgnore kudu::client::KuduUpsert kudu::client::KuduUpsertIgnore

Public Types

enum  Type {
  INSERT = 1 , UPDATE = 2 , DELETE = 3 , UPSERT = 4 ,
  INSERT_IGNORE = 5 , UPDATE_IGNORE = 6 , DELETE_IGNORE = 7 , UPSERT_IGNORE = 8
}
 Write operation types.
 

Public Member Functions

const KuduPartialRowrow () const
 
KuduPartialRowmutable_row ()
 
virtual std::string ToString () const =0
 
const KuduTabletable () const
 

Detailed Description

A single-row write operation to be sent to a Kudu table.

This is the abstract base class from which the particular row operations (KuduInsert, KuduUpdate, etc) are derived. These subclasses are instantiated by KuduTable::NewInsert(), etc.

The row key, as well as the columns to be inserted or updated are set using the embedded KuduPartialRow object accessible via mutable_row().

Typical usage example:

KUDU_CHECK_OK(t->mutable_row()->SetInt32("key", 1234));
KUDU_CHECK_OK(session->Apply(t));
Status SetInt32(const Slice &col_name, int32_t val) WARN_UNUSED_RESULT
Status SetStringCopy(const Slice &col_name, const Slice &val) WARN_UNUSED_RESULT
A single row insert to be sent to the cluster.
Definition write_op.h:145
KuduInsert * NewInsert()
const KuduTable * table() const
Definition write_op.h:100
KuduPartialRow * mutable_row()
Definition write_op.h:89
#define KUDU_CHECK_OK(s)
If the status is bad, CHECK immediately, appending the status to the logged message.
Definition status.h:102

Member Function Documentation

◆ mutable_row()

KuduPartialRow * kudu::client::KuduWriteOperation::mutable_row ( )
inline
Note
To work with a row, use the KuduPartialRow API for field setters, etc.
Returns
Pointer to the corresponding row-like object.

◆ row()

const KuduPartialRow & kudu::client::KuduWriteOperation::row ( ) const
inline
Note
To work with a row, use the KuduPartialRow API for field getters, etc.
Returns
Immutable reference to the corresponding row-like object.

◆ table()

const KuduTable * kudu::client::KuduWriteOperation::table ( ) const
inline
Returns
Raw pointer to KuduTable object representing the table that the write is targeted for.

◆ ToString()

virtual std::string kudu::client::KuduWriteOperation::ToString ( ) const
pure virtual

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