Kudu C++ client API
Loading...
Searching...
No Matches
client.h
1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements. See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership. The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
24
25#ifndef KUDU_CLIENT_CLIENT_H
26#define KUDU_CLIENT_CLIENT_H
27
28#include <stdint.h>
29
30#include <cstddef>
31#include <map>
32// Not safe to include <memory>; this header must remain compatible with C++98.
33//
34// IWYU pragma: no_include <memory>
35#include <string>
36#include <vector>
37
38#include "kudu/client/row_result.h"
39#include "kudu/client/scan_predicate.h"
40#include "kudu/client/schema.h"
41#include "kudu/client/shared_ptr.h" // IWYU pragma: keep
42#ifdef KUDU_HEADERS_NO_STUBS
43#include <gtest/gtest_prod.h>
44
45#include "kudu/gutil/macros.h"
46#include "kudu/gutil/port.h"
47#else
48#include "kudu/client/stubs.h"
49#endif
50#include "kudu/util/kudu_export.h"
51#include "kudu/util/slice.h"
52#include "kudu/util/status.h"
53
54namespace kudu {
55
56class AlterTableTest;
57class AuthzTokenTest;
58class ClientStressTest_TestUniqueClientIds_Test;
59class DisableWriteWhenExceedingQuotaTest;
60class KuduPartialRow;
61class MetaCacheLookupStressTest_PerfSynthetic_Test;
62class MonoDelta;
63class Partition;
64class PartitionSchema;
65class SecurityUnknownTskTest;
66class TxnId;
67
68namespace client {
69class KuduClient;
70class KuduTable;
71} // namespace client
72
73namespace tablet {
74class FuzzTest;
75} // namespace tablet
76
77namespace transactions {
78class CoordinatorRpc;
79class ParticipantRpc;
80class TxnSystemClient;
81} // namespace transactions
82
83namespace tools {
84class LeaderMasterProxy;
85class RemoteKsckCluster;
86class TableAlter;
87class TableLister;
88Status ShowTabletInfo(const std::vector<std::string>& master_addresses,
89 const std::vector<std::string>& tablet_id);
90} // namespace tools
91
92namespace client {
93
95class KuduDelete;
97class KuduInsert;
100class KuduPartitioner;
101class KuduScanBatch;
102class KuduSession;
104class KuduTableAlterer;
105class KuduTableCreator;
107class KuduTablet;
108class KuduTabletServer;
109class KuduUpdate;
110class KuduUpdateIgnore;
111class KuduUpsert;
112class KuduUpsertIgnore;
113class KuduValue;
115class ResourceMetrics;
116
117namespace internal {
118class Batcher;
119class ErrorCollector;
120class GetTableSchemaRpc;
121class LookupRpc;
122class MetaCache;
123class RemoteTablet;
124class RemoteTabletServer;
125class ReplicaController;
126class RetrieveAuthzTokenRpc;
127class ScanBatchDataInterface;
128class TabletInfoProvider;
129class WriteRpc;
130template <class ReqClass, class RespClass>
131class AsyncLeaderMasterRpc; // IWYU pragma: keep
132template <class ReqClass, class RespClass>
133class AsyncRandomTxnManagerRpc; // IWYU pragma: keep
134} // namespace internal
135
148void KUDU_EXPORT InstallLoggingCallback(KuduLoggingCallback* cb);
149
156void KUDU_EXPORT UninstallLoggingCallback();
157
173void KUDU_EXPORT SetVerboseLogLevel(int level);
174
184Status KUDU_EXPORT SetInternalSignalNumber(int signum) WARN_UNUSED_RESULT;
185
197Status KUDU_EXPORT DisableSaslInitialization() WARN_UNUSED_RESULT;
198
199
222Status KUDU_EXPORT DisableOpenSSLInitialization() WARN_UNUSED_RESULT;
223
226std::string KUDU_EXPORT GetShortVersionString();
227
230std::string KUDU_EXPORT GetAllVersionInfo();
231
236class KUDU_EXPORT KuduClientBuilder {
237 public:
238 KuduClientBuilder();
239 ~KuduClientBuilder();
240
252
256 KuduClientBuilder& clear_master_server_addrs();
257
263 KuduClientBuilder& master_server_addrs(const std::vector<std::string>& addrs);
264
272 KuduClientBuilder& add_master_server_addr(const std::string& addr);
273
283 KuduClientBuilder& default_admin_operation_timeout(const MonoDelta& timeout);
284
292 KuduClientBuilder& default_rpc_timeout(const MonoDelta& timeout);
293
307 KuduClientBuilder& connection_negotiation_timeout(const MonoDelta& timeout);
308
317 KuduClientBuilder& rpc_max_message_size(int64_t size);
318
329 KuduClientBuilder& jwt(const std::string& jwt);
330
343 KuduClientBuilder& import_authentication_credentials(std::string authn_creds);
344
350 KuduClientBuilder& trusted_certificate(const std::string& cert_pem);
351
361 KuduClientBuilder& num_reactors(int num_reactors);
362
373 KuduClientBuilder& sasl_protocol_name(const std::string& sasl_protocol_name);
374
385
404
415 Status Build(sp::shared_ptr<KuduClient>* client);
416
417 private:
418 class KUDU_NO_EXPORT Data;
419
420 friend class internal::ReplicaController;
421
422 // Owned.
423 Data* data_;
424
425 DISALLOW_COPY_AND_ASSIGN(KuduClientBuilder);
426};
427
445class KUDU_EXPORT KuduTransaction :
446 public sp::enable_shared_from_this<KuduTransaction> {
447 public:
448 ~KuduTransaction();
449
462 Status CreateSession(sp::shared_ptr<KuduSession>* session) WARN_UNUSED_RESULT;
463
480 Status Commit() WARN_UNUSED_RESULT;
481
496 Status StartCommit() WARN_UNUSED_RESULT;
497
525 Status IsCommitComplete(bool* is_complete,
526 Status* completion_status) WARN_UNUSED_RESULT;
527
531 Status Rollback() WARN_UNUSED_RESULT;
532
542 class KUDU_EXPORT SerializationOptions {
543 public:
544 SerializationOptions();
545 ~SerializationOptions();
546
588 bool keepalive() const;
589
601 SerializationOptions& enable_keepalive(bool enable);
602
603 private:
604 friend class KuduTransaction;
605 class KUDU_NO_EXPORT Data;
606
607 Data* data_; // Owned.
608
609 DISALLOW_COPY_AND_ASSIGN(SerializationOptions);
610 };
611
638 std::string* serialized_txn,
639 const SerializationOptions& options = SerializationOptions()) const WARN_UNUSED_RESULT;
640
656 static Status Deserialize(const sp::shared_ptr<KuduClient>& client,
657 const std::string& serialized_txn,
658 sp::shared_ptr<KuduTransaction>* txn) WARN_UNUSED_RESULT;
659 private:
660 DISALLOW_COPY_AND_ASSIGN(KuduTransaction);
661
662 friend class KuduClient;
663 friend class KuduSession;
664 FRIEND_TEST(ClientTest, TxnIdOfTransactionalSession);
665 FRIEND_TEST(ClientTest, TxnToken);
666
667 class KUDU_NO_EXPORT Data;
668
669 explicit KuduTransaction(const sp::shared_ptr<KuduClient>& client);
670 Data* data_; // Owned.
671};
672
699class KUDU_EXPORT KuduClient : public sp::enable_shared_from_this<KuduClient> {
700 public:
701 ~KuduClient();
702
707 KuduTableCreator* NewTableCreator();
708
717 Status IsCreateTableInProgress(const std::string& table_name,
718 bool* create_in_progress);
719
737 Status DeleteTable(const std::string& table_name);
738
754
760 Status SoftDeleteTable(const std::string& table_name,
761 uint32_t reserve_seconds = 0);
762
764
779 Status DeleteTableInCatalogs(const std::string& table_name,
780 bool modify_external_catalogs,
781 int32_t reserve_seconds = -1) KUDU_NO_EXPORT;
782
791 Status RecallTable(const std::string& table_id, const std::string& new_table_name = "");
792
794
801 KuduTableAlterer* NewTableAlterer(const std::string& table_name);
802
811 Status IsAlterTableInProgress(const std::string& table_name,
812 bool* alter_in_progress);
820 Status GetTableSchema(const std::string& table_name,
821 KuduSchema* schema);
822
829 Status ListTabletServers(std::vector<KuduTabletServer*>* tablet_servers);
830
839 Status ListTables(std::vector<std::string>* tables,
840 const std::string& filter = "");
841
850 Status ListSoftDeletedTables(std::vector<std::string>* tables,
851 const std::string& filter = "");
852
860 Status TableExists(const std::string& table_name, bool* exists);
861
878 Status OpenTable(const std::string& table_name,
879 sp::shared_ptr<KuduTable>* table);
880
886 sp::shared_ptr<KuduSession> NewSession();
887
911 Status NewTransaction(sp::shared_ptr<KuduTransaction>* txn) WARN_UNUSED_RESULT;
912
914
927 Status GetTablet(const std::string& tablet_id,
928 KuduTablet** tablet) KUDU_NO_EXPORT;
929
937 Status GetTableStatistics(const std::string& table_name,
938 KuduTableStatistics** statistics);
939
947 std::string GetMasterAddresses() const KUDU_NO_EXPORT;
948
950
963
966 bool IsMultiMaster() const;
967
970
973
976
979 static const uint64_t kNoTimestamp;
980
992
1007 void SetLatestObservedTimestamp(uint64_t ht_timestamp);
1008
1020 Status ExportAuthenticationCredentials(std::string* authn_creds) const;
1021
1023
1029 std::string GetHiveMetastoreUris() const KUDU_NO_EXPORT;
1030
1036 bool GetHiveMetastoreSaslEnabled() const KUDU_NO_EXPORT;
1037
1047 std::string GetHiveMetastoreUuid() const KUDU_NO_EXPORT;
1048
1055 std::string location() const KUDU_NO_EXPORT;
1056
1060 std::string cluster_id() const KUDU_NO_EXPORT;
1062
1063 private:
1064 class KUDU_NO_EXPORT Data;
1065
1066 template <class ReqClass, class RespClass>
1067 friend class internal::AsyncLeaderMasterRpc;
1068 template <class ReqClass, class RespClass>
1069 friend class internal::AsyncRandomTxnManagerRpc;
1070
1071 friend class ClientTest;
1072 friend class ConnectToClusterBaseTest;
1073 friend class KuduClientBuilder;
1074 friend class KuduPartitionerBuilder;
1075 friend class KuduTransaction;
1076 friend class KuduScanToken;
1077 friend class KuduScanTokenBuilder;
1078 friend class KuduScanner;
1079 friend class KuduSession;
1080 friend class KuduTable;
1081 friend class KuduTableAlterer;
1082 friend class KuduTableCreator;
1083 friend class internal::Batcher;
1084 friend class internal::GetTableSchemaRpc;
1085 friend class internal::LookupRpc;
1086 friend class internal::MetaCache;
1087 friend class internal::RemoteTablet;
1088 friend class internal::RemoteTabletServer;
1089 friend class internal::RetrieveAuthzTokenRpc;
1090 friend class internal::TabletInfoProvider;
1091 friend class internal::WriteRpc;
1092 friend class kudu::AuthzTokenTest;
1093 friend class kudu::DisableWriteWhenExceedingQuotaTest;
1094 friend class kudu::SecurityUnknownTskTest;
1095 friend class transactions::CoordinatorRpc;
1096 friend class transactions::ParticipantRpc;
1097 friend class transactions::TxnSystemClient;
1098 friend class tools::LeaderMasterProxy;
1099 friend class tools::RemoteKsckCluster;
1100 friend class tools::TableLister;
1101 friend class KeepAlivePeriodicallyTest;
1102 friend class ScanTokenTest;
1103 friend Status tools::ShowTabletInfo(const std::vector<std::string>& master_addresses,
1104 const std::vector<std::string>& tablet_id);
1105
1106 FRIEND_TEST(kudu::ClientStressTest, TestUniqueClientIds);
1107 FRIEND_TEST(kudu::MetaCacheLookupStressTest, PerfSynthetic);
1108 FRIEND_TEST(ClientTest, ClearCacheAndConcurrentWorkload);
1109 FRIEND_TEST(ClientTest, ConnectionNegotiationTimeout);
1110 FRIEND_TEST(ClientTest, TestBasicIdBasedLookup);
1111 FRIEND_TEST(ClientTest, TestCacheAuthzTokens);
1112 FRIEND_TEST(ClientTest, TestGetSecurityInfoFromMaster);
1113 FRIEND_TEST(ClientTest, TestGetTabletServerBlacklist);
1114 FRIEND_TEST(ClientTest, TestGetTabletServerDeterministic);
1115 FRIEND_TEST(ClientTest, TestMasterDown);
1116 FRIEND_TEST(ClientTest, TestMasterLookupPermits);
1117 FRIEND_TEST(ClientTest, TestMetaCacheExpiry);
1118 FRIEND_TEST(ClientTest, TestMetaCacheExpiryById);
1119 FRIEND_TEST(ClientTest, TestMetaCacheExpiryWithKeysAndIds);
1120 FRIEND_TEST(ClientTest, TestMetaCacheLookupNoLeaders);
1121 FRIEND_TEST(ClientTest, TestMetaCacheWithKeysAndIds);
1122 FRIEND_TEST(ClientTest, TestNonCoveringRangePartitions);
1123 FRIEND_TEST(ClientTest, TestRetrieveAuthzTokenInParallel);
1124 FRIEND_TEST(ClientTest, TestReplicatedTabletWritesWithLeaderElection);
1125 FRIEND_TEST(ClientTest, TestScanFaultTolerance);
1126 FRIEND_TEST(ClientTest, TestScanTimeout);
1127 FRIEND_TEST(ClientTest, TestWriteWithDeadMaster);
1128 FRIEND_TEST(MasterFailoverTest, TestPauseAfterCreateTableIssued);
1129 FRIEND_TEST(MultiTServerClientTest, TestSetReplicationFactor);
1130
1131 KuduClient();
1132
1133 // Owned.
1134 Data* data_;
1135
1136 DISALLOW_COPY_AND_ASSIGN(KuduClient);
1137};
1138
1140class KUDU_EXPORT KuduTabletServer {
1141 public:
1142 ~KuduTabletServer();
1143
1146 const std::string& uuid() const;
1147
1150 const std::string& hostname() const;
1151
1154 uint16_t port() const;
1155
1157
1162 const std::string& location() const KUDU_NO_EXPORT;
1164
1165 private:
1166 class KUDU_NO_EXPORT Data;
1167
1168 friend class KuduClient;
1169 friend class KuduScanner;
1170 friend class KuduScanTokenBuilder;
1171 friend Status tools::ShowTabletInfo(const std::vector<std::string>& master_addresses,
1172 const std::vector<std::string>& tablet_id);
1173
1174 KuduTabletServer();
1175
1176 // Owned.
1177 Data* data_;
1178
1179 DISALLOW_COPY_AND_ASSIGN(KuduTabletServer);
1180};
1181
1183class KUDU_EXPORT KuduReplica {
1184 public:
1185 ~KuduReplica();
1186
1191 bool is_leader() const;
1192
1194 const KuduTabletServer& ts() const;
1195
1196 private:
1197 friend class KuduClient;
1198 friend class KuduScanTokenBuilder;
1199 friend class internal::ReplicaController;
1200
1201 class KUDU_NO_EXPORT Data;
1202
1203 KuduReplica();
1204
1205 // Owned.
1206 Data* data_;
1207
1208 DISALLOW_COPY_AND_ASSIGN(KuduReplica);
1209};
1210
1212class KUDU_EXPORT KuduTablet {
1213 public:
1214 ~KuduTablet();
1215
1218 const std::string& id() const;
1219
1225 const std::vector<const KuduReplica*>& replicas() const;
1226
1227 private:
1228 friend class KuduClient;
1229 friend class KuduScanTokenBuilder;
1230
1231 class KUDU_NO_EXPORT Data;
1232
1233 KuduTablet();
1234
1235 // Owned.
1236 Data* data_;
1237
1238 DISALLOW_COPY_AND_ASSIGN(KuduTablet);
1239};
1240
1242class KUDU_EXPORT KuduTableCreator {
1243 public:
1244 ~KuduTableCreator();
1245
1257 KuduTableCreator& table_name(const std::string& name);
1258
1269 KuduTableCreator& schema(const KuduSchema* schema);
1270
1287 KuduTableCreator& add_hash_partitions(const std::vector<std::string>& columns,
1288 int32_t num_buckets);
1289
1305 KuduTableCreator& add_hash_partitions(const std::vector<std::string>& columns,
1306 int32_t num_buckets,
1307 int32_t seed);
1308
1321 KuduTableCreator& set_range_partition_columns(const std::vector<std::string>& columns);
1322
1328
1357 KuduTableCreator& add_range_partition(KuduPartialRow* lower_bound,
1358 KuduPartialRow* upper_bound,
1359 RangePartitionBound lower_bound_type = INCLUSIVE_BOUND,
1360 RangePartitionBound upper_bound_type = EXCLUSIVE_BOUND);
1361
1378 class KuduRangePartition* partition);
1379
1388 KuduTableCreator& add_range_partition_split(KuduPartialRow* split_row);
1389
1397 KuduTableCreator& set_owner(const std::string& owner);
1398
1404 KuduTableCreator& set_comment(const std::string& comment);
1405
1406
1412 KuduTableCreator& set_allow_empty_partition(bool allow_empty_partition);
1413
1419 KuduTableCreator& split_rows(const std::vector<const KuduPartialRow*>& split_rows)
1420 ATTRIBUTE_DEPRECATED("use add_range_partition_split() instead");
1421
1431 KuduTableCreator& num_replicas(int n_replicas);
1432
1444 KuduTableCreator& dimension_label(const std::string& dimension_label);
1445
1453 KuduTableCreator& extra_configs(const std::map<std::string, std::string>& extra_configs);
1454
1464 KuduTableCreator& timeout(const MonoDelta& timeout);
1465
1473 KuduTableCreator& wait(bool wait);
1474
1489
1490 private:
1491 class KUDU_NO_EXPORT Data;
1492
1493 friend class KuduClient;
1494 friend class transactions::TxnSystemClient;
1495
1496 explicit KuduTableCreator(KuduClient* client);
1497
1498 // Owned.
1499 Data* data_;
1500
1501 DISALLOW_COPY_AND_ASSIGN(KuduTableCreator);
1502};
1503
1510class KUDU_EXPORT KuduRangePartition {
1511 public:
1527 KuduPartialRow* upper_bound,
1528 KuduTableCreator::RangePartitionBound lower_bound_type =
1530 KuduTableCreator::RangePartitionBound upper_bound_type =
1532
1534
1553 Status add_hash_partitions(const std::vector<std::string>& columns,
1554 int32_t num_buckets,
1555 int32_t seed = 0);
1556 private:
1557 class KUDU_NO_EXPORT Data;
1558
1559 friend class KuduTableCreator;
1560 friend class KuduTableAlterer;
1561
1562 // Owned.
1563 Data* data_;
1564
1565 DISALLOW_COPY_AND_ASSIGN(KuduRangePartition);
1566};
1567
1569class KUDU_EXPORT KuduTableStatistics {
1570 public:
1571 KuduTableStatistics();
1572 ~KuduTableStatistics();
1573
1578 int64_t on_disk_size() const;
1579
1584 int64_t live_row_count() const;
1585
1592 int64_t on_disk_size_limit() const;
1593
1600 int64_t live_row_count_limit() const;
1601
1605 std::string ToString() const;
1606
1607 private:
1608 class KUDU_NO_EXPORT Data;
1609
1610 friend class KuduClient;
1611
1612 // Owned.
1613 Data* data_;
1614
1615 DISALLOW_COPY_AND_ASSIGN(KuduTableStatistics);
1616};
1617
1638class KUDU_EXPORT KuduTable : public sp::enable_shared_from_this<KuduTable> {
1639 public:
1640 ~KuduTable();
1641
1643 const std::string& name() const;
1644
1652 const std::string& id() const;
1653
1655 const KuduSchema& schema() const;
1656
1658 const std::string& comment() const;
1659
1661 int num_replicas() const;
1662
1664 const std::string& owner() const;
1665
1670
1675
1680
1685
1690
1695
1700
1705
1731 KuduValue* value);
1732
1765 std::vector<KuduBloomFilter*>* bloom_filters);
1766
1771
1808 const std::vector<Slice>& bloom_filters);
1810
1835 std::vector<KuduValue*>* values);
1836
1848
1860
1863 KuduClient* client() const;
1864
1866 const PartitionSchema& partition_schema() const;
1867
1869 const std::map<std::string, std::string>& extra_configs() const;
1870
1872
1882 Status ListPartitions(std::vector<Partition>* partitions) KUDU_NO_EXPORT;
1883
1885
1886 private:
1887 class KUDU_NO_EXPORT Data;
1888
1889 friend class KuduClient;
1890 friend class KuduPartitioner;
1891 friend class KuduScanToken;
1892 friend class KuduScanner;
1893
1894 KuduTable(const sp::shared_ptr<KuduClient>& client,
1895 const std::string& name,
1896 const std::string& id,
1897 int num_replicas,
1898 const std::string& owner,
1899 const std::string& comment,
1900 const KuduSchema& schema,
1901 const PartitionSchema& partition_schema,
1902 const std::map<std::string, std::string>& extra_configs);
1903
1904 // Owned.
1905 Data* data_;
1906
1907 DISALLOW_COPY_AND_ASSIGN(KuduTable);
1908};
1909
1921class KUDU_EXPORT KuduTableAlterer {
1922 public:
1923 ~KuduTableAlterer();
1924
1930 KuduTableAlterer* RenameTo(const std::string& new_name);
1931
1937 KuduTableAlterer* SetOwner(const std::string& new_owner);
1938
1944 KuduTableAlterer* SetComment(const std::string& new_comment);
1945
1955 KuduColumnSpec* AddColumn(const std::string& name);
1956
1965 KuduColumnSpec* AlterColumn(const std::string& name);
1966
1974 KuduTableAlterer* DropColumn(const std::string& name);
1975
2007 KuduTableAlterer* AddRangePartition(
2008 KuduPartialRow* lower_bound,
2009 KuduPartialRow* upper_bound,
2012
2030 KuduTableAlterer* AddRangePartition(KuduRangePartition* partition);
2031
2067 KuduPartialRow* lower_bound,
2068 KuduPartialRow* upper_bound,
2069 const std::string& dimension_label,
2072
2100 KuduTableAlterer* DropRangePartition(
2101 KuduPartialRow* lower_bound,
2102 KuduPartialRow* upper_bound,
2105
2115 KuduTableAlterer* AlterExtraConfig(const std::map<std::string, std::string>& extra_configs);
2116
2129 KuduTableAlterer* SetTableDiskSizeLimit(int64_t disk_size_limit);
2130
2143 KuduTableAlterer* SetTableRowCountLimit(int64_t row_count_limit);
2144
2154 KuduTableAlterer* timeout(const MonoDelta& timeout);
2155
2167 KuduTableAlterer* wait(bool wait);
2168
2170
2179 KuduTableAlterer* modify_external_catalogs(bool modify_external_catalogs) KUDU_NO_EXPORT;
2180
2182
2188
2189 private:
2190 class KUDU_NO_EXPORT Data;
2191
2192 friend class KuduClient;
2193 friend class tools::TableAlter;
2194 friend class kudu::AlterTableTest;
2195
2196 FRIEND_TEST(MultiTServerClientTest, TestSetReplicationFactor);
2197
2198 KuduTableAlterer(KuduClient* client,
2199 const std::string& name);
2200
2201 // Owned.
2202 Data* data_;
2203
2204 DISALLOW_COPY_AND_ASSIGN(KuduTableAlterer);
2205};
2206
2212class KUDU_EXPORT KuduError {
2213 public:
2214 ~KuduError();
2215
2217 const Status& status() const;
2218
2221
2230
2242
2243 private:
2244 class KUDU_NO_EXPORT Data;
2245
2246 friend class internal::Batcher;
2247 friend class internal::ErrorCollector;
2248 friend class KuduSession;
2249
2250 KuduError(KuduWriteOperation* failed_op, const Status& error);
2251
2252 // Owned.
2253 Data* data_;
2254
2255 DISALLOW_COPY_AND_ASSIGN(KuduError);
2256};
2257
2258
2317class KUDU_EXPORT KuduSession : public sp::enable_shared_from_this<KuduSession> {
2318 public:
2319 ~KuduSession();
2320
2371
2380 Status SetFlushMode(FlushMode m) WARN_UNUSED_RESULT;
2381
2420
2427 WARN_UNUSED_RESULT;
2428
2446 Status SetMutationBufferSpace(size_t size_bytes) WARN_UNUSED_RESULT;
2447
2472 WARN_UNUSED_RESULT;
2473
2495 Status SetMutationBufferFlushInterval(unsigned int millis) WARN_UNUSED_RESULT;
2496
2521 Status SetMutationBufferMaxNum(unsigned int max_num) WARN_UNUSED_RESULT;
2522
2528 void SetTimeoutMillis(int millis);
2529
2533
2557 Status Apply(KuduWriteOperation* write_op) WARN_UNUSED_RESULT;
2558
2573 Status Flush() WARN_UNUSED_RESULT;
2574
2616
2619 Status Close() WARN_UNUSED_RESULT;
2620
2630
2653 ATTRIBUTE_DEPRECATED("this method is experimental and will disappear "
2654 "in a future release");
2655
2680 Status SetErrorBufferSpace(size_t size_bytes);
2681
2692
2703 void GetPendingErrors(std::vector<KuduError*>* errors, bool* overflowed);
2704
2706 KuduClient* client() const;
2707
2710
2711 private:
2712 class KUDU_NO_EXPORT Data;
2713
2714 friend class ClientTest;
2715 friend class KuduClient;
2716 friend class KuduTransaction;
2717 friend class internal::Batcher;
2718 friend class tablet::FuzzTest;
2719 FRIEND_TEST(ClientTest, TestAutoFlushBackgroundAndErrorCollector);
2720 FRIEND_TEST(ClientTest, TestAutoFlushBackgroundApplyBlocks);
2721 FRIEND_TEST(ClientTest, TxnIdOfTransactionalSession);
2722
2723 explicit KuduSession(const sp::shared_ptr<KuduClient>& client);
2724 KuduSession(const sp::shared_ptr<KuduClient>& client, const TxnId& txn_id);
2725
2726 // Owned.
2727 Data* data_;
2728
2729 DISALLOW_COPY_AND_ASSIGN(KuduSession);
2730};
2731
2732
2737class KUDU_EXPORT KuduScanner {
2738 public:
2783
2801
2805 enum { kScanTimeoutMillis = 30000 };
2806
2812 explicit KuduScanner(KuduTable* table);
2813
2814 ~KuduScanner();
2815
2825 Status SetProjectedColumnNames(const std::vector<std::string>& col_names)
2826 WARN_UNUSED_RESULT;
2827
2837 Status SetProjectedColumnIndexes(const std::vector<int>& col_indexes)
2838 WARN_UNUSED_RESULT;
2839
2845 Status SetProjectedColumns(const std::vector<std::string>& col_names)
2846 WARN_UNUSED_RESULT
2847 ATTRIBUTE_DEPRECATED("use SetProjectedColumnNames() instead");
2848
2868 Status SetQueryId(const std::string& query_id);
2869
2878 Status AddConjunctPredicate(KuduPredicate* pred) WARN_UNUSED_RESULT;
2879
2889
2898 ATTRIBUTE_DEPRECATED("use AddLowerBound() instead");
2899
2909
2918 ATTRIBUTE_DEPRECATED("use AddExclusiveUpperBound() instead");
2919
2929
2939
2946 Status SetCacheBlocks(bool cache_blocks);
2947
2950
2970
2986 Status StartKeepAlivePeriodically(uint64_t keep_alive_interval_ms = 30000);
2987
2996
3005 void Close();
3006
3015 bool HasMoreRows() const;
3016
3028 Status NextBatch(std::vector<KuduRowResult>* rows)
3029 ATTRIBUTE_DEPRECATED("use NextBatch(KuduScanBatch*) instead");
3030
3043
3056
3066
3069
3076 Status SetBatchSizeBytes(uint32_t batch_size);
3077
3086 WARN_UNUSED_RESULT;
3087
3093 Status SetReadMode(ReadMode read_mode) WARN_UNUSED_RESULT;
3094
3100 Status SetOrderMode(OrderMode order_mode) WARN_UNUSED_RESULT
3101 ATTRIBUTE_DEPRECATED("use SetFaultTolerant() instead");
3102
3115 Status SetFaultTolerant() WARN_UNUSED_RESULT;
3116
3122 Status SetSnapshotMicros(uint64_t snapshot_timestamp_micros) WARN_UNUSED_RESULT;
3123
3133 Status SetSnapshotRaw(uint64_t snapshot_timestamp) WARN_UNUSED_RESULT;
3134
3136
3151 Status SetDiffScan(uint64_t start_timestamp, uint64_t end_timestamp)
3152 WARN_UNUSED_RESULT KUDU_NO_EXPORT;
3153
3155
3162
3165
3167 sp::shared_ptr<KuduTable> GetKuduTable();
3168
3176
3178 static const uint64_t NO_FLAGS = 0;
3185 static const uint64_t PAD_UNIXTIME_MICROS_TO_16_BYTES = 1 << 0;
3186
3194 static const uint64_t COLUMNAR_LAYOUT = 1 << 1;
3195
3223 Status SetRowFormatFlags(uint64_t flags);
3225
3231 Status SetLimit(int64_t limit) WARN_UNUSED_RESULT;
3232
3238 std::string ToString() const;
3239
3240 private:
3241 class KUDU_NO_EXPORT Data;
3242
3243 Status NextBatch(internal::ScanBatchDataInterface* batch);
3244
3245 friend class KuduScanToken;
3246 friend class FlexPartitioningTest;
3247 FRIEND_TEST(ClientTest, TestBlockScannerHijackingAttempts);
3248 FRIEND_TEST(ClientTest, TestScanCloseProxy);
3249 FRIEND_TEST(ClientTest, TestScanFaultTolerance);
3250 FRIEND_TEST(ClientTest, TestScanNoBlockCaching);
3251 FRIEND_TEST(ClientTest, TestScanTimeout);
3252 FRIEND_TEST(ClientTest, TestScanWithQueryId);
3253 FRIEND_TEST(ClientTest, TestReadAtSnapshotNoTimestampSet);
3254 FRIEND_TEST(ConsistencyITest, TestSnapshotScanTimestampReuse);
3255 FRIEND_TEST(KeepAlivePeriodicallyTest, TestScannerKeepAlivePeriodicallyCrossServers);
3256 FRIEND_TEST(KeepAlivePeriodicallyTest, TestScannerKeepAlivePeriodicallyScannerTolerate);
3257 FRIEND_TEST(KeepAlivePeriodicallyTest, TestStopKeepAlivePeriodically);
3258 FRIEND_TEST(ScanTokenTest, TestScanTokens);
3259 FRIEND_TEST(ScanTokenTest, TestScanTokens_NonUniquePrimaryKey);
3260 FRIEND_TEST(ScanTokenTest, TestScanTokensWithQueryId);
3261
3262 // Owned.
3263 Data* data_;
3264
3265 DISALLOW_COPY_AND_ASSIGN(KuduScanner);
3266};
3267
3288class KUDU_EXPORT KuduScanToken {
3289 public:
3290
3291 ~KuduScanToken();
3292
3303 Status IntoKuduScanner(KuduScanner** scanner) const WARN_UNUSED_RESULT;
3304
3306 const KuduTablet& tablet() const;
3307
3316 Status Serialize(std::string* buf) const WARN_UNUSED_RESULT;
3317
3330 const std::string& serialized_token,
3331 KuduScanner** scanner) WARN_UNUSED_RESULT;
3332
3333 private:
3334 class KUDU_NO_EXPORT Data;
3335
3336 friend class KuduScanTokenBuilder;
3337
3338 KuduScanToken();
3339
3340 // Owned.
3341 Data* data_;
3342
3343 DISALLOW_COPY_AND_ASSIGN(KuduScanToken);
3344};
3345
3349class KUDU_EXPORT KuduScanTokenBuilder {
3350 public:
3351
3359
3369 Status SetProjectedColumnNames(const std::vector<std::string>& col_names)
3370 WARN_UNUSED_RESULT;
3371
3373 Status SetProjectedColumnIndexes(const std::vector<int>& col_indexes)
3374 WARN_UNUSED_RESULT;
3375
3377 Status AddConjunctPredicate(KuduPredicate* pred) WARN_UNUSED_RESULT;
3378
3380 Status AddLowerBound(const KuduPartialRow& key) WARN_UNUSED_RESULT;
3381
3390 Status AddUpperBound(const KuduPartialRow& key) WARN_UNUSED_RESULT;
3391
3393 Status SetCacheBlocks(bool cache_blocks) WARN_UNUSED_RESULT;
3394
3401 Status SetBatchSizeBytes(uint32_t batch_size) WARN_UNUSED_RESULT;
3402
3411 WARN_UNUSED_RESULT;
3412
3414 Status SetReadMode(KuduScanner::ReadMode read_mode) WARN_UNUSED_RESULT;
3415
3417 Status SetFaultTolerant() WARN_UNUSED_RESULT;
3418
3420 Status SetSnapshotMicros(uint64_t snapshot_timestamp_micros)
3421 WARN_UNUSED_RESULT;
3422
3424 Status SetSnapshotRaw(uint64_t snapshot_timestamp) WARN_UNUSED_RESULT;
3425
3427
3429 Status SetDiffScan(uint64_t start_timestamp, uint64_t end_timestamp)
3430 WARN_UNUSED_RESULT KUDU_NO_EXPORT;
3432
3434 Status SetTimeoutMillis(int millis) WARN_UNUSED_RESULT;
3435
3443 Status IncludeTableMetadata(bool include_metadata) WARN_UNUSED_RESULT;
3444
3452 Status IncludeTabletMetadata(bool include_metadata) WARN_UNUSED_RESULT;
3453
3461 Status SetQueryId(const std::string& query_id);
3462
3473 void SetSplitSizeBytes(uint64_t split_size_bytes);
3474
3483 Status Build(std::vector<KuduScanToken*>* tokens) WARN_UNUSED_RESULT;
3484
3485 private:
3486 class KUDU_NO_EXPORT Data;
3487
3488 // Owned.
3489 Data* data_;
3490
3491 DISALLOW_COPY_AND_ASSIGN(KuduScanTokenBuilder);
3492};
3493
3495class KUDU_EXPORT KuduPartitionerBuilder {
3496 public:
3501 explicit KuduPartitionerBuilder(sp::shared_ptr<KuduTable> table);
3503
3510
3530 private:
3531 class KUDU_NO_EXPORT Data;
3532
3533 // Owned.
3534 Data* data_;
3535
3536 DISALLOW_COPY_AND_ASSIGN(KuduPartitionerBuilder);
3537};
3538
3549class KUDU_EXPORT KuduPartitioner {
3550 public:
3551 ~KuduPartitioner();
3552
3556 int NumPartitions() const;
3557
3569 Status PartitionRow(const KuduPartialRow& row, int* partition);
3570 private:
3571 class KUDU_NO_EXPORT Data;
3572
3573 friend class KuduPartitionerBuilder;
3574
3575 explicit KuduPartitioner(Data* data);
3576 Data* data_; // Owned.
3577
3578 DISALLOW_COPY_AND_ASSIGN(KuduPartitioner);
3579};
3580
3581
3582} // namespace client
3583} // namespace kudu
3584#endif
A row which may only contain values for a subset of the columns.
Definition partial_row.h:72
A representation of a time interval.
Definition monotime.h:58
A wrapper around externally allocated data.
Definition slice.h:51
A representation of an operation's outcome.
Definition status.h:191
KuduClientBuilder & encryption_policy(EncryptionPolicy encryption_policy)
KuduClientBuilder & sasl_protocol_name(const std::string &sasl_protocol_name)
KuduClientBuilder & require_authentication(bool require_authentication)
Status Build(sp::shared_ptr< KuduClient > *client)
KuduClientBuilder & default_rpc_timeout(const MonoDelta &timeout)
KuduClientBuilder & master_server_addrs(const std::vector< std::string > &addrs)
KuduClientBuilder & clear_master_server_addrs()
EncryptionPolicy
Policy for on-the-wire encryption.
Definition client.h:242
@ REQUIRED
Definition client.h:249
@ REQUIRED_REMOTE
Definition client.h:246
@ OPTIONAL
Definition client.h:243
KuduClientBuilder & rpc_max_message_size(int64_t size)
KuduClientBuilder & import_authentication_credentials(std::string authn_creds)
KuduClientBuilder & jwt(const std::string &jwt)
KuduClientBuilder & default_admin_operation_timeout(const MonoDelta &timeout)
KuduClientBuilder & num_reactors(int num_reactors)
Set the number of reactors for the RPC messenger.
KuduClientBuilder & trusted_certificate(const std::string &cert_pem)
KuduClientBuilder & add_master_server_addr(const std::string &addr)
KuduClientBuilder & connection_negotiation_timeout(const MonoDelta &timeout)
A handle for a connection to a cluster.
Definition client.h:699
void SetLatestObservedTimestamp(uint64_t ht_timestamp)
static const uint64_t kNoTimestamp
Definition client.h:979
bool IsMultiMaster() const
Status GetTableSchema(const std::string &table_name, KuduSchema *schema)
KuduTableCreator * NewTableCreator()
Status IsCreateTableInProgress(const std::string &table_name, bool *create_in_progress)
Status ListTables(std::vector< std::string > *tables, const std::string &filter="")
KuduTableAlterer * NewTableAlterer(const std::string &table_name)
const MonoDelta & default_admin_operation_timeout() const
MonoDelta connection_negotiation_timeout() const
const MonoDelta & default_rpc_timeout() const
Status ListSoftDeletedTables(std::vector< std::string > *tables, const std::string &filter="")
Status IsAlterTableInProgress(const std::string &table_name, bool *alter_in_progress)
Status TableExists(const std::string &table_name, bool *exists)
Status DeleteTable(const std::string &table_name)
uint64_t GetLatestObservedTimestamp() const
Status OpenTable(const std::string &table_name, sp::shared_ptr< KuduTable > *table)
Status SoftDeleteTable(const std::string &table_name, uint32_t reserve_seconds=0)
sp::shared_ptr< KuduSession > NewSession()
Status NewTransaction(sp::shared_ptr< KuduTransaction > *txn) WARN_UNUSED_RESULT
Status ListTabletServers(std::vector< KuduTabletServer * > *tablet_servers)
Status ExportAuthenticationCredentials(std::string *authn_creds) const
ReplicaSelection
Policy with which to choose amongst multiple replicas.
Definition client.h:952
@ CLOSEST_REPLICA
Definition client.h:955
@ FIRST_REPLICA
Select the first replica in the list.
Definition client.h:961
@ LEADER_ONLY
Select the LEADER replica.
Definition client.h:953
Builder API for specifying or altering a column within a table schema.
Definition schema.h:370
A batch of columnar data returned from a scanner.
Definition columnar_scan_batch.h:51
A single row delete ignore to be sent to the cluster.
Definition write_op.h:331
A single row delete to be sent to the cluster.
Definition write_op.h:305
This class represents an error which occurred in a write operation.
Definition client.h:2212
KuduWriteOperation * release_failed_op()
const KuduWriteOperation & failed_op() const
bool was_possibly_successful() const
const Status & status() const
A single row insert ignore to be sent to the cluster, duplicate row errors are ignored.
Definition write_op.h:172
A single row insert to be sent to the cluster.
Definition write_op.h:145
The interface for all logging callbacks.
Definition callbacks.h:44
KuduPartitionerBuilder(sp::shared_ptr< KuduTable > table)
Status Build(KuduPartitioner **partitioner)
KuduPartitionerBuilder * SetBuildTimeout(MonoDelta timeout)
Definition client.h:3549
Status PartitionRow(const KuduPartialRow &row, int *partition)
A representation of comparison predicate for Kudu queries.
Definition scan_predicate.h:43
ComparisonOp
Supported comparison operators.
Definition scan_predicate.h:46
Definition client.h:1510
Status add_hash_partitions(const std::vector< std::string > &columns, int32_t num_buckets, int32_t seed=0)
KuduRangePartition(KuduPartialRow *lower_bound, KuduPartialRow *upper_bound, KuduTableCreator::RangePartitionBound lower_bound_type=KuduTableCreator::INCLUSIVE_BOUND, KuduTableCreator::RangePartitionBound upper_bound_type=KuduTableCreator::EXCLUSIVE_BOUND)
const KuduTabletServer & ts() const
A batch of zero or more rows returned by a scan operation.
Definition scan_batch.h:84
Status SetProjectedColumnIndexes(const std::vector< int > &col_indexes) WARN_UNUSED_RESULT
Status SetProjectedColumnNames(const std::vector< std::string > &col_names) WARN_UNUSED_RESULT
Status SetTimeoutMillis(int millis) WARN_UNUSED_RESULT
Status SetSelection(KuduClient::ReplicaSelection selection) WARN_UNUSED_RESULT
Status SetSnapshotRaw(uint64_t snapshot_timestamp) WARN_UNUSED_RESULT
Status SetBatchSizeBytes(uint32_t batch_size) WARN_UNUSED_RESULT
Status SetFaultTolerant() WARN_UNUSED_RESULT
Status IncludeTableMetadata(bool include_metadata) WARN_UNUSED_RESULT
Status SetCacheBlocks(bool cache_blocks) WARN_UNUSED_RESULT
Status SetQueryId(const std::string &query_id)
Status SetSnapshotMicros(uint64_t snapshot_timestamp_micros) WARN_UNUSED_RESULT
KuduScanTokenBuilder(KuduTable *table)
Status AddConjunctPredicate(KuduPredicate *pred) WARN_UNUSED_RESULT
Status AddUpperBound(const KuduPartialRow &key) WARN_UNUSED_RESULT
Status Build(std::vector< KuduScanToken * > *tokens) WARN_UNUSED_RESULT
Status IncludeTabletMetadata(bool include_metadata) WARN_UNUSED_RESULT
void SetSplitSizeBytes(uint64_t split_size_bytes)
Status SetReadMode(KuduScanner::ReadMode read_mode) WARN_UNUSED_RESULT
Status AddLowerBound(const KuduPartialRow &key) WARN_UNUSED_RESULT
A scan descriptor limited to a single physical contiguous location.
Definition client.h:3288
Status Serialize(std::string *buf) const WARN_UNUSED_RESULT
const KuduTablet & tablet() const
Status IntoKuduScanner(KuduScanner **scanner) const WARN_UNUSED_RESULT
static Status DeserializeIntoScanner(KuduClient *client, const std::string &serialized_token, KuduScanner **scanner) WARN_UNUSED_RESULT
This class is a representation of a single scan.
Definition client.h:2737
Status SetQueryId(const std::string &query_id)
Status SetFaultTolerant() WARN_UNUSED_RESULT
Status SetReadMode(ReadMode read_mode) WARN_UNUSED_RESULT
KuduScanner(KuduTable *table)
ReadMode
The read modes for scanners.
Definition client.h:2740
@ READ_AT_SNAPSHOT
Definition client.h:2769
@ READ_LATEST
Definition client.h:2748
@ READ_YOUR_WRITES
Definition client.h:2781
OrderMode
Definition client.h:2787
@ ORDERED
Definition client.h:2799
@ UNORDERED
Definition client.h:2793
Status SetRowFormatFlags(uint64_t flags)
Status NextBatch(std::vector< KuduRowResult > *rows)
Status AddConjunctPredicate(KuduPredicate *pred) WARN_UNUSED_RESULT
Status SetCacheBlocks(bool cache_blocks)
Status AddExclusiveUpperBound(const KuduPartialRow &key)
Status SetSnapshotMicros(uint64_t snapshot_timestamp_micros) WARN_UNUSED_RESULT
Status SetProjectedColumns(const std::vector< std::string > &col_names) WARN_UNUSED_RESULT
static const uint64_t PAD_UNIXTIME_MICROS_TO_16_BYTES
Definition client.h:3185
Status NextBatch(KuduColumnarScanBatch *batch)
Status AddLowerBound(const KuduPartialRow &key)
static const uint64_t NO_FLAGS
No flags set.
Definition client.h:3178
KuduSchema GetProjectionSchema() const
Status SetLimit(int64_t limit) WARN_UNUSED_RESULT
Status StartKeepAlivePeriodically(uint64_t keep_alive_interval_ms=30000)
Status SetProjectedColumnIndexes(const std::vector< int > &col_indexes) WARN_UNUSED_RESULT
Status SetOrderMode(OrderMode order_mode) WARN_UNUSED_RESULT
Status SetTimeoutMillis(int millis)
Status AddExclusiveUpperBoundPartitionKeyRaw(const Slice &partition_key)
Status AddExclusiveUpperBoundRaw(const Slice &key)
std::string ToString() const
Status SetSnapshotRaw(uint64_t snapshot_timestamp) WARN_UNUSED_RESULT
Status AddLowerBoundPartitionKeyRaw(const Slice &partition_key)
Status SetProjectedColumnNames(const std::vector< std::string > &col_names) WARN_UNUSED_RESULT
Status GetCurrentServer(KuduTabletServer **server)
static const uint64_t COLUMNAR_LAYOUT
Definition client.h:3194
sp::shared_ptr< KuduTable > GetKuduTable()
const ResourceMetrics & GetResourceMetrics() const
Status NextBatch(KuduScanBatch *batch)
Status SetSelection(KuduClient::ReplicaSelection selection) WARN_UNUSED_RESULT
Status SetBatchSizeBytes(uint32_t batch_size)
Status AddLowerBoundRaw(const Slice &key)
A representation of a table's schema.
Definition schema.h:688
Representation of a Kudu client session.
Definition client.h:2317
void SetTimeoutMillis(int millis)
int CountBufferedOperations() const
Status SetExternalConsistencyMode(ExternalConsistencyMode m) WARN_UNUSED_RESULT
Status Flush() WARN_UNUSED_RESULT
Status SetMutationBufferFlushWatermark(double watermark_pct) WARN_UNUSED_RESULT
const ResourceMetrics & GetWriteOpMetrics() const
Status SetFlushMode(FlushMode m) WARN_UNUSED_RESULT
int CountPendingErrors() const
bool HasPendingOperations() const
Status Close() WARN_UNUSED_RESULT
ExternalConsistencyMode
The possible external consistency modes on which Kudu operates.
Definition client.h:2383
@ COMMIT_WAIT
Definition client.h:2418
@ CLIENT_PROPAGATED
Definition client.h:2402
Status SetMutationBufferFlushInterval(unsigned int millis) WARN_UNUSED_RESULT
FlushMode
Modes of flush operations.
Definition client.h:2322
@ MANUAL_FLUSH
Definition client.h:2369
@ AUTO_FLUSH_BACKGROUND
Definition client.h:2355
@ AUTO_FLUSH_SYNC
Definition client.h:2327
KuduClient * client() const
Status SetMutationBufferMaxNum(unsigned int max_num) WARN_UNUSED_RESULT
Status Apply(KuduWriteOperation *write_op) WARN_UNUSED_RESULT
void GetPendingErrors(std::vector< KuduError * > *errors, bool *overflowed)
void FlushAsync(KuduStatusCallback *cb)
Status SetMutationBufferSpace(size_t size_bytes) WARN_UNUSED_RESULT
Status SetErrorBufferSpace(size_t size_bytes)
The interface for all status callbacks.
Definition callbacks.h:161
Alters an existing table based on the provided steps.
Definition client.h:1921
KuduColumnSpec * AddColumn(const std::string &name)
KuduTableAlterer * timeout(const MonoDelta &timeout)
KuduTableAlterer * AddRangePartition(KuduPartialRow *lower_bound, KuduPartialRow *upper_bound, KuduTableCreator::RangePartitionBound lower_bound_type=KuduTableCreator::INCLUSIVE_BOUND, KuduTableCreator::RangePartitionBound upper_bound_type=KuduTableCreator::EXCLUSIVE_BOUND)
KuduTableAlterer * DropRangePartition(KuduPartialRow *lower_bound, KuduPartialRow *upper_bound, KuduTableCreator::RangePartitionBound lower_bound_type=KuduTableCreator::INCLUSIVE_BOUND, KuduTableCreator::RangePartitionBound upper_bound_type=KuduTableCreator::EXCLUSIVE_BOUND)
KuduTableAlterer * SetOwner(const std::string &new_owner)
KuduTableAlterer * AddRangePartitionWithDimension(KuduPartialRow *lower_bound, KuduPartialRow *upper_bound, const std::string &dimension_label, KuduTableCreator::RangePartitionBound lower_bound_type=KuduTableCreator::INCLUSIVE_BOUND, KuduTableCreator::RangePartitionBound upper_bound_type=KuduTableCreator::EXCLUSIVE_BOUND)
KuduTableAlterer * SetTableDiskSizeLimit(int64_t disk_size_limit)
KuduTableAlterer * AddRangePartition(KuduRangePartition *partition)
KuduTableAlterer * DropColumn(const std::string &name)
KuduTableAlterer * SetTableRowCountLimit(int64_t row_count_limit)
KuduTableAlterer * AlterExtraConfig(const std::map< std::string, std::string > &extra_configs)
KuduTableAlterer * wait(bool wait)
KuduTableAlterer * RenameTo(const std::string &new_name)
KuduColumnSpec * AlterColumn(const std::string &name)
KuduTableAlterer * SetComment(const std::string &new_comment)
A helper class to create a new table with the desired options.
Definition client.h:1242
KuduTableCreator & timeout(const MonoDelta &timeout)
KuduTableCreator & add_range_partition_split(KuduPartialRow *split_row)
RangePartitionBound
Range partition bound type.
Definition client.h:1324
@ INCLUSIVE_BOUND
An inclusive bound.
Definition client.h:1326
@ EXCLUSIVE_BOUND
An exclusive bound.
Definition client.h:1325
KuduTableCreator & set_allow_empty_partition(bool allow_empty_partition)
KuduTableCreator & add_hash_partitions(const std::vector< std::string > &columns, int32_t num_buckets, int32_t seed)
KuduTableCreator & add_hash_partitions(const std::vector< std::string > &columns, int32_t num_buckets)
KuduTableCreator & set_range_partition_columns(const std::vector< std::string > &columns)
KuduTableCreator & table_name(const std::string &name)
KuduTableCreator & split_rows(const std::vector< const KuduPartialRow * > &split_rows)
KuduTableCreator & add_range_partition(KuduPartialRow *lower_bound, KuduPartialRow *upper_bound, RangePartitionBound lower_bound_type=INCLUSIVE_BOUND, RangePartitionBound upper_bound_type=EXCLUSIVE_BOUND)
KuduTableCreator & dimension_label(const std::string &dimension_label)
KuduTableCreator & num_replicas(int n_replicas)
KuduTableCreator & set_owner(const std::string &owner)
KuduTableCreator & schema(const KuduSchema *schema)
KuduTableCreator & set_comment(const std::string &comment)
KuduTableCreator & extra_configs(const std::map< std::string, std::string > &extra_configs)
KuduTableCreator & add_custom_range_partition(class KuduRangePartition *partition)
KuduTableCreator & wait(bool wait)
In-memory statistics of table.
Definition client.h:1569
A representation of a table on a particular cluster.
Definition client.h:1638
KuduDelete * NewDelete()
KuduUpsert * NewUpsert()
KuduUpsertIgnore * NewUpsertIgnore()
KuduPredicate * NewInBloomFilterPredicate(const Slice &col_name, std::vector< KuduBloomFilter * > *bloom_filters)
KuduDeleteIgnore * NewDeleteIgnore()
KuduUpdate * NewUpdate()
KuduPredicate * NewIsNullPredicate(const Slice &col_name)
const std::map< std::string, std::string > & extra_configs() const
KuduInsertIgnore * NewInsertIgnore()
KuduUpdateIgnore * NewUpdateIgnore()
const std::string & name() const
KuduPredicate * NewInBloomFilterPredicate(const Slice &col_name, const std::vector< Slice > &bloom_filters)
KuduPredicate * NewInListPredicate(const Slice &col_name, std::vector< KuduValue * > *values)
const std::string & id() const
const PartitionSchema & partition_schema() const
KuduPredicate * NewIsNotNullPredicate(const Slice &col_name)
KuduPredicate * NewComparisonPredicate(const Slice &col_name, KuduPredicate::ComparisonOp op, KuduValue *value)
KuduClient * client() const
KuduInsert * NewInsert()
const KuduSchema & schema() const
const std::string & comment() const
const std::string & owner() const
In-memory representation of a remote tablet server.
Definition client.h:1140
const std::string & hostname() const
const std::string & uuid() const
In-memory representation of a remote tablet.
Definition client.h:1212
const std::string & id() const
const std::vector< const KuduReplica * > & replicas() const
SerializationOptions & enable_keepalive(bool enable)
Status StartCommit() WARN_UNUSED_RESULT
Status Rollback() WARN_UNUSED_RESULT
Status IsCommitComplete(bool *is_complete, Status *completion_status) WARN_UNUSED_RESULT
Status Commit() WARN_UNUSED_RESULT
static Status Deserialize(const sp::shared_ptr< KuduClient > &client, const std::string &serialized_txn, sp::shared_ptr< KuduTransaction > *txn) WARN_UNUSED_RESULT
Status Serialize(std::string *serialized_txn, const SerializationOptions &options=SerializationOptions()) const WARN_UNUSED_RESULT
Status CreateSession(sp::shared_ptr< KuduSession > *session) WARN_UNUSED_RESULT
A single row update ignore to be sent to the cluster, missing row errors and errors on updating immut...
Definition write_op.h:279
A single row update to be sent to the cluster.
Definition write_op.h:252
A single row upsert ignore to be sent to the cluster, errors on updating immutable cells are ignored.
Definition write_op.h:225
A single row upsert to be sent to the cluster.
Definition write_op.h:198
A constant cell value with a specific type.
Definition value.h:37
A single-row write operation to be sent to a Kudu table.
Definition write_op.h:66
A generic catalog of simple metrics.
Definition resource_metrics.h:41
Smart pointer typedefs for externally-faced code.