Kudu C++ client API
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 
54 namespace kudu {
55 
56 class AlterTableTest;
57 class AuthzTokenTest;
58 class ClientStressTest_TestUniqueClientIds_Test;
59 class MetaCacheLookupStressTest_PerfSynthetic_Test;
60 class DisableWriteWhenExceedingQuotaTest;
61 class KuduPartialRow;
62 class MonoDelta;
63 class Partition;
64 class PartitionSchema;
65 class SecurityUnknownTskTest;
66 class TxnId;
67 
68 namespace client {
69 class KuduClient;
70 class KuduTable;
71 } // namespace client
72 
73 namespace tablet {
74 class FuzzTest;
75 } // namespace tablet
76 
77 namespace transactions {
78 class CoordinatorRpc;
79 class ParticipantRpc;
80 class TxnSystemClient;
81 } // namespace transactions
82 
83 namespace tools {
84 class LeaderMasterProxy;
85 class RemoteKsckCluster;
86 class TableAlter;
87 class TableLister;
88 } // namespace tools
89 
90 namespace client {
91 
92 class KuduColumnarScanBatch;
93 class KuduDelete;
94 class KuduDeleteIgnore;
95 class KuduInsert;
96 class KuduInsertIgnore;
97 class KuduLoggingCallback;
98 class KuduPartitioner;
99 class KuduScanBatch;
100 class KuduSession;
101 class KuduStatusCallback;
102 class KuduTableAlterer;
103 class KuduTableCreator;
104 class KuduTableStatistics;
105 class KuduTablet;
106 class KuduTabletServer;
107 class KuduUpdate;
108 class KuduUpdateIgnore;
109 class KuduUpsert;
110 class KuduValue;
111 class KuduWriteOperation;
112 class ResourceMetrics;
113 
114 namespace internal {
115 class Batcher;
116 class ErrorCollector;
117 class GetTableSchemaRpc;
118 class LookupRpc;
119 class MetaCache;
120 class RemoteTablet;
121 class RemoteTabletServer;
122 class ReplicaController;
123 class RetrieveAuthzTokenRpc;
124 class ScanBatchDataInterface;
125 class WriteRpc;
126 template <class ReqClass, class RespClass>
127 class AsyncLeaderMasterRpc; // IWYU pragma: keep
128 template <class ReqClass, class RespClass>
129 class AsyncRandomTxnManagerRpc; // IWYU pragma: keep
130 } // namespace internal
131 
144 void KUDU_EXPORT InstallLoggingCallback(KuduLoggingCallback* cb);
145 
152 void KUDU_EXPORT UninstallLoggingCallback();
153 
169 void KUDU_EXPORT SetVerboseLogLevel(int level);
170 
180 Status KUDU_EXPORT SetInternalSignalNumber(int signum) WARN_UNUSED_RESULT;
181 
193 Status KUDU_EXPORT DisableSaslInitialization() WARN_UNUSED_RESULT;
194 
195 
218 Status KUDU_EXPORT DisableOpenSSLInitialization() WARN_UNUSED_RESULT;
219 
222 std::string KUDU_EXPORT GetShortVersionString();
223 
226 std::string KUDU_EXPORT GetAllVersionInfo();
227 
232 class KUDU_EXPORT KuduClientBuilder {
233  public:
236 
239  OPTIONAL,
240 
242  REQUIRED_REMOTE,
243 
245  REQUIRED
246  };
248 
253 
259  KuduClientBuilder& master_server_addrs(const std::vector<std::string>& addrs);
260 
268  KuduClientBuilder& add_master_server_addr(const std::string& addr);
269 
280 
289 
304 
305 
314 
324  KuduClientBuilder& num_reactors(int num_reactors);
325 
336  KuduClientBuilder& sasl_protocol_name(const std::string& sasl_protocol_name);
337 
347  KuduClientBuilder& require_authentication(bool require_authentication);
348 
367 
378  Status Build(sp::shared_ptr<KuduClient>* client);
379 
380  private:
381  class KUDU_NO_EXPORT Data;
382 
383  friend class internal::ReplicaController;
384 
385  // Owned.
386  Data* data_;
387 
388  DISALLOW_COPY_AND_ASSIGN(KuduClientBuilder);
389 };
390 
408 class KUDU_EXPORT KuduTransaction :
409  public sp::enable_shared_from_this<KuduTransaction> {
410  public:
411  ~KuduTransaction();
412 
425  Status CreateSession(sp::shared_ptr<KuduSession>* session) WARN_UNUSED_RESULT;
426 
443  Status Commit() WARN_UNUSED_RESULT;
444 
459  Status StartCommit() WARN_UNUSED_RESULT;
460 
488  Status IsCommitComplete(bool* is_complete,
489  Status* completion_status) WARN_UNUSED_RESULT;
490 
494  Status Rollback() WARN_UNUSED_RESULT;
495 
505  class KUDU_EXPORT SerializationOptions {
506  public:
509 
551  bool keepalive() const;
552 
565 
566  private:
567  friend class KuduTransaction;
568  class KUDU_NO_EXPORT Data;
569 
570  Data* data_; // Owned.
571 
572  DISALLOW_COPY_AND_ASSIGN(SerializationOptions);
573  };
574 
601  std::string* serialized_txn,
602  const SerializationOptions& options = SerializationOptions()) const WARN_UNUSED_RESULT;
603 
619  static Status Deserialize(const sp::shared_ptr<KuduClient>& client,
620  const std::string& serialized_txn,
621  sp::shared_ptr<KuduTransaction>* txn) WARN_UNUSED_RESULT;
622  private:
623  DISALLOW_COPY_AND_ASSIGN(KuduTransaction);
624 
625  friend class KuduClient;
626  friend class KuduSession;
627  FRIEND_TEST(ClientTest, TxnIdOfTransactionalSession);
628  FRIEND_TEST(ClientTest, TxnToken);
629 
630  class KUDU_NO_EXPORT Data;
631 
632  explicit KuduTransaction(const sp::shared_ptr<KuduClient>& client);
633  Data* data_; // Owned.
634 };
635 
662 class KUDU_EXPORT KuduClient : public sp::enable_shared_from_this<KuduClient> {
663  public:
664  ~KuduClient();
665 
671 
680  Status IsCreateTableInProgress(const std::string& table_name,
681  bool* create_in_progress);
682 
688  Status DeleteTable(const std::string& table_name);
689 
691 
702  Status DeleteTableInCatalogs(const std::string& table_name,
703  bool modify_external_catalogs) KUDU_NO_EXPORT;
705 
712  KuduTableAlterer* NewTableAlterer(const std::string& table_name);
713 
722  Status IsAlterTableInProgress(const std::string& table_name,
723  bool* alter_in_progress);
731  Status GetTableSchema(const std::string& table_name,
732  KuduSchema* schema);
733 
740  Status ListTabletServers(std::vector<KuduTabletServer*>* tablet_servers);
741 
749  Status ListTables(std::vector<std::string>* tables,
750  const std::string& filter = "");
751 
759  Status TableExists(const std::string& table_name, bool* exists);
760 
777  Status OpenTable(const std::string& table_name,
778  sp::shared_ptr<KuduTable>* table);
779 
785  sp::shared_ptr<KuduSession> NewSession();
786 
810  Status NewTransaction(sp::shared_ptr<KuduTransaction>* txn) WARN_UNUSED_RESULT;
811 
813 
826  Status GetTablet(const std::string& tablet_id,
827  KuduTablet** tablet) KUDU_NO_EXPORT;
828 
836  Status GetTableStatistics(const std::string& table_name,
837  KuduTableStatistics** statistics);
838 
846  std::string GetMasterAddresses() const KUDU_NO_EXPORT;
847 
849 
853 
854  CLOSEST_REPLICA,
855 
860  FIRST_REPLICA
861  };
862 
865  bool IsMultiMaster() const;
866 
869 
872 
875 
878  static const uint64_t kNoTimestamp;
879 
890  uint64_t GetLatestObservedTimestamp() const;
891 
906  void SetLatestObservedTimestamp(uint64_t ht_timestamp);
907 
919  Status ExportAuthenticationCredentials(std::string* authn_creds) const;
920 
922 
928  std::string GetHiveMetastoreUris() const KUDU_NO_EXPORT;
929 
935  bool GetHiveMetastoreSaslEnabled() const KUDU_NO_EXPORT;
936 
946  std::string GetHiveMetastoreUuid() const KUDU_NO_EXPORT;
947 
954  std::string location() const KUDU_NO_EXPORT;
955 
959  std::string cluster_id() const KUDU_NO_EXPORT;
961 
962  private:
963  class KUDU_NO_EXPORT Data;
964 
965  template <class ReqClass, class RespClass>
966  friend class internal::AsyncLeaderMasterRpc;
967  template <class ReqClass, class RespClass>
968  friend class internal::AsyncRandomTxnManagerRpc;
969 
970  friend class ClientTest;
971  friend class ConnectToClusterBaseTest;
972  friend class KuduClientBuilder;
973  friend class KuduPartitionerBuilder;
974  friend class KuduTransaction;
975  friend class KuduScanToken;
976  friend class KuduScanTokenBuilder;
977  friend class KuduScanner;
978  friend class KuduSession;
979  friend class KuduTable;
980  friend class KuduTableAlterer;
981  friend class KuduTableCreator;
982  friend class internal::Batcher;
983  friend class internal::GetTableSchemaRpc;
984  friend class internal::LookupRpc;
985  friend class internal::MetaCache;
986  friend class internal::RemoteTablet;
987  friend class internal::RemoteTabletServer;
988  friend class internal::RetrieveAuthzTokenRpc;
989  friend class internal::WriteRpc;
990  friend class kudu::AuthzTokenTest;
991  friend class kudu::DisableWriteWhenExceedingQuotaTest;
992  friend class kudu::SecurityUnknownTskTest;
993  friend class transactions::CoordinatorRpc;
994  friend class transactions::ParticipantRpc;
995  friend class transactions::TxnSystemClient;
996  friend class tools::LeaderMasterProxy;
997  friend class tools::RemoteKsckCluster;
998  friend class tools::TableLister;
999 
1000  FRIEND_TEST(kudu::ClientStressTest, TestUniqueClientIds);
1001  FRIEND_TEST(kudu::MetaCacheLookupStressTest, PerfSynthetic);
1002  FRIEND_TEST(ClientTest, ClearCacheAndConcurrentWorkload);
1003  FRIEND_TEST(ClientTest, ConnectionNegotiationTimeout);
1004  FRIEND_TEST(ClientTest, TestBasicIdBasedLookup);
1005  FRIEND_TEST(ClientTest, TestCacheAuthzTokens);
1006  FRIEND_TEST(ClientTest, TestGetSecurityInfoFromMaster);
1007  FRIEND_TEST(ClientTest, TestGetTabletServerBlacklist);
1008  FRIEND_TEST(ClientTest, TestGetTabletServerDeterministic);
1009  FRIEND_TEST(ClientTest, TestMasterDown);
1010  FRIEND_TEST(ClientTest, TestMasterLookupPermits);
1011  FRIEND_TEST(ClientTest, TestMetaCacheExpiry);
1012  FRIEND_TEST(ClientTest, TestMetaCacheExpiryById);
1013  FRIEND_TEST(ClientTest, TestMetaCacheExpiryWithKeysAndIds);
1014  FRIEND_TEST(ClientTest, TestMetaCacheLookupNoLeaders);
1015  FRIEND_TEST(ClientTest, TestMetaCacheWithKeysAndIds);
1016  FRIEND_TEST(ClientTest, TestNonCoveringRangePartitions);
1017  FRIEND_TEST(ClientTest, TestRetrieveAuthzTokenInParallel);
1018  FRIEND_TEST(ClientTest, TestReplicatedTabletWritesWithLeaderElection);
1019  FRIEND_TEST(ClientTest, TestScanFaultTolerance);
1020  FRIEND_TEST(ClientTest, TestScanTimeout);
1021  FRIEND_TEST(ClientTest, TestWriteWithDeadMaster);
1022  FRIEND_TEST(MasterFailoverTest, TestPauseAfterCreateTableIssued);
1023  FRIEND_TEST(MultiTServerClientTest, TestSetReplicationFactor);
1024 
1025  KuduClient();
1026 
1027  // Owned.
1028  Data* data_;
1029 
1030  DISALLOW_COPY_AND_ASSIGN(KuduClient);
1031 };
1032 
1034 class KUDU_EXPORT KuduTabletServer {
1035  public:
1036  ~KuduTabletServer();
1037 
1040  const std::string& uuid() const;
1041 
1044  const std::string& hostname() const;
1045 
1048  uint16_t port() const;
1049 
1051 
1056  const std::string& location() const KUDU_NO_EXPORT;
1058 
1059  private:
1060  class KUDU_NO_EXPORT Data;
1061 
1062  friend class KuduClient;
1063  friend class KuduScanner;
1064  friend class KuduScanTokenBuilder;
1065 
1066  KuduTabletServer();
1067 
1068  // Owned.
1069  Data* data_;
1070 
1071  DISALLOW_COPY_AND_ASSIGN(KuduTabletServer);
1072 };
1073 
1075 class KUDU_EXPORT KuduReplica {
1076  public:
1077  ~KuduReplica();
1078 
1083  bool is_leader() const;
1084 
1086  const KuduTabletServer& ts() const;
1087 
1088  private:
1089  friend class KuduClient;
1090  friend class KuduScanTokenBuilder;
1091  friend class internal::ReplicaController;
1092 
1093  class KUDU_NO_EXPORT Data;
1094 
1095  KuduReplica();
1096 
1097  // Owned.
1098  Data* data_;
1099 
1100  DISALLOW_COPY_AND_ASSIGN(KuduReplica);
1101 };
1102 
1104 class KUDU_EXPORT KuduTablet {
1105  public:
1106  ~KuduTablet();
1107 
1110  const std::string& id() const;
1111 
1117  const std::vector<const KuduReplica*>& replicas() const;
1118 
1119  private:
1120  friend class KuduClient;
1121  friend class KuduScanTokenBuilder;
1122 
1123  class KUDU_NO_EXPORT Data;
1124 
1125  KuduTablet();
1126 
1127  // Owned.
1128  Data* data_;
1129 
1130  DISALLOW_COPY_AND_ASSIGN(KuduTablet);
1131 };
1132 
1134 class KUDU_EXPORT KuduTableCreator {
1135  public:
1136  ~KuduTableCreator();
1137 
1149  KuduTableCreator& table_name(const std::string& name);
1150 
1162 
1179  KuduTableCreator& add_hash_partitions(const std::vector<std::string>& columns,
1180  int32_t num_buckets);
1181 
1197  KuduTableCreator& add_hash_partitions(const std::vector<std::string>& columns,
1198  int32_t num_buckets,
1199  int32_t seed);
1200 
1213  KuduTableCreator& set_range_partition_columns(const std::vector<std::string>& columns);
1214 
1219  };
1220 
1228  public:
1244  KuduPartialRow* upper_bound,
1245  RangePartitionBound lower_bound_type = INCLUSIVE_BOUND,
1246  RangePartitionBound upper_bound_type = EXCLUSIVE_BOUND);
1247 
1248  ~KuduRangePartition();
1249 
1268  Status add_hash_partitions(const std::vector<std::string>& columns,
1269  int32_t num_buckets,
1270  int32_t seed = 0);
1271  private:
1272  class KUDU_NO_EXPORT Data;
1273 
1274  friend class KuduTableCreator;
1275 
1276  // Owned.
1277  Data* data_;
1278 
1279  DISALLOW_COPY_AND_ASSIGN(KuduRangePartition);
1280  };
1281 
1311  KuduPartialRow* upper_bound,
1312  RangePartitionBound lower_bound_type = INCLUSIVE_BOUND,
1313  RangePartitionBound upper_bound_type = EXCLUSIVE_BOUND);
1314 
1333  KuduRangePartition* partition);
1334 
1344 
1352  KuduTableCreator& set_owner(const std::string& owner);
1353 
1359  KuduTableCreator& set_comment(const std::string& comment);
1360 
1366  KuduTableCreator& split_rows(const std::vector<const KuduPartialRow*>& split_rows)
1367  ATTRIBUTE_DEPRECATED("use add_range_partition_split() instead");
1368 
1378  KuduTableCreator& num_replicas(int n_replicas);
1379 
1391  KuduTableCreator& dimension_label(const std::string& dimension_label);
1392 
1400  KuduTableCreator& extra_configs(const std::map<std::string, std::string>& extra_configs);
1401 
1412 
1420  KuduTableCreator& wait(bool wait);
1421 
1436 
1437  private:
1438  class KUDU_NO_EXPORT Data;
1439 
1440  friend class KuduClient;
1441  friend class transactions::TxnSystemClient;
1442 
1443  explicit KuduTableCreator(KuduClient* client);
1444 
1445  // Owned.
1446  Data* data_;
1447 
1448  DISALLOW_COPY_AND_ASSIGN(KuduTableCreator);
1449 };
1450 
1452 class KUDU_EXPORT KuduTableStatistics {
1453  public:
1456 
1461  int64_t on_disk_size() const;
1462 
1467  int64_t live_row_count() const;
1468 
1475  int64_t on_disk_size_limit() const;
1476 
1483  int64_t live_row_count_limit() const;
1484 
1488  std::string ToString() const;
1489 
1490  private:
1491  class KUDU_NO_EXPORT Data;
1492 
1493  friend class KuduClient;
1494 
1495  // Owned.
1496  Data* data_;
1497 
1498  DISALLOW_COPY_AND_ASSIGN(KuduTableStatistics);
1499 };
1500 
1521 class KUDU_EXPORT KuduTable : public sp::enable_shared_from_this<KuduTable> {
1522  public:
1523  ~KuduTable();
1524 
1526  const std::string& name() const;
1527 
1535  const std::string& id() const;
1536 
1538  const KuduSchema& schema() const;
1539 
1541  const std::string& comment() const;
1542 
1544  int num_replicas() const;
1545 
1547  const std::string& owner() const;
1548 
1553 
1558 
1563 
1568 
1573 
1578 
1583 
1609  KuduValue* value);
1610 
1643  std::vector<KuduBloomFilter*>* bloom_filters);
1644 
1649 
1686  const std::vector<Slice>& bloom_filters);
1688 
1713  std::vector<KuduValue*>* values);
1714 
1726 
1738 
1741  KuduClient* client() const;
1742 
1744  const PartitionSchema& partition_schema() const;
1745 
1747  const std::map<std::string, std::string>& extra_configs() const;
1748 
1750 
1760  Status ListPartitions(std::vector<Partition>* partitions) KUDU_NO_EXPORT;
1761 
1763 
1764  private:
1765  class KUDU_NO_EXPORT Data;
1766 
1767  friend class KuduClient;
1768  friend class KuduPartitioner;
1769  friend class KuduScanToken;
1770  friend class KuduScanner;
1771 
1772  KuduTable(const sp::shared_ptr<KuduClient>& client,
1773  const std::string& name,
1774  const std::string& id,
1775  int num_replicas,
1776  const std::string& owner,
1777  const std::string& comment,
1778  const KuduSchema& schema,
1779  const PartitionSchema& partition_schema,
1780  const std::map<std::string, std::string>& extra_configs);
1781 
1782  // Owned.
1783  Data* data_;
1784 
1785  DISALLOW_COPY_AND_ASSIGN(KuduTable);
1786 };
1787 
1799 class KUDU_EXPORT KuduTableAlterer {
1800  public:
1801  ~KuduTableAlterer();
1802 
1808  KuduTableAlterer* RenameTo(const std::string& new_name);
1809 
1815  KuduTableAlterer* SetOwner(const std::string& new_owner);
1816 
1822  KuduTableAlterer* SetComment(const std::string& new_comment);
1823 
1833  KuduColumnSpec* AddColumn(const std::string& name);
1834 
1843  KuduColumnSpec* AlterColumn(const std::string& name);
1844 
1852  KuduTableAlterer* DropColumn(const std::string& name);
1853 
1886  KuduPartialRow* lower_bound,
1887  KuduPartialRow* upper_bound,
1890 
1926  KuduPartialRow* lower_bound,
1927  KuduPartialRow* upper_bound,
1928  const std::string& dimension_label,
1931 
1960  KuduPartialRow* lower_bound,
1961  KuduPartialRow* upper_bound,
1964 
1974  KuduTableAlterer* AlterExtraConfig(const std::map<std::string, std::string>& extra_configs);
1975 
1988  KuduTableAlterer* SetTableDiskSizeLimit(int64_t disk_size_limit);
1989 
2002  KuduTableAlterer* SetTableRowCountLimit(int64_t row_count_limit);
2003 
2014 
2026  KuduTableAlterer* wait(bool wait);
2027 
2029 
2038  KuduTableAlterer* modify_external_catalogs(bool modify_external_catalogs) KUDU_NO_EXPORT;
2039 
2041 
2047 
2048  private:
2049  class KUDU_NO_EXPORT Data;
2050 
2051  friend class KuduClient;
2052  friend class tools::TableAlter;
2053  friend class kudu::AlterTableTest;
2054 
2055  FRIEND_TEST(MultiTServerClientTest, TestSetReplicationFactor);
2056 
2057  KuduTableAlterer(KuduClient* client,
2058  const std::string& name);
2059 
2060  // Owned.
2061  Data* data_;
2062 
2063  DISALLOW_COPY_AND_ASSIGN(KuduTableAlterer);
2064 };
2065 
2071 class KUDU_EXPORT KuduError {
2072  public:
2073  ~KuduError();
2074 
2076  const Status& status() const;
2077 
2080 
2089 
2101 
2102  private:
2103  class KUDU_NO_EXPORT Data;
2104 
2105  friend class internal::Batcher;
2106  friend class internal::ErrorCollector;
2107  friend class KuduSession;
2108 
2109  KuduError(KuduWriteOperation* failed_op, const Status& error);
2110 
2111  // Owned.
2112  Data* data_;
2113 
2114  DISALLOW_COPY_AND_ASSIGN(KuduError);
2115 };
2116 
2117 
2176 class KUDU_EXPORT KuduSession : public sp::enable_shared_from_this<KuduSession> {
2177  public:
2178  ~KuduSession();
2179 
2181  enum FlushMode {
2187 
2215 
2228  MANUAL_FLUSH
2229  };
2230 
2239  Status SetFlushMode(FlushMode m) WARN_UNUSED_RESULT;
2240 
2262 
2277  COMMIT_WAIT
2278  };
2279 
2286  WARN_UNUSED_RESULT;
2287 
2305  Status SetMutationBufferSpace(size_t size_bytes) WARN_UNUSED_RESULT;
2306 
2331  WARN_UNUSED_RESULT;
2332 
2354  Status SetMutationBufferFlushInterval(unsigned int millis) WARN_UNUSED_RESULT;
2355 
2380  Status SetMutationBufferMaxNum(unsigned int max_num) WARN_UNUSED_RESULT;
2381 
2387  void SetTimeoutMillis(int millis);
2388 
2392 
2416  Status Apply(KuduWriteOperation* write_op) WARN_UNUSED_RESULT;
2417 
2432  Status Flush() WARN_UNUSED_RESULT;
2433 
2474  void FlushAsync(KuduStatusCallback* cb);
2475 
2478  Status Close() WARN_UNUSED_RESULT;
2479 
2488  bool HasPendingOperations() const;
2489 
2511  int CountBufferedOperations() const
2512  ATTRIBUTE_DEPRECATED("this method is experimental and will disappear "
2513  "in a future release");
2514 
2539  Status SetErrorBufferSpace(size_t size_bytes);
2540 
2550  int CountPendingErrors() const;
2551 
2562  void GetPendingErrors(std::vector<KuduError*>* errors, bool* overflowed);
2563 
2565  KuduClient* client() const;
2566 
2567  private:
2568  class KUDU_NO_EXPORT Data;
2569 
2570  friend class ClientTest;
2571  friend class KuduClient;
2572  friend class KuduTransaction;
2573  friend class internal::Batcher;
2574  friend class tablet::FuzzTest;
2575  FRIEND_TEST(ClientTest, TestAutoFlushBackgroundAndErrorCollector);
2576  FRIEND_TEST(ClientTest, TestAutoFlushBackgroundApplyBlocks);
2577  FRIEND_TEST(ClientTest, TxnIdOfTransactionalSession);
2578 
2579  explicit KuduSession(const sp::shared_ptr<KuduClient>& client);
2580  KuduSession(const sp::shared_ptr<KuduClient>& client, const TxnId& txn_id);
2581 
2582  // Owned.
2583  Data* data_;
2584 
2585  DISALLOW_COPY_AND_ASSIGN(KuduSession);
2586 };
2587 
2588 
2593 class KUDU_EXPORT KuduScanner {
2594  public:
2596  enum ReadMode {
2605 
2626 
2637  READ_YOUR_WRITES
2638  };
2639 
2643  enum OrderMode {
2650 
2655  ORDERED
2656  };
2657 
2661  enum { kScanTimeoutMillis = 30000 };
2662 
2668  explicit KuduScanner(KuduTable* table);
2669  ~KuduScanner();
2670 
2680  Status SetProjectedColumnNames(const std::vector<std::string>& col_names)
2681  WARN_UNUSED_RESULT;
2682 
2692  Status SetProjectedColumnIndexes(const std::vector<int>& col_indexes)
2693  WARN_UNUSED_RESULT;
2694 
2700  Status SetProjectedColumns(const std::vector<std::string>& col_names)
2701  WARN_UNUSED_RESULT
2702  ATTRIBUTE_DEPRECATED("use SetProjectedColumnNames() instead");
2703 
2712  Status AddConjunctPredicate(KuduPredicate* pred) WARN_UNUSED_RESULT;
2713 
2723 
2732  ATTRIBUTE_DEPRECATED("use AddLowerBound() instead");
2733 
2743 
2752  ATTRIBUTE_DEPRECATED("use AddExclusiveUpperBound() instead");
2753 
2763 
2773 
2780  Status SetCacheBlocks(bool cache_blocks);
2781 
2784 
2804 
2813  void Close();
2814 
2823  bool HasMoreRows() const;
2824 
2836  Status NextBatch(std::vector<KuduRowResult>* rows)
2837  ATTRIBUTE_DEPRECATED("use NextBatch(KuduScanBatch*) instead");
2838 
2851 
2864 
2874 
2877 
2884  Status SetBatchSizeBytes(uint32_t batch_size);
2885 
2894  WARN_UNUSED_RESULT;
2895 
2901  Status SetReadMode(ReadMode read_mode) WARN_UNUSED_RESULT;
2902 
2908  Status SetOrderMode(OrderMode order_mode) WARN_UNUSED_RESULT
2909  ATTRIBUTE_DEPRECATED("use SetFaultTolerant() instead");
2910 
2923  Status SetFaultTolerant() WARN_UNUSED_RESULT;
2924 
2930  Status SetSnapshotMicros(uint64_t snapshot_timestamp_micros) WARN_UNUSED_RESULT;
2931 
2941  Status SetSnapshotRaw(uint64_t snapshot_timestamp) WARN_UNUSED_RESULT;
2942 
2944 
2959  Status SetDiffScan(uint64_t start_timestamp, uint64_t end_timestamp)
2960  WARN_UNUSED_RESULT KUDU_NO_EXPORT;
2961 
2963 
2969  Status SetTimeoutMillis(int millis);
2970 
2972  KuduSchema GetProjectionSchema() const;
2973 
2975  sp::shared_ptr<KuduTable> GetKuduTable();
2976 
2984 
2986  static const uint64_t NO_FLAGS = 0;
2993  static const uint64_t PAD_UNIXTIME_MICROS_TO_16_BYTES = 1 << 0;
2994 
3002  static const uint64_t COLUMNAR_LAYOUT = 1 << 1;
3003 
3031  Status SetRowFormatFlags(uint64_t flags);
3033 
3039  Status SetLimit(int64_t limit) WARN_UNUSED_RESULT;
3040 
3046  std::string ToString() const;
3047 
3048  private:
3049  class KUDU_NO_EXPORT Data;
3050 
3051  Status NextBatch(internal::ScanBatchDataInterface* batch);
3052 
3053  friend class KuduScanToken;
3054  FRIEND_TEST(ClientTest, TestBlockScannerHijackingAttempts);
3055  FRIEND_TEST(ClientTest, TestScanCloseProxy);
3056  FRIEND_TEST(ClientTest, TestScanFaultTolerance);
3057  FRIEND_TEST(ClientTest, TestScanNoBlockCaching);
3058  FRIEND_TEST(ClientTest, TestScanTimeout);
3059  FRIEND_TEST(ClientTest, TestReadAtSnapshotNoTimestampSet);
3060  FRIEND_TEST(ConsistencyITest, TestSnapshotScanTimestampReuse);
3061  FRIEND_TEST(ScanTokenTest, TestScanTokens);
3062 
3063  // Owned.
3064  Data* data_;
3065 
3066  DISALLOW_COPY_AND_ASSIGN(KuduScanner);
3067 };
3068 
3089 class KUDU_EXPORT KuduScanToken {
3090  public:
3091 
3092  ~KuduScanToken();
3093 
3104  Status IntoKuduScanner(KuduScanner** scanner) const WARN_UNUSED_RESULT;
3105 
3107  const KuduTablet& tablet() const;
3108 
3117  Status Serialize(std::string* buf) const WARN_UNUSED_RESULT;
3118 
3131  const std::string& serialized_token,
3132  KuduScanner** scanner) WARN_UNUSED_RESULT;
3133 
3134  private:
3135  class KUDU_NO_EXPORT Data;
3136 
3137  friend class KuduScanTokenBuilder;
3138 
3139  KuduScanToken();
3140 
3141  // Owned.
3142  Data* data_;
3143 
3144  DISALLOW_COPY_AND_ASSIGN(KuduScanToken);
3145 };
3146 
3150 class KUDU_EXPORT KuduScanTokenBuilder {
3151  public:
3152 
3160 
3170  Status SetProjectedColumnNames(const std::vector<std::string>& col_names)
3171  WARN_UNUSED_RESULT;
3172 
3174  Status SetProjectedColumnIndexes(const std::vector<int>& col_indexes)
3175  WARN_UNUSED_RESULT;
3176 
3178  Status AddConjunctPredicate(KuduPredicate* pred) WARN_UNUSED_RESULT;
3179 
3181  Status AddLowerBound(const KuduPartialRow& key) WARN_UNUSED_RESULT;
3182 
3191  Status AddUpperBound(const KuduPartialRow& key) WARN_UNUSED_RESULT;
3192 
3194  Status SetCacheBlocks(bool cache_blocks) WARN_UNUSED_RESULT;
3195 
3202  Status SetBatchSizeBytes(uint32_t batch_size) WARN_UNUSED_RESULT;
3203 
3212  WARN_UNUSED_RESULT;
3213 
3215  Status SetReadMode(KuduScanner::ReadMode read_mode) WARN_UNUSED_RESULT;
3216 
3218  Status SetFaultTolerant() WARN_UNUSED_RESULT;
3219 
3221  Status SetSnapshotMicros(uint64_t snapshot_timestamp_micros)
3222  WARN_UNUSED_RESULT;
3223 
3225  Status SetSnapshotRaw(uint64_t snapshot_timestamp) WARN_UNUSED_RESULT;
3226 
3228 
3230  Status SetDiffScan(uint64_t start_timestamp, uint64_t end_timestamp)
3231  WARN_UNUSED_RESULT KUDU_NO_EXPORT;
3233 
3235  Status SetTimeoutMillis(int millis) WARN_UNUSED_RESULT;
3236 
3244  Status IncludeTableMetadata(bool include_metadata) WARN_UNUSED_RESULT;
3245 
3253  Status IncludeTabletMetadata(bool include_metadata) WARN_UNUSED_RESULT;
3254 
3263  Status Build(std::vector<KuduScanToken*>* tokens) WARN_UNUSED_RESULT;
3264 
3265  private:
3266  class KUDU_NO_EXPORT Data;
3267 
3268  // Owned.
3269  Data* data_;
3270 
3271  DISALLOW_COPY_AND_ASSIGN(KuduScanTokenBuilder);
3272 };
3273 
3275 class KUDU_EXPORT KuduPartitionerBuilder {
3276  public:
3281  explicit KuduPartitionerBuilder(sp::shared_ptr<KuduTable> table);
3283 
3290 
3309  Status Build(KuduPartitioner** partitioner);
3310  private:
3311  class KUDU_NO_EXPORT Data;
3312 
3313  // Owned.
3314  Data* data_;
3315 
3316  DISALLOW_COPY_AND_ASSIGN(KuduPartitionerBuilder);
3317 };
3318 
3329 class KUDU_EXPORT KuduPartitioner {
3330  public:
3331  ~KuduPartitioner();
3332 
3336  int NumPartitions() const;
3337 
3349  Status PartitionRow(const KuduPartialRow& row, int* partition);
3350  private:
3351  class KUDU_NO_EXPORT Data;
3352 
3353  friend class KuduPartitionerBuilder;
3354 
3355  explicit KuduPartitioner(Data* data);
3356  Data* data_; // Owned.
3357 };
3358 
3359 
3360 } // namespace client
3361 } // namespace kudu
3362 #endif
kudu::client::KuduTransaction::Commit
Status Commit() WARN_UNUSED_RESULT
kudu::client::KuduClient::connection_negotiation_timeout
MonoDelta connection_negotiation_timeout() const
kudu::client::KuduError::release_failed_op
KuduWriteOperation * release_failed_op()
kudu::client::KuduTableCreator::extra_configs
KuduTableCreator & extra_configs(const std::map< std::string, std::string > &extra_configs)
kudu::client::KuduTableAlterer::wait
KuduTableAlterer * wait(bool wait)
kudu::client::KuduError
This class represents an error which occurred in a write operation.
Definition: client.h:2071
kudu::client::KuduSession
Representation of a Kudu client session.
Definition: client.h:2176
kudu::client::KuduTransaction::CreateSession
Status CreateSession(sp::shared_ptr< KuduSession > *session) WARN_UNUSED_RESULT
kudu::client::KuduClient::NewTableAlterer
KuduTableAlterer * NewTableAlterer(const std::string &table_name)
kudu::client::KuduTablet::id
const std::string & id() const
kudu::client::KuduTabletServer::hostname
const std::string & hostname() const
kudu::client::KuduClient::IsMultiMaster
bool IsMultiMaster() const
kudu::client::KuduTableAlterer::DropRangePartition
KuduTableAlterer * DropRangePartition(KuduPartialRow *lower_bound, KuduPartialRow *upper_bound, KuduTableCreator::RangePartitionBound lower_bound_type=KuduTableCreator::INCLUSIVE_BOUND, KuduTableCreator::RangePartitionBound upper_bound_type=KuduTableCreator::EXCLUSIVE_BOUND)
kudu::client::KuduTransaction
Definition: client.h:409
kudu::client::KuduTablet
In-memory representation of a remote tablet.
Definition: client.h:1104
kudu::client::KuduScanner::AddExclusiveUpperBoundPartitionKeyRaw
Status AddExclusiveUpperBoundPartitionKeyRaw(const Slice &partition_key)
kudu::client::KuduDeleteIgnore
A single row delete ignore to be sent to the cluster.
Definition: write_op.h:300
kudu::client::KuduTableCreator::set_range_partition_columns
KuduTableCreator & set_range_partition_columns(const std::vector< std::string > &columns)
kudu::client::KuduClient::IsCreateTableInProgress
Status IsCreateTableInProgress(const std::string &table_name, bool *create_in_progress)
kudu::client::KuduClientBuilder::master_server_addrs
KuduClientBuilder & master_server_addrs(const std::vector< std::string > &addrs)
kudu::client::KuduTableAlterer::SetOwner
KuduTableAlterer * SetOwner(const std::string &new_owner)
kudu::client::KuduTableStatistics
In-memory statistics of table.
Definition: client.h:1452
kudu::client::KuduTable::id
const std::string & id() const
kudu::client::KuduTransaction::SerializationOptions
Definition: client.h:505
kudu::client::KuduTableCreator::dimension_label
KuduTableCreator & dimension_label(const std::string &dimension_label)
kudu::client::KuduPartitionerBuilder::SetBuildTimeout
KuduPartitionerBuilder * SetBuildTimeout(MonoDelta timeout)
kudu::client::KuduTable::NewUpsert
KuduUpsert * NewUpsert()
kudu::client::KuduTable::NewInsertIgnore
KuduInsertIgnore * NewInsertIgnore()
kudu::client::KuduTableAlterer::timeout
KuduTableAlterer * timeout(const MonoDelta &timeout)
kudu::client::KuduTableCreator::RangePartitionBound
RangePartitionBound
Range partition bound type.
Definition: client.h:1216
kudu::client::KuduTableCreator::split_rows
KuduTableCreator & split_rows(const std::vector< const KuduPartialRow * > &split_rows) ATTRIBUTE_DEPRECATED("use add_range_partition_split() instead")
kudu::client::KuduClient::ExportAuthenticationCredentials
Status ExportAuthenticationCredentials(std::string *authn_creds) const
kudu::client::KuduClient::TableExists
Status TableExists(const std::string &table_name, bool *exists)
kudu::client::KuduPartitionerBuilder::Build
Status Build(KuduPartitioner **partitioner)
shared_ptr.h
Smart pointer typedefs for externally-faced code.
kudu::client::KuduTableAlterer::AlterExtraConfig
KuduTableAlterer * AlterExtraConfig(const std::map< std::string, std::string > &extra_configs)
kudu::client::KuduTable::num_replicas
int num_replicas() const
kudu::client::KuduError::failed_op
const KuduWriteOperation & failed_op() const
kudu::client::KuduSession::CLIENT_PROPAGATED
@ CLIENT_PROPAGATED
Definition: client.h:2261
kudu::client::KuduError::was_possibly_successful
bool was_possibly_successful() const
kudu::client::KuduScanTokenBuilder::SetCacheBlocks
Status SetCacheBlocks(bool cache_blocks) WARN_UNUSED_RESULT
kudu::client::KuduClient::IsAlterTableInProgress
Status IsAlterTableInProgress(const std::string &table_name, bool *alter_in_progress)
kudu::client::KuduTable::comment
const std::string & comment() const
kudu::client::KuduTableCreator::add_range_partition
KuduTableCreator & add_range_partition(KuduPartialRow *lower_bound, KuduPartialRow *upper_bound, RangePartitionBound lower_bound_type=INCLUSIVE_BOUND, RangePartitionBound upper_bound_type=EXCLUSIVE_BOUND)
kudu::client::ResourceMetrics
A generic catalog of simple metrics.
Definition: resource_metrics.h:39
kudu::client::KuduTransaction::SerializationOptions::enable_keepalive
SerializationOptions & enable_keepalive(bool enable)
kudu::client::KuduTransaction::Serialize
Status Serialize(std::string *serialized_txn, const SerializationOptions &options=SerializationOptions()) const WARN_UNUSED_RESULT
kudu::client::KuduSession::SetMutationBufferSpace
Status SetMutationBufferSpace(size_t size_bytes) WARN_UNUSED_RESULT
kudu::client::KuduScanTokenBuilder::SetSelection
Status SetSelection(KuduClient::ReplicaSelection selection) WARN_UNUSED_RESULT
kudu::client::KuduPartitioner
Definition: client.h:3329
kudu::client::KuduClientBuilder::Build
Status Build(sp::shared_ptr< KuduClient > *client)
kudu::client::KuduScanner
This class is a representation of a single scan.
Definition: client.h:2593
kudu::client::KuduValue
A constant cell value with a specific type.
Definition: value.h:37
kudu::client::KuduError::status
const Status & status() const
kudu::client::KuduReplica::ts
const KuduTabletServer & ts() const
kudu::client::KuduTableAlterer::SetTableRowCountLimit
KuduTableAlterer * SetTableRowCountLimit(int64_t row_count_limit)
kudu::client::KuduScanner::SetSelection
Status SetSelection(KuduClient::ReplicaSelection selection) WARN_UNUSED_RESULT
kudu::client::KuduClient::NewSession
sp::shared_ptr< KuduSession > NewSession()
kudu::client::KuduTabletServer
In-memory representation of a remote tablet server.
Definition: client.h:1034
kudu::client::KuduTableCreator::add_custom_range_partition
KuduTableCreator & add_custom_range_partition(KuduRangePartition *partition)
kudu::client::KuduTableCreator::KuduRangePartition::KuduRangePartition
KuduRangePartition(KuduPartialRow *lower_bound, KuduPartialRow *upper_bound, RangePartitionBound lower_bound_type=INCLUSIVE_BOUND, RangePartitionBound upper_bound_type=EXCLUSIVE_BOUND)
kudu::client::KuduTableStatistics::on_disk_size_limit
int64_t on_disk_size_limit() const
kudu::client::KuduScanner::ReadMode
ReadMode
The read modes for scanners.
Definition: client.h:2596
kudu::client::KuduTableAlterer::AddRangePartition
KuduTableAlterer * AddRangePartition(KuduPartialRow *lower_bound, KuduPartialRow *upper_bound, KuduTableCreator::RangePartitionBound lower_bound_type=KuduTableCreator::INCLUSIVE_BOUND, KuduTableCreator::RangePartitionBound upper_bound_type=KuduTableCreator::EXCLUSIVE_BOUND)
kudu::client::KuduSession::SetMutationBufferMaxNum
Status SetMutationBufferMaxNum(unsigned int max_num) WARN_UNUSED_RESULT
kudu::client::KuduTable::NewIsNotNullPredicate
KuduPredicate * NewIsNotNullPredicate(const Slice &col_name)
kudu::client::KuduScanner::READ_AT_SNAPSHOT
@ READ_AT_SNAPSHOT
Definition: client.h:2625
kudu::client::KuduClientBuilder::import_authentication_credentials
KuduClientBuilder & import_authentication_credentials(std::string authn_creds)
KuduPartialRow
A row which may only contain values for a subset of the columns.
Definition: partial_row.h:72
kudu::client::KuduSession::SetMutationBufferFlushInterval
Status SetMutationBufferFlushInterval(unsigned int millis) WARN_UNUSED_RESULT
kudu::client::KuduTableCreator::table_name
KuduTableCreator & table_name(const std::string &name)
kudu::client::KuduTableStatistics::ToString
std::string ToString() const
kudu::client::KuduScanner::GetCurrentServer
Status GetCurrentServer(KuduTabletServer **server)
kudu::client::KuduReplica::is_leader
bool is_leader() const
kudu::client::KuduClient::default_admin_operation_timeout
const MonoDelta & default_admin_operation_timeout() const
kudu::client::KuduTableCreator::add_range_partition_split
KuduTableCreator & add_range_partition_split(KuduPartialRow *split_row)
kudu::client::KuduScanBatch
A batch of zero or more rows returned by a scan operation.
Definition: scan_batch.h:84
kudu::client::KuduTable::NewDelete
KuduDelete * NewDelete()
kudu::client::KuduSession::ExternalConsistencyMode
ExternalConsistencyMode
The possible external consistency modes on which Kudu operates.
Definition: client.h:2242
kudu::client::KuduScanner::SetCacheBlocks
Status SetCacheBlocks(bool cache_blocks)
kudu::client::KuduSession::SetMutationBufferFlushWatermark
Status SetMutationBufferFlushWatermark(double watermark_pct) WARN_UNUSED_RESULT
kudu::client::KuduTableAlterer::SetTableDiskSizeLimit
KuduTableAlterer * SetTableDiskSizeLimit(int64_t disk_size_limit)
kudu::client::KuduTableCreator::KuduRangePartition
Definition: client.h:1227
kudu::client::KuduTableAlterer::RenameTo
KuduTableAlterer * RenameTo(const std::string &new_name)
kudu::client::KuduTableCreator::add_hash_partitions
KuduTableCreator & add_hash_partitions(const std::vector< std::string > &columns, int32_t num_buckets, int32_t seed)
kudu::client::KuduUpdate
A single row update to be sent to the cluster.
Definition: write_op.h:222
kudu::client::KuduPredicate
A representation of comparison predicate for Kudu queries.
Definition: scan_predicate.h:43
kudu::client::KuduScanTokenBuilder::AddLowerBound
Status AddLowerBound(const KuduPartialRow &key) WARN_UNUSED_RESULT
kudu::client::KuduScanner::SetProjectedColumnNames
Status SetProjectedColumnNames(const std::vector< std::string > &col_names) WARN_UNUSED_RESULT
kudu::client::KuduPartitionerBuilder
Builder for Partitioner instances.
Definition: client.h:3275
kudu::client::KuduScanner::GetResourceMetrics
const ResourceMetrics & GetResourceMetrics() const
kudu::client::KuduTableCreator
A helper class to create a new table with the desired options.
Definition: client.h:1134
kudu::client::KuduStatusCallback
The interface for all status callbacks.
Definition: callbacks.h:161
kudu::client::KuduSession::Flush
Status Flush() WARN_UNUSED_RESULT
kudu::client::KuduTableAlterer::Alter
Status Alter()
kudu::client::KuduClient::NewTableCreator
KuduTableCreator * NewTableCreator()
kudu::client::KuduClientBuilder::default_rpc_timeout
KuduClientBuilder & default_rpc_timeout(const MonoDelta &timeout)
kudu::client::KuduClient::default_rpc_timeout
const MonoDelta & default_rpc_timeout() const
kudu::client::internal::AsyncLeaderMasterRpc
Definition: client.h:127
kudu::client::KuduClientBuilder::require_authentication
KuduClientBuilder & require_authentication(bool require_authentication)
kudu::client::KuduScanTokenBuilder::SetFaultTolerant
Status SetFaultTolerant() WARN_UNUSED_RESULT
kudu::client::KuduColumnSpec
Builder API for specifying or altering a column within a table schema.
Definition: schema.h:363
kudu::client::KuduClient::GetTableSchema
Status GetTableSchema(const std::string &table_name, KuduSchema *schema)
kudu::client::KuduTable::NewUpdate
KuduUpdate * NewUpdate()
kudu::client::KuduTableCreator::add_hash_partitions
KuduTableCreator & add_hash_partitions(const std::vector< std::string > &columns, int32_t num_buckets)
kudu::client::KuduClientBuilder::add_master_server_addr
KuduClientBuilder & add_master_server_addr(const std::string &addr)
kudu::client::KuduTable::NewDeleteIgnore
KuduDeleteIgnore * NewDeleteIgnore()
kudu::client::KuduTable::owner
const std::string & owner() const
kudu::client::KuduScanner::AddLowerBound
Status AddLowerBound(const KuduPartialRow &key)
kudu::client::KuduScanner::SetFaultTolerant
Status SetFaultTolerant() WARN_UNUSED_RESULT
kudu::client::KuduScanner::SetBatchSizeBytes
Status SetBatchSizeBytes(uint32_t batch_size)
kudu::client::KuduScanToken::Serialize
Status Serialize(std::string *buf) const WARN_UNUSED_RESULT
kudu::client::KuduPartitioner::PartitionRow
Status PartitionRow(const KuduPartialRow &row, int *partition)
kudu::client::KuduTableCreator::Create
Status Create()
kudu::client::KuduScanTokenBuilder::KuduScanTokenBuilder
KuduScanTokenBuilder(KuduTable *table)
kudu::client::KuduSession::Apply
Status Apply(KuduWriteOperation *write_op) WARN_UNUSED_RESULT
kudu::client::KuduScanTokenBuilder::SetProjectedColumnNames
Status SetProjectedColumnNames(const std::vector< std::string > &col_names) WARN_UNUSED_RESULT
kudu::client::KuduLoggingCallback
The interface for all logging callbacks.
Definition: callbacks.h:44
kudu::client::KuduScanner::NextBatch
Status NextBatch(KuduColumnarScanBatch *batch)
kudu::client::KuduTableAlterer::DropColumn
KuduTableAlterer * DropColumn(const std::string &name)
kudu::client::KuduTabletServer::uuid
const std::string & uuid() const
kudu::client::KuduScanner::KeepAlive
Status KeepAlive()
kudu::client::KuduTableStatistics::on_disk_size
int64_t on_disk_size() const
kudu::client::KuduTable::NewIsNullPredicate
KuduPredicate * NewIsNullPredicate(const Slice &col_name)
kudu::client::KuduScanner::AddLowerBoundPartitionKeyRaw
Status AddLowerBoundPartitionKeyRaw(const Slice &partition_key)
kudu::client::KuduPartitioner::NumPartitions
int NumPartitions() const
kudu::client::KuduTableCreator::INCLUSIVE_BOUND
@ INCLUSIVE_BOUND
An inclusive bound.
Definition: client.h:1218
kudu::client::KuduTableCreator::timeout
KuduTableCreator & timeout(const MonoDelta &timeout)
kudu::client::KuduScanTokenBuilder
Builds scan tokens for a table.
Definition: client.h:3150
kudu::client::KuduTransaction::SerializationOptions::keepalive
bool keepalive() const
kudu::client::KuduClientBuilder::sasl_protocol_name
KuduClientBuilder & sasl_protocol_name(const std::string &sasl_protocol_name)
kudu::client::KuduScanner::KuduScanner
KuduScanner(KuduTable *table)
kudu::client::KuduTableAlterer::AddColumn
KuduColumnSpec * AddColumn(const std::string &name)
kudu::client::KuduTableAlterer::SetComment
KuduTableAlterer * SetComment(const std::string &new_comment)
kudu::client::KuduUpsert
A single row upsert to be sent to the cluster.
Definition: write_op.h:195
kudu::client::KuduClient::ReplicaSelection
ReplicaSelection
Policy with which to choose amongst multiple replicas.
Definition: client.h:851
kudu::client::KuduWriteOperation
A single-row write operation to be sent to a Kudu table.
Definition: write_op.h:66
kudu::client::KuduTable::name
const std::string & name() const
kudu::client::KuduTable::extra_configs
const std::map< std::string, std::string > & extra_configs() const
kudu::client::KuduSession::FlushMode
FlushMode
Modes of flush operations.
Definition: client.h:2181
kudu::client::internal::AsyncRandomTxnManagerRpc
Definition: client.h:129
kudu::client::KuduClient::LEADER_ONLY
@ LEADER_ONLY
Select the LEADER replica.
Definition: client.h:852
kudu::client::KuduReplica
In-memory representation of a remote tablet's replica.
Definition: client.h:1075
kudu::client::KuduSchema
A representation of a table's schema.
Definition: schema.h:619
kudu::client::KuduScanToken
A scan descriptor limited to a single physical contiguous location.
Definition: client.h:3089
kudu::client::KuduSession::AUTO_FLUSH_BACKGROUND
@ AUTO_FLUSH_BACKGROUND
Definition: client.h:2214
kudu::Status
A representation of an operation's outcome.
Definition: status.h:165
kudu::client::KuduClientBuilder::num_reactors
KuduClientBuilder & num_reactors(int num_reactors)
Set the number of reactors for the RPC messenger.
kudu::client::KuduScanner::NextBatch
Status NextBatch(std::vector< KuduRowResult > *rows) ATTRIBUTE_DEPRECATED("use NextBatch(KuduScanBatch*) instead")
kudu::client::KuduPredicate::ComparisonOp
ComparisonOp
Supported comparison operators.
Definition: scan_predicate.h:46
kudu::client::KuduClient::OpenTable
Status OpenTable(const std::string &table_name, sp::shared_ptr< KuduTable > *table)
kudu::client::KuduTableCreator::EXCLUSIVE_BOUND
@ EXCLUSIVE_BOUND
An exclusive bound.
Definition: client.h:1217
kudu::client::KuduTable
A representation of a table on a particular cluster.
Definition: client.h:1521
kudu::client::KuduTableAlterer::AlterColumn
KuduColumnSpec * AlterColumn(const std::string &name)
kudu::client::KuduSession::AUTO_FLUSH_SYNC
@ AUTO_FLUSH_SYNC
Definition: client.h:2186
kudu::client::KuduScanner::Close
void Close()
kudu::client::KuduClient::kNoTimestamp
static const uint64_t kNoTimestamp
Definition: client.h:878
kudu::client::KuduClient::ListTabletServers
Status ListTabletServers(std::vector< KuduTabletServer * > *tablet_servers)
kudu::client::KuduTableCreator::wait
KuduTableCreator & wait(bool wait)
kudu::client::KuduScanner::SetProjectedColumnIndexes
Status SetProjectedColumnIndexes(const std::vector< int > &col_indexes) WARN_UNUSED_RESULT
kudu::client::KuduDelete
A single row delete to be sent to the cluster.
Definition: write_op.h:274
kudu::MonoDelta
A representation of a time interval.
Definition: monotime.h:58
kudu::client::KuduScanner::AddConjunctPredicate
Status AddConjunctPredicate(KuduPredicate *pred) WARN_UNUSED_RESULT
kudu::client::KuduTable::NewInBloomFilterPredicate
KuduPredicate * NewInBloomFilterPredicate(const Slice &col_name, const std::vector< Slice > &bloom_filters)
kudu::client::KuduClient::GetLatestObservedTimestamp
uint64_t GetLatestObservedTimestamp() const
kudu::client::KuduScanToken::tablet
const KuduTablet & tablet() const
kudu::client::KuduTableCreator::set_comment
KuduTableCreator & set_comment(const std::string &comment)
kudu::client::KuduScanTokenBuilder::SetReadMode
Status SetReadMode(KuduScanner::ReadMode read_mode) WARN_UNUSED_RESULT
kudu::client::KuduTableStatistics::live_row_count_limit
int64_t live_row_count_limit() const
kudu::client::KuduClientBuilder::EncryptionPolicy
EncryptionPolicy
Policy for on-the-wire encryption.
Definition: client.h:238
kudu::client::KuduSession::SetFlushMode
Status SetFlushMode(FlushMode m) WARN_UNUSED_RESULT
kudu::client::KuduScanTokenBuilder::AddUpperBound
Status AddUpperBound(const KuduPartialRow &key) WARN_UNUSED_RESULT
kudu::client::KuduTable::NewInListPredicate
KuduPredicate * NewInListPredicate(const Slice &col_name, std::vector< KuduValue * > *values)
kudu::client::KuduClient::DeleteTable
Status DeleteTable(const std::string &table_name)
kudu::client::KuduScanner::AddLowerBoundRaw
Status AddLowerBoundRaw(const Slice &key) ATTRIBUTE_DEPRECATED("use AddLowerBound() instead")
kudu::client::KuduSession::SetTimeoutMillis
void SetTimeoutMillis(int millis)
kudu::client::KuduScanner::SetReadMode
Status SetReadMode(ReadMode read_mode) WARN_UNUSED_RESULT
kudu::Slice
A wrapper around externally allocated data.
Definition: slice.h:51
kudu::client::KuduTableCreator::num_replicas
KuduTableCreator & num_replicas(int n_replicas)
kudu::client::KuduClient::SetLatestObservedTimestamp
void SetLatestObservedTimestamp(uint64_t ht_timestamp)
kudu::client::KuduScanner::Open
Status Open()
kudu::client::KuduClient::ListTables
Status ListTables(std::vector< std::string > *tables, const std::string &filter="")
kudu::client::KuduClient::NewTransaction
Status NewTransaction(sp::shared_ptr< KuduTransaction > *txn) WARN_UNUSED_RESULT
kudu::client::KuduClientBuilder::default_admin_operation_timeout
KuduClientBuilder & default_admin_operation_timeout(const MonoDelta &timeout)
kudu::client::KuduTableAlterer::AddRangePartitionWithDimension
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)
kudu::client::KuduClientBuilder
A "factory" for KuduClient objects.
Definition: client.h:232
kudu::client::KuduColumnarScanBatch
A batch of columnar data returned from a scanner.
Definition: columnar_scan_batch.h:51
kudu::client::KuduInsert
A single row insert to be sent to the cluster.
Definition: write_op.h:142
kudu::client::KuduScanTokenBuilder::SetBatchSizeBytes
Status SetBatchSizeBytes(uint32_t batch_size) WARN_UNUSED_RESULT
kudu::client::KuduScanner::HasMoreRows
bool HasMoreRows() const
kudu::client::KuduTable::NewComparisonPredicate
KuduPredicate * NewComparisonPredicate(const Slice &col_name, KuduPredicate::ComparisonOp op, KuduValue *value)
kudu::client::KuduScanToken::DeserializeIntoScanner
static Status DeserializeIntoScanner(KuduClient *client, const std::string &serialized_token, KuduScanner **scanner) WARN_UNUSED_RESULT
kudu::client::KuduScanner::AddExclusiveUpperBoundRaw
Status AddExclusiveUpperBoundRaw(const Slice &key) ATTRIBUTE_DEPRECATED("use AddExclusiveUpperBound() instead")
kudu::client::KuduTable::schema
const KuduSchema & schema() const
kudu::client::KuduTableCreator::schema
KuduTableCreator & schema(const KuduSchema *schema)
kudu::client::KuduPartitionerBuilder::KuduPartitionerBuilder
KuduPartitionerBuilder(sp::shared_ptr< KuduTable > table)
kudu::client::KuduTable::NewInBloomFilterPredicate
KuduPredicate * NewInBloomFilterPredicate(const Slice &col_name, std::vector< KuduBloomFilter * > *bloom_filters)
kudu::client::KuduInsertIgnore
A single row insert ignore to be sent to the cluster, duplicate row errors are ignored.
Definition: write_op.h:169
kudu::client::KuduSession::SetExternalConsistencyMode
Status SetExternalConsistencyMode(ExternalConsistencyMode m) WARN_UNUSED_RESULT
kudu::client::KuduScanTokenBuilder::AddConjunctPredicate
Status AddConjunctPredicate(KuduPredicate *pred) WARN_UNUSED_RESULT
kudu::client::KuduTableCreator::set_owner
KuduTableCreator & set_owner(const std::string &owner)
kudu::client::KuduScanner::SetOrderMode
Status SetOrderMode(OrderMode order_mode) WARN_UNUSED_RESULT ATTRIBUTE_DEPRECATED("use SetFaultTolerant() instead")
kudu::client::KuduTable::partition_schema
const PartitionSchema & partition_schema() const
kudu::client::KuduScanTokenBuilder::SetProjectedColumnIndexes
Status SetProjectedColumnIndexes(const std::vector< int > &col_indexes) WARN_UNUSED_RESULT
kudu::client::KuduTableAlterer
Alters an existing table based on the provided steps.
Definition: client.h:1799
kudu::client::KuduClientBuilder::clear_master_server_addrs
KuduClientBuilder & clear_master_server_addrs()
kudu::client::KuduTabletServer::port
uint16_t port() const
kudu::client::KuduScanner::AddExclusiveUpperBound
Status AddExclusiveUpperBound(const KuduPartialRow &key)
kudu::client::KuduScanner::UNORDERED
@ UNORDERED
Definition: client.h:2649
kudu::client::KuduUpdateIgnore
A single row update ignore to be sent to the cluster, missing row errors are ignored.
Definition: write_op.h:248
kudu::client::KuduTable::NewUpdateIgnore
KuduUpdateIgnore * NewUpdateIgnore()
kudu::client::KuduScanToken::IntoKuduScanner
Status IntoKuduScanner(KuduScanner **scanner) const WARN_UNUSED_RESULT
kudu::client::KuduTablet::replicas
const std::vector< const KuduReplica * > & replicas() const
kudu::client::KuduScanner::READ_LATEST
@ READ_LATEST
Definition: client.h:2604
kudu::client::KuduTableStatistics::live_row_count
int64_t live_row_count() const
status.h
kudu::client::KuduScanner::NextBatch
Status NextBatch(KuduScanBatch *batch)
kudu::client::KuduClientBuilder::encryption_policy
KuduClientBuilder & encryption_policy(EncryptionPolicy encryption_policy)
kudu::client::KuduScanner::OrderMode
OrderMode
Definition: client.h:2643
kudu::client::KuduTableCreator::KuduRangePartition::add_hash_partitions
Status add_hash_partitions(const std::vector< std::string > &columns, int32_t num_buckets, int32_t seed=0)
kudu::client::KuduTable::client
KuduClient * client() const
kudu::client::KuduScanner::SetProjectedColumns
Status SetProjectedColumns(const std::vector< std::string > &col_names) WARN_UNUSED_RESULT ATTRIBUTE_DEPRECATED("use SetProjectedColumnNames() instead")
kudu::client::KuduClient
A handle for a connection to a cluster.
Definition: client.h:662
kudu::client::KuduTable::NewInsert
KuduInsert * NewInsert()
kudu::client::KuduClientBuilder::connection_negotiation_timeout
KuduClientBuilder & connection_negotiation_timeout(const MonoDelta &timeout)