Skip to content

Commit

Permalink
Checkin .proto files for Kudu 1.17 (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
xqrzd authored Jul 23, 2023
1 parent dfee1ad commit 53dc03f
Show file tree
Hide file tree
Showing 10 changed files with 276 additions and 24 deletions.
3 changes: 3 additions & 0 deletions src/Knet.Kudu.Client/Protos/kudu/client/client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,7 @@ message AuthenticationCredentialsPB {

// Trusted root CA certificates.
repeated bytes ca_cert_ders = 2;

// A JWT to be verified by the master.
optional security.JwtRawPB jwt = 4;
}
8 changes: 8 additions & 0 deletions src/Knet.Kudu.Client/Protos/kudu/common/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ message ColumnSchemaPB {

// The comment for the column.
optional string comment = 12;

optional bool immutable = 13 [default = false];

// Whether the column is auto-incrementing.
optional bool is_auto_incrementing = 14 [default = false];
}

message ColumnSchemaDeltaPB {
Expand All @@ -152,6 +157,7 @@ message ColumnSchemaDeltaPB {
optional int32 block_size = 8;

optional string new_comment = 9;
optional bool immutable = 10 [default = false];
}

message SchemaPB {
Expand Down Expand Up @@ -310,6 +316,8 @@ enum ReplicaSelection {
// - Replicas whose tablet server has the same location as the client
// - All other replicas
CLOSEST_REPLICA = 2;
// Select the first replica in the list.
FIRST_REPLICA = 3;
}

// The serialized format of a Kudu table partition schema.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ message RowOperationsPB {
INSERT_IGNORE = 10;
UPDATE_IGNORE = 11;
DELETE_IGNORE = 12;
UPSERT_IGNORE = 13;

// Used when specifying split rows on table creation.
SPLIT_ROW = 4;
Expand Down
16 changes: 16 additions & 0 deletions src/Knet.Kudu.Client/Protos/kudu/common/wire_protocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ message AppStatusPB {
INCOMPLETE = 17;
END_OF_FILE = 18;
CANCELLED = 19;
IMMUTABLE = 20;
}

required ErrorCode code = 1;
Expand Down Expand Up @@ -87,6 +88,21 @@ message NodeInstancePB {
message ServerRegistrationPB {
repeated HostPortPB rpc_addresses = 1;
repeated HostPortPB http_addresses = 2;

// Addresses of this server's RPC endpoints advertised at a TCP proxy.
// It's assumed the proxy forwards RPC requests from the specified addresses
// to a dedicated RPC endpoint so that the server knows that requests came
// from the outside, and it can process it accordingly (e.g., transforming
// the internal addresses to be reachable from the outside via the proxied
// endpoints, etc.).
repeated HostPortPB rpc_proxy_addresses = 7;

// Addresses of this server's embedded web server HTTP/HTTPS endpoints
// advertised at a TCP (HTTP?) proxy. It's assumed the proxy forwards HTTP
// requests from the specified addresses to the addresses specified in the
// 'http_addresses' field.
repeated HostPortPB http_proxy_addresses = 8;

optional string software_version = 3;

// True if HTTPS has been enabled for the web interface.
Expand Down
9 changes: 9 additions & 0 deletions src/Knet.Kudu.Client/Protos/kudu/fs/fs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ message InstanceMetadataPB {
// initialized.
required string format_stamp = 2;

// Encrypted server key used to encrypt/decrypt file keys on this server.
optional string server_key = 3;

// Initialization vector for the server key.
optional string server_key_iv = 4;

// Server key version.
optional string server_key_version = 5;

// TODO: add a "node type" (TS/Master?)
}

Expand Down
77 changes: 76 additions & 1 deletion src/Knet.Kudu.Client/Protos/kudu/master/master.proto
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ message MasterErrorPB {

// Master is already part of the Raft configuration.
MASTER_ALREADY_PRESENT = 15;

// The requested table is in soft_deleted state.
TABLE_SOFT_DELETED = 16;
}

// The error code.
Expand Down Expand Up @@ -130,6 +133,7 @@ message SysTabletsEntryPB {
RUNNING = 2;
REPLACED = 3;
DELETED = 4;
SOFT_DELETED = 5;
}

// DEPRECATED. Replaced by 'partition'.
Expand All @@ -152,6 +156,9 @@ message SysTabletsEntryPB {
// The dimension label for the tablet. Used for dimension-specific
// placement of the tablet's replicas.
optional string dimension_label = 8;

// The delete time of the tablet, in seconds since the epoch.
optional int64 delete_timestamp = 9;
}

// The on-disk entry in the sys.catalog table ("metadata" column) for
Expand All @@ -163,6 +170,7 @@ message SysTablesEntryPB {
RUNNING = 2;
ALTERING = 3;
REMOVED = 4;
SOFT_DELETED = 5;
}

// Table name
Expand Down Expand Up @@ -216,6 +224,12 @@ message SysTablesEntryPB {

// The comment on the table.
optional string comment = 17;

// The delete time of the table, in seconds since the epoch.
optional int64 delete_timestamp = 18;

// The reservation time interval (in seconds) between soft delete and delete.
optional uint32 soft_deleted_reserved_seconds = 19;
}

// The on-disk entry in the sys.catalog table ("metadata" column) to represent
Expand Down Expand Up @@ -571,13 +585,34 @@ message DeleteTableRequestPB {
// Whether to apply the deletion to external catalogs, such as the Hive Metastore,
// which the Kudu master has been configured to integrate with.
optional bool modify_external_catalogs = 2 [default = true];

// Reserve seconds after the table has been deleted.
// If this field is specified by the client, means the request coming from a newer Kudu
// client with the precise value for 'reserve_seconds', and the field's value from the request
// should be taken as-is regardless of the current setting of the '--default_deleted_table_reserve_seconds'
// flag at the server side.
// Otherwise, the behavior of DeleteRPC is controlled by the '--default_deleted_table_reserve_seconds' flag.
optional uint32 reserve_seconds = 3;
}

message DeleteTableResponsePB {
// The error, if an error occurred with this request.
optional MasterErrorPB error = 1;
}

message RecallDeletedTableRequestPB {
required TableIdentifierPB table = 1;

// If this field is set, that's the name for the recalled table.
// Otherwise, the recalled table will use the original table name.
optional string new_table_name = 2;
}

message RecallDeletedTableResponsePB {
// The error, if an error occurred with this request.
optional MasterErrorPB error = 1;
}

message ListTablesRequestPB {
// When used, only returns tables that satisfy a substring match on name_filter.
optional string name_filter = 1;
Expand All @@ -586,18 +621,33 @@ message ListTablesRequestPB {
// interpreted as if it were set to [TableTypePB::DEFAULT_TABLE], meaning
// to include only user-defined tables.
repeated TableTypePB type_filter = 2;

// Set this field 'true' to include information on the partition backed by
// each tablet in the result list.
optional bool list_tablet_with_partition = 3 [default = false];

// Use to select the tables type for display.
// Only show regular tables if false.
// Only show soft_deleted tables if true.
optional bool show_soft_deleted = 4;
}

message ListTablesResponsePB {
// The error, if an error occurred with this request.
optional MasterErrorPB error = 1;

message TabletWithPartition {
optional string tablet_id = 1;
optional PartitionPB partition = 2;
}

message TableInfo {
required bytes id = 1;
required string name = 2;
optional uint64 live_row_count = 3;
optional int32 num_tablets = 4;
optional int32 num_replicas = 5;
repeated TabletWithPartition tablet_with_partition = 6;
}

repeated TableInfo tables = 2;
Expand Down Expand Up @@ -687,7 +737,7 @@ message GetTableLocationsResponsePB {

// If the client caches table locations, the entries should not live longer
// than this timeout. Defaults to one hour.
optional uint32 ttl_millis = 3 [default = 36000000];
optional uint32 ttl_millis = 3 [default = 3600000];
}

message AlterTableRequestPB {
Expand Down Expand Up @@ -720,13 +770,26 @@ message AlterTableRequestPB {
optional ColumnSchemaDeltaPB delta = 1;
}
message AddRangePartition {
// A structure to define range-specific hash schema. This separate type
// exists to distinguish from an empty hash schema (i.e. no hash bucketing)
// and the absence of range-specific hash schema when a range partition
// uses the table-wide hash schema instead. Otherwise, using a field of
// repeated HashBucketSchemaPB wouldn't allow to tell between those cases.
message CustomHashSchema {
repeated PartitionSchemaPB.HashBucketSchemaPB hash_schema = 1;
}

// A set of row operations containing the lower and upper range bound for
// the range partition to add or drop.
optional RowOperationsPB range_bounds = 1;

// The dimension label for the tablet. Used for dimension-specific placement
// of the tablet's replicas.
optional string dimension_label = 2;

// The custom hash partition schema for the range, if specified. If absent,
// the range uses table-wide hash schema.
optional CustomHashSchema custom_hash_schema = 3;
}
message DropRangePartition {
// A set of row operations containing the lower and upper range bound for
Expand Down Expand Up @@ -1108,6 +1171,14 @@ enum MasterFeatures {
// Though this is technically a tserver feature, it's unreasonable to check if every
// tablet server supports this feature. Instead we use the master as a proxy.
IGNORE_OPERATIONS = 7;
// Whether master supports tables with range-specific hash schemas.
RANGE_SPECIFIC_HASH_SCHEMA = 8;
// Similar to IGNORE_OPERATIONS, but this is for UPSERT_IGNORE specifically.
UPSERT_IGNORE = 9;
// Whether master supports immutable attribute on column schema.
IMMUTABLE_COLUMN_ATTRIBUTE = 10;
// Whether master supports auto incrementing column.
AUTO_INCREMENTING_COLUMN = 11;
}

service MasterService {
Expand Down Expand Up @@ -1144,6 +1215,10 @@ service MasterService {
option (kudu.rpc.authz_method) = "AuthorizeClient";
}

rpc RecallDeletedTable(RecallDeletedTableRequestPB) returns (RecallDeletedTableResponsePB) {
option (kudu.rpc.authz_method) = "AuthorizeClient";
}

rpc AlterTable(AlterTableRequestPB) returns (AlterTableResponsePB) {
option (kudu.rpc.authz_method) = "AuthorizeClientOrServiceUser";
}
Expand Down
14 changes: 14 additions & 0 deletions src/Knet.Kudu.Client/Protos/kudu/rpc/rpc_header.proto
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ message AuthenticationTypePB {
message Sasl {};
message Token {};
message Certificate {};
message Jwt {};

oneof type {
// The server and client mutually authenticate via SASL.
Expand All @@ -117,6 +118,11 @@ message AuthenticationTypePB {
//
// Certificate authentication requires the connection to be TLS encrypted.
Certificate certificate = 3;

// The server authenticates the client via a JSON web token.
//
// Requires the connection to be TLS encrypted.
Jwt jwt = 4;
}
}

Expand All @@ -131,6 +137,7 @@ message NegotiatePB {
SASL_RESPONSE = 4;
TLS_HANDSHAKE = 5;
TOKEN_EXCHANGE = 6;
JWT_EXCHANGE = 7;
}

message SaslMechanism {
Expand Down Expand Up @@ -186,6 +193,10 @@ message NegotiatePB {

// During the TOKEN_EXCHANGE step, contains the client's signed authentication token.
optional security.SignedTokenPB authn_token = 8;

// During the JWT_EXCHANGE step, contains the client's JWT used for
// authentication.
optional security.JwtRawPB jwt_raw = 10;
}

message RemoteMethodPB {
Expand Down Expand Up @@ -337,6 +348,9 @@ message ErrorStatusPB {
// negotiation failed, and the client should obtain a new authn token and
// try to reconnect.
FATAL_INVALID_AUTHENTICATION_TOKEN = 16;

// The JWT is invalid or expired.
FATAL_INVALID_JWT = 18;
}

required string message = 1;
Expand Down
5 changes: 5 additions & 0 deletions src/Knet.Kudu.Client/Protos/kudu/security/token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ message TokenPB {
}
};

// JSON Web Token: a wrapper to pass around a JWT as is.
message JwtRawPB {
optional bytes jwt_data = 1;
}

message SignedTokenPB {
// The actual token data. This is a serialized TokenPB protobuf. However, we use a
// 'bytes' field, since protobuf doesn't guarantee that if two implementations serialize
Expand Down
Loading

0 comments on commit 53dc03f

Please sign in to comment.