17 #ifndef KUDU_CLIENT_WRITE_OP_H
18 #define KUDU_CLIENT_WRITE_OP_H
28 #include "kudu/common/partial_row.h"
29 #include "kudu/util/kudu_export.h"
31 #ifdef KUDU_HEADERS_NO_STUBS
32 #include "kudu/gutil/macros.h"
33 #include "kudu/gutil/port.h"
35 #include "kudu/client/stubs.h"
97 const KuduTable* table()
const {
return table_.get(); }
109 virtual Type type()
const = 0;
114 sp::shared_ptr<KuduTable>
const table_;
122 friend class internal::Batcher;
123 friend class internal::WriteRpc;
124 friend class internal::ErrorCollector;
130 int64_t SizeInBuffer()
const;
132 mutable int64_t size_in_buffer_;
147 virtual std::string
ToString() const OVERRIDE {
return "INSERT " + row_.ToString(); }
153 virtual Type type() const OVERRIDE {
160 friend class KuduTable;
161 explicit KuduInsert(
const sp::shared_ptr<KuduTable>& table);
174 virtual std::string
ToString() const OVERRIDE {
return "INSERT IGNORE " + row_.ToString(); }
180 virtual Type type() const OVERRIDE {
181 return INSERT_IGNORE;
187 friend class KuduTable;
188 explicit KuduInsertIgnore(
const sp::shared_ptr<KuduTable>& table);
200 virtual std::string
ToString() const OVERRIDE {
return "UPSERT " + row_.ToString(); }
206 virtual Type type() const OVERRIDE {
213 friend class KuduTable;
214 explicit KuduUpsert(
const sp::shared_ptr<KuduTable>& table);
227 virtual std::string
ToString() const OVERRIDE {
return "UPDATE " + row_.ToString(); }
233 virtual Type type() const OVERRIDE {
240 friend class KuduTable;
241 explicit KuduUpdate(
const sp::shared_ptr<KuduTable>& table);
253 virtual std::string
ToString() const OVERRIDE {
return "UPDATE IGNORE " + row_.ToString(); }
259 virtual Type type() const OVERRIDE {
260 return UPDATE_IGNORE;
266 friend class KuduTable;
267 explicit KuduUpdateIgnore(
const sp::shared_ptr<KuduTable>& table);
279 virtual std::string
ToString() const OVERRIDE {
return "DELETE " + row_.ToString(); }
285 virtual Type type() const OVERRIDE {
292 friend class KuduTable;
293 explicit KuduDelete(
const sp::shared_ptr<KuduTable>& table);
305 virtual std::string
ToString() const OVERRIDE {
return "DELETE IGNORE " + row_.ToString(); }
311 virtual Type type() const OVERRIDE {
312 return DELETE_IGNORE;
318 friend class KuduTable;
319 explicit KuduDeleteIgnore(
const sp::shared_ptr<KuduTable>& table);
Representation of a Kudu client session.
Definition: client.h:2176
KuduPartialRow * mutable_row()
Definition: write_op.h:88
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:200
A single row delete ignore to be sent to the cluster.
Definition: write_op.h:300
Smart pointer typedefs for externally-faced code.
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:227
A row which may only contain values for a subset of the columns.
Definition: partial_row.h:72
A single row update to be sent to the cluster.
Definition: write_op.h:222
const KuduPartialRow & row() const
Definition: write_op.h:83
virtual std::string ToString() const =0
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:174
A single row upsert to be sent to the cluster.
Definition: write_op.h:195
A single-row write operation to be sent to a Kudu table.
Definition: write_op.h:66
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:147
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:305
Type
Write operation types.
Definition: write_op.h:69
A representation of a table on a particular cluster.
Definition: client.h:1521
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:253
virtual std::string ToString() const OVERRIDE
Definition: write_op.h:279
A single row delete to be sent to the cluster.
Definition: write_op.h:274
A single row insert to be sent to the cluster.
Definition: write_op.h:142
A single row insert ignore to be sent to the cluster, duplicate row errors are ignored.
Definition: write_op.h:169
A single row update ignore to be sent to the cluster, missing row errors are ignored.
Definition: write_op.h:248