Skip to content

Sync sdks 12 #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/ydb-cpp-sdk/client/table/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ bool operator!=(const TChangefeedDescription& lhs, const TChangefeedDescription&
struct TPartitionStats {
uint64_t Rows = 0;
uint64_t Size = 0;
uint32_t LeaderNodeId = 0;
};

class TDateTypeColumnModeSettings {
Expand Down Expand Up @@ -1643,6 +1644,7 @@ struct TDescribeTableSettings : public TOperationRequestSettings<TDescribeTableS
FLUENT_SETTING_DEFAULT(bool, WithTableStatistics, false);
FLUENT_SETTING_DEFAULT(bool, WithPartitionStatistics, false);
FLUENT_SETTING_DEFAULT(bool, WithSetVal, false);
FLUENT_SETTING_DEFAULT(bool, WithShardNodesInfo, false);
};

struct TExplainDataQuerySettings : public TOperationRequestSettings<TExplainDataQuerySettings> {
Expand Down
4 changes: 2 additions & 2 deletions include/ydb-cpp-sdk/client/topic/read_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,12 @@ struct TReadSessionEvent {
TEndPartitionSessionEvent(TPartitionSession::TPtr partitionSession, std::vector<uint32_t>&& adjacentPartitionIds, std::vector<uint32_t>&& childPartitionIds);

//! A list of the partition IDs that also participated in the partition's merge.
const std::vector<uint32_t> GetAdjacentPartitionIds() const {
const std::vector<uint32_t>& GetAdjacentPartitionIds() const {
return AdjacentPartitionIds;
}

//! A list of partition IDs that were obtained as a result of merging or splitting this partition.
const std::vector<uint32_t> GetChildPartitionIds() const {
const std::vector<uint32_t>& GetChildPartitionIds() const {
return ChildPartitionIds;
}

Expand Down
5 changes: 0 additions & 5 deletions src/api/README.md

This file was deleted.

12 changes: 6 additions & 6 deletions src/api/client/yc_private/iam/service_account_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "google/api/annotations.proto";
import "google/protobuf/field_mask.proto";
import "src/api/client/yc_private/iam/iam_token.proto";
import "src/api/client/yc_private/iam/service_account.proto";
//import "src/api/client/yc_private/access/access.proto";
//import "ydb/public/api/client/yc_private/access/access.proto";
import "src/api/client/yc_private/operation/operation.proto";
import "src/api/client/yc_private/iam/reference.proto";

Expand All @@ -19,15 +19,15 @@ service ServiceAccountService {
option (google.api.http) = { get: "/iam/v1/serviceAccounts" };
}

rpc Create (CreateServiceAccountRequest) returns (ydb.yc.priv.operation.Operation) {
rpc Create (CreateServiceAccountRequest) returns (.ydb.yc.priv.operation.Operation) {
option (google.api.http) = { post: "/iam/v1/serviceAccounts" body: "*" };
}

rpc Update (UpdateServiceAccountRequest) returns (ydb.yc.priv.operation.Operation) {
rpc Update (UpdateServiceAccountRequest) returns (.ydb.yc.priv.operation.Operation) {
option (google.api.http) = { patch: "/iam/v1/serviceAccounts/{service_account_id}" body: "*" };
}

rpc Delete (DeleteServiceAccountRequest) returns (ydb.yc.priv.operation.Operation) {
rpc Delete (DeleteServiceAccountRequest) returns (.ydb.yc.priv.operation.Operation) {
option (google.api.http) = { delete: "/iam/v1/serviceAccounts/{service_account_id}" };
}

Expand All @@ -43,7 +43,7 @@ service ServiceAccountService {

rpc ListReferences (ListServiceAccountReferencesRequest) returns (ListServiceAccountReferencesResponse);

rpc UpdateReferences (UpdateServiceAccountReferencesRequest) returns (ydb.yc.priv.operation.Operation);
rpc UpdateReferences (UpdateServiceAccountReferencesRequest) returns (.ydb.yc.priv.operation.Operation);
}

message GetServiceAccountRequest {
Expand Down Expand Up @@ -104,7 +104,7 @@ message ListServiceAccountOperationsRequest {
}

message ListServiceAccountOperationsResponse {
repeated ydb.yc.priv.operation.Operation operations = 1;
repeated .ydb.yc.priv.operation.Operation operations = 1;
string next_page_token = 2;
}

Expand Down
2 changes: 1 addition & 1 deletion src/api/client/yc_private/iam/user_account_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ service UserAccountService {
option (google.api.http) = { get: "/iam/v1/userAccounts/{user_account_id}" };
}

rpc Delete (DeleteUserAccountRequest) returns (ydb.yc.priv.operation.Operation);
rpc Delete (DeleteUserAccountRequest) returns (.ydb.yc.priv.operation.Operation);

rpc GetSettings (GetSettingsRequest) returns (UserSettings);

Expand Down
3 changes: 0 additions & 3 deletions src/api/client/yc_public/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/api/grpc/ydb_query_v1.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "src/api/protos/ydb_operation.proto";
import "src/api/protos/ydb_query.proto";

service QueryService {
// Sessions are basic primitives for communicating with YDB Query Service. The are similar to
// Sessions are basic primitives for communicating with YDB Query Service. They are similar to
// connections for classic relational DBs. Sessions serve three main purposes:
// 1. Provide a flow control for DB requests with limited number of active channels.
// 2. Distribute load evenly across multiple DB nodes.
Expand Down
5 changes: 5 additions & 0 deletions src/api/protos/draft/fq.proto
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ message ResultSetMeta {
bool truncated = 3;
}

message QueryTimeline {
string svg = 1; // No validation because generated on server side
}

message Query {
QueryMeta meta = 1;
QueryContent content = 2;
Expand All @@ -214,6 +218,7 @@ message Query {
QueryStatistics statistics = 6;
repeated ResultSetMeta result_set_meta = 7;
QueryAst ast = 8;
QueryTimeline timeline = 9;
}

message QueryStatistics {
Expand Down
3 changes: 3 additions & 0 deletions src/api/protos/draft/ydb_maintenance.proto
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,15 @@ message ActionState {
ACTION_REASON_WRONG_REQUEST = 6;
// Too many unavailable nodes with system tablets.
ACTION_REASON_SYS_TABLETS_NODE_LIMIT_REACHED = 7;
// Generic reason.
ACTION_REASON_GENERIC = 8;
}

Action action = 1;
ActionUid action_uid = 2;
ActionStatus status = 3;
ActionReason reason = 4;
string reason_details = 6;
google.protobuf.Timestamp deadline = 5;
}

Expand Down
18 changes: 9 additions & 9 deletions src/api/protos/draft/ymq.proto
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ message GetQueueAttributesResult {
message GetQueueUrlRequest {
Ydb.Operations.OperationParams operation_params = 1;
string queue_name = 2;
optional string queue_owner_aws_account_id = 3;
optional string queue_owner_a_w_s_account_id = 3;
}

message GetQueueUrlResponse {
Expand Down Expand Up @@ -194,8 +194,8 @@ message ReceiveMessageResponse {
message Message {
map<string, string> attributes = 1;
string body = 2;
string md5_of_body = 3;
string md5_of_message_attributes = 4;
string m_d_5_of_body = 3 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
string m_d_5_of_message_attributes = 4 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
map<string, MessageAttribute> message_attributes = 5;
string message_id = 6;
string receipt_handle = 7;
Expand All @@ -221,9 +221,9 @@ message SendMessageResponse {
}

message SendMessageResult {
string md5_of_message_attributes = 1;
string md5_of_message_body= 2;
string md5_of_message_system_attributes= 3;
string m_d_5_of_message_attributes = 1 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
string m_d_5_of_message_body= 2 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
string m_d_5_of_message_system_attributes= 3 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
string message_id = 4;
string sequence_number = 5;
}
Expand All @@ -248,10 +248,10 @@ message SendMessageBatchRequestEntry {

message SendMessageBatchResultEntry {
string id = 1;
string md5_of_message_body = 2;
string m_d_5_of_message_body = 2 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
string message_id = 3;
string md5_of_message_attributes = 4;
string md5_of_message_system_attributes = 5;
string m_d_5_of_message_attributes = 4 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
string m_d_5_of_message_system_attributes = 5 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
string sequence_number = 6;
}

Expand Down
4 changes: 2 additions & 2 deletions src/api/protos/ydb_import.proto
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ message ImportDataRequest {
// - sorted by primary key;
// - all keys must be from the same partition;
// - table has no global secondary indexes;
// - size of serialized data is limited to 8 MB.
bytes data = 3 [(length).le = 8388608];
// - size of serialized data is limited to 16 MB.
bytes data = 3 [(length).le = 16777216];
oneof format {
// Result of `ydb tools dump`
YdbDumpFormat ydb_dump = 4;
Expand Down
2 changes: 1 addition & 1 deletion src/api/protos/ydb_issue_message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ message IssueMessage {
string message = 2;
Position end_position = 3;
uint32 issue_code = 4;
// Severity values from src/library/yql_common/issue/protos/issue_severity.proto
// Severity values from ydb/library/yql/public/issue/protos/issue_severity.proto
// FATAL = 0;
// ERROR = 1;
// WARNING = 2;
Expand Down
11 changes: 6 additions & 5 deletions src/api/protos/ydb_scheme.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ package Ydb.Scheme;
option java_package = "com.yandex.ydb.scheme";
option java_outer_classname = "SchemeOperationProtos";

import "src/api/protos/annotations/validation.proto";
import "src/api/protos/ydb_common.proto";
import "src/api/protos/ydb_operation.proto";

// Create directory.
// All intermediate directories must be created
message MakeDirectoryRequest {
Ydb.Operations.OperationParams operation_params = 1;
string path = 2;
string path = 2 [(required) = true];
}

message MakeDirectoryResponse {
Expand All @@ -22,7 +23,7 @@ message MakeDirectoryResponse {
// Remove directory
message RemoveDirectoryRequest {
Ydb.Operations.OperationParams operation_params = 1;
string path = 2;
string path = 2 [(required) = true];
}

message RemoveDirectoryResponse {
Expand All @@ -32,7 +33,7 @@ message RemoveDirectoryResponse {
// List directory
message ListDirectoryRequest {
Ydb.Operations.OperationParams operation_params = 1;
string path = 2;
string path = 2 [(required) = true];
}

message ListDirectoryResponse {
Expand Down Expand Up @@ -93,7 +94,7 @@ message ListDirectoryResult {
// Returns information about object with given path
message DescribePathRequest {
Ydb.Operations.OperationParams operation_params = 1;
string path = 2;
string path = 2 [(required) = true];
}

message DescribePathResponse {
Expand Down Expand Up @@ -121,7 +122,7 @@ message PermissionsAction {
// Modify permissions of given object
message ModifyPermissionsRequest {
Ydb.Operations.OperationParams operation_params = 1;
string path = 2;
string path = 2 [(required) = true];
repeated PermissionsAction actions = 3;
// Clear all permissions on the object for all subjects
bool clear_permissions = 4;
Expand Down
8 changes: 8 additions & 0 deletions src/api/protos/ydb_table.proto
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ message PartitionStats {
uint64 rows_estimate = 1;
// Approximate size of shard (bytes)
uint64 store_size = 2;
// id of node that serve shard key range
uint32 leader_node_id = 3;
}

message TableStats {
Expand Down Expand Up @@ -531,6 +533,10 @@ message ColumnFamily {
// When enabled table data will be kept in memory
// WARNING: DO NOT USE
Ydb.FeatureFlag.Status keep_in_memory = 4;

// Not all compression algorithms support
// Set if want to change default value
optional int32 compression_level = 5;
}

message PartitioningSettings {
Expand Down Expand Up @@ -783,6 +789,8 @@ message DescribeTableRequest {
bool include_partition_stats = 7;
// Includes set_val settings for sequences
bool include_set_val = 8;
// Includes shard -> node id maping (required include_partition_stats)
bool include_shard_nodes_info = 9;
}

message DescribeTableResponse {
Expand Down
3 changes: 0 additions & 3 deletions src/client/persqueue_public/impl/write_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ class TSimpleBlockingWriteSession : public ISimpleBlockingWriteSession {

private:
std::optional<TContinuationToken> WaitForToken(const TDuration& timeout);
void HandleAck(TWriteSessionEvent::TAcksEvent&);
void HandleReady(TWriteSessionEvent::TReadyToAcceptEvent&);
void HandleClosed(const TSessionClosedEvent&);

std::atomic_bool Closed = false;
};
Expand Down
4 changes: 4 additions & 0 deletions src/client/table/impl/table_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ TAsyncDescribeTableResult TTableClient::TImpl::DescribeTable(const std::string&
request.set_include_set_val(true);
}

if (settings.WithShardNodesInfo_) {
request.set_include_shard_nodes_info(true);
}

auto promise = NewPromise<TDescribeTableResult>();

auto extractor = [promise, settings]
Expand Down
2 changes: 1 addition & 1 deletion src/client/table/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ class TTableDescription::TImpl {

for (const auto& shardStats : Proto_.table_stats().partition_stats()) {
PartitionStats_.emplace_back(
TPartitionStats{shardStats.rows_estimate(), shardStats.store_size()}
TPartitionStats{shardStats.rows_estimate(), shardStats.store_size(), shardStats.leader_node_id()}
);
}

Expand Down
3 changes: 0 additions & 3 deletions src/client/topic/impl/write_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ class TSimpleBlockingWriteSession : public ISimpleBlockingWriteSession {

private:
std::optional<TContinuationToken> WaitForToken(const TDuration& timeout);
void HandleAck(TWriteSessionEvent::TAcksEvent&);
void HandleReady(TWriteSessionEvent::TReadyToAcceptEvent&);
void HandleClosed(const TSessionClosedEvent&);

std::atomic_bool Closed = false;
};
Expand Down
4 changes: 1 addition & 3 deletions src/client/topic/ut/basic_usage_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ Y_UNIT_TEST_SUITE(BasicUsage) {
bool res = session->Write(message);
UNIT_ASSERT(res);
}
bool res = session->Close(TDuration::Seconds(10));
bool res = session->Close(TDuration::Seconds(30));
UNIT_ASSERT(res);

std::shared_ptr<NYdb::NTopic::IReadSession> ReadSession;
Expand Down Expand Up @@ -659,8 +659,6 @@ Y_UNIT_TEST_SUITE(BasicUsage) {
Cerr << ">>> TEST: Session gracefully closed" << Endl;

Sleep(TDuration::Seconds(5));

// UNIT_ASSERT(false);
}

Y_UNIT_TEST(ConflictingWrites) {
Expand Down
Loading
Loading