17 #ifndef KUDU_CLIENT_WRITE_OP_H
18 #define KUDU_CLIENT_WRITE_OP_H
22 #include "kudu/client/shared_ptr.h"
23 #include "kudu/common/partial_row.h"
24 #include "kudu/util/kudu_export.h"
77 virtual std::string ToString()
const = 0;
88 virtual Type type()
const = 0;
93 sp::shared_ptr<KuduTable>
const table_;
101 friend class internal::Batcher;
102 friend class internal::WriteRpc;
107 EncodedKey* CreateKey()
const;
109 const KuduTable* table()
const {
return table_.get(); }
113 int64_t SizeInBuffer()
const;
115 DISALLOW_COPY_AND_ASSIGN(KuduWriteOperation);
128 virtual std::string
ToString() const OVERRIDE {
return "INSERT " + row_.ToString(); }
134 virtual Type type() const OVERRIDE {
141 friend class KuduTable;
142 explicit KuduInsert(
const sp::shared_ptr<KuduTable>& table);
153 virtual std::string
ToString() const OVERRIDE {
return "UPSERT " + row_.ToString(); }
159 virtual Type type() const OVERRIDE {
166 friend class KuduTable;
167 explicit KuduUpsert(
const sp::shared_ptr<KuduTable>& table);
180 virtual std::string
ToString() const OVERRIDE {
return "UPDATE " + row_.ToString(); }
186 virtual Type type() const OVERRIDE {
193 friend class KuduTable;
194 explicit KuduUpdate(
const sp::shared_ptr<KuduTable>& table);
207 virtual std::string
ToString() const OVERRIDE {
return "DELETE " + row_.ToString(); }
213 virtual Type type() const OVERRIDE {
220 friend class KuduTable;
221 explicit KuduDelete(
const sp::shared_ptr<KuduTable>& table);
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:180
A single row update to be sent to the cluster.
Definition: write_op.h:175
A single row insert to be sent to the cluster.
Definition: write_op.h:123
A single row upsert to be sent to the cluster.
Definition: write_op.h:148
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:128
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:153
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:207
const KuduPartialRow & row() const
Definition: write_op.h:69
A representation of a table on a particular cluster.
Definition: client.h:648
A single-row write operation to be sent to a Kudu table.
Definition: write_op.h:55
KuduPartialRow * mutable_row()
Definition: write_op.h:74
Type
Write operation types.
Definition: write_op.h:58
A single row delete to be sent to the cluster.
Definition: write_op.h:202
A row which may only contain values for a subset of the columns.
Definition: partial_row.h:53