18 #ifndef KUDU_CLIENT_SCHEMA_H 19 #define KUDU_CLIENT_SCHEMA_H 29 #ifdef KUDU_HEADERS_NO_STUBS 30 #include "kudu/gutil/port.h" 32 #include "kudu/client/stubs.h" 35 #include "kudu/util/kudu_export.h" 41 struct ColumnSchemaDelta;
47 class RemoteKsckMaster;
54 class GetTableSchemaRpc;
82 DEFAULT_COMPRESSION = 0,
104 int32_t block_size = 0)
105 ATTRIBUTE_DEPRECATED("this constructor will be private in a future release")
106 : encoding_(encoding),
107 compression_(compression),
108 block_size_(block_size) {
122 std::string ToString()
const;
145 TIMESTAMP = UNIXTIME_MICROS
151 static std::string DataTypeToString(
DataType type);
171 bool is_nullable =
false,
172 const void* default_value = NULL,
209 const std::
string& name() const;
215 bool is_nullable() const;
240 class KUDU_EXPORT KuduColumnSpec {
253 KuduColumnSpec* Default(
KuduValue* value);
290 KuduColumnSpec* BlockSize(int32_t block_size);
304 KuduColumnSpec* PrimaryKey();
311 KuduColumnSpec* NotNull();
318 KuduColumnSpec* Nullable();
339 KuduColumnSpec* RemoveDefault();
346 KuduColumnSpec* RenameTo(
const std::string& new_name);
350 class KUDU_NO_EXPORT Data;
351 friend class KuduSchemaBuilder;
352 friend class KuduTableAlterer;
358 explicit KuduColumnSpec(
const std::string& col_name);
362 Status ToColumnSchemaDelta(ColumnSchemaDelta* col_delta)
const;
364 Slice DefaultValueAsSlice()
const;
425 class KUDU_NO_EXPORT Data;
461 Status Reset(
const std::vector<KuduColumnSchema>& columns,
int key_columns)
462 ATTRIBUTE_DEPRECATED(
"this method will be removed in a future release")
479 size_t num_columns()
const;
489 void GetPrimaryKeyColumnIndexes(std::vector<int>* indexes)
const;
501 friend class ClientTest;
510 friend class ScanConfiguration;
511 friend class internal::GetTableSchemaRpc;
512 friend class internal::LookupRpc;
513 friend class internal::MetaCacheEntry;
514 friend class internal::WriteRpc;
515 friend class tools::RemoteKsckMaster;
516 friend class tools::ReplicaDumper;
518 friend KuduSchema KuduSchemaFromSchema(
const Schema& schema);
526 size_t num_key_columns()
const;
534 #endif // KUDU_CLIENT_SCHEMA_H A representation of a table's schema.
Definition: schema.h:431
A representation of an operation's outcome.
Definition: status.h:145
A constant cell value with a specific type.
Definition: value.h:34
Definition: callbacks.h:28
Representation of column storage attributes.
Definition: schema.h:64
Builder API for specifying or altering a column within a table schema.
Definition: schema.h:240
Representation of the column schema.
Definition: schema.h:131
const EncodingType encoding() const
Definition: schema.h:112
Builds scan tokens for a table.
Definition: client.h:2184
Alters an existing table based on the provided steps.
Definition: client.h:1028
KuduColumnStorageAttributes(EncodingType encoding=AUTO_ENCODING, CompressionType compression=DEFAULT_COMPRESSION, int32_t block_size=0) ATTRIBUTE_DEPRECATED("this const ructor will be private in a future release")
Definition: schema.h:101
A handle for a connection to a cluster.
Definition: client.h:298
A wrapper around externally allocated data.
Definition: slice.h:47
A representation of a table on a particular cluster.
Definition: client.h:872
This class is a representation of a single scan.
Definition: client.h:1705
A single-row write operation to be sent to a Kudu table.
Definition: write_op.h:65
CompressionType
Column compression types.
Definition: schema.h:81
Builder API for constructing a KuduSchema object.
Definition: schema.h:391
DataType
Supported data types for columns.
Definition: schema.h:134
A scan descriptor limited to a single physical contiguous location.
Definition: client.h:2124
A helper class to create a new table with the desired options.
Definition: client.h:656
A row which may only contain values for a subset of the columns.
Definition: partial_row.h:63
const CompressionType compression() const
Definition: schema.h:117
EncodingType
Column encoding types.
Definition: schema.h:67