Skip to content

Commit 266d63c

Browse files
Moved commit "New SQS Json API: 10 requests supported" from ydb repo
1 parent bb19ffd commit 266d63c

File tree

8 files changed

+543
-31
lines changed

8 files changed

+543
-31
lines changed

src/api/grpc/draft/ydb_ymq_v1.proto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
syntax = "proto3";
2+
option cc_enable_arenas = true;
3+
4+
package Ydb.Ymq.V1;
5+
6+
import "src/api/protos/draft/ymq.proto";
7+
8+
option java_package = "com.yandex.ydb.ymq.v1";
9+
10+
service YmqService {
11+
rpc GetQueueUrl(GetQueueUrlRequest) returns (GetQueueUrlResponse);
12+
rpc CreateQueue(CreateQueueRequest) returns (CreateQueueResponse);
13+
rpc SendMessage(SendMessageRequest) returns (SendMessageResponse);
14+
rpc ReceiveMessage(ReceiveMessageRequest) returns (ReceiveMessageResponse);
15+
rpc GetQueueAttributes(GetQueueAttributesRequest) returns (GetQueueAttributesResponse);
16+
rpc ListQueues(ListQueuesRequest) returns (ListQueuesResponse);
17+
rpc DeleteMessage(DeleteMessageRequest) returns (DeleteMessageResponse);
18+
rpc PurgeQueue(PurgeQueueRequest) returns (PurgeQueueResponse);
19+
rpc DeleteQueue(DeleteQueueRequest) returns (DeleteQueueResponse);
20+
rpc ChangeMessageVisibility(ChangeMessageVisibilityRequest) returns (ChangeMessageVisibilityResponse);
21+
}

src/api/protos/draft/datastreams.proto

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,13 @@ syntax = "proto3";
22
option cc_enable_arenas = true;
33

44
import "src/api/protos/ydb_operation.proto";
5+
import "src/api/protos/draft/field_transformation.proto";
56

67
import "google/protobuf/descriptor.proto";
78

89
package Ydb.DataStreams.V1;
910
option java_package = "com.yandex.ydb.datastreams.v1";
1011

11-
// Extensions to simplify json <-> proto conversion
12-
enum EFieldTransformationType {
13-
TRANSFORM_NONE = 0;
14-
TRANSFORM_BASE64 = 1;
15-
TRANSFORM_DOUBLE_S_TO_INT_MS = 2;
16-
TRANSFORM_EMPTY_TO_NOTHING = 3;
17-
}
18-
19-
20-
extend google.protobuf.FieldOptions {
21-
EFieldTransformationType FieldTransformer = 58123;
22-
}
23-
2412
// Here and below: Kinesis data types mapped to protobuf
2513

2614
enum EncryptionType {
@@ -53,7 +41,7 @@ message ChildShard {
5341
// Represents details of consumer
5442
message Consumer {
5543
string consumer_arn = 1;
56-
int64 consumer_creation_timestamp = 2 [(FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
44+
int64 consumer_creation_timestamp = 2 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
5745
string consumer_name = 3;
5846
ConsumerDescription.ConsumerStatus consumer_status = 4;
5947
}
@@ -66,9 +54,9 @@ message HashKeyRange {
6654

6755
message Record {
6856
// Timestamp that the record was inserted into the stream
69-
int64 approximate_arrival_timestamp = 1 [(FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
57+
int64 approximate_arrival_timestamp = 1 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
7058
// Data blob
71-
bytes data = 2 [(FieldTransformer) = TRANSFORM_BASE64];
59+
bytes data = 2 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_BASE64];
7260
// Encryption type used on record
7361
EncryptionType encryption_type = 3;
7462
// Identifies shard in the stream the record is assigned to
@@ -108,7 +96,7 @@ message StreamDescription {
10896
repeated Shard shards = 6;
10997
string stream_arn = 7;
11098
// Timestamp that the stream was created
111-
int64 stream_creation_timestamp = 8 [(FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
99+
int64 stream_creation_timestamp = 8 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
112100
// Current status of the stream
113101
StreamStatus stream_status = 9;
114102
// Name of the stream
@@ -127,17 +115,17 @@ message StreamDescription {
127115
// Represents range of possible sequence numbers for the shard
128116
message SequenceNumberRange {
129117
string starting_sequence_number = 1;
130-
string ending_sequence_number = 2 [(FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
118+
string ending_sequence_number = 2 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
131119
}
132120

133121
// Represents shard details
134122
message Shard {
135123
// Id of the shard adjacent to the shard's parent
136-
string adjacent_parent_shard_id = 1 [(FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
124+
string adjacent_parent_shard_id = 1 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
137125
// The range of possible hash key values for the shard
138126
HashKeyRange hash_key_range = 2;
139127
// Id of the shard's parent
140-
string parent_shard_id = 3 [(FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
128+
string parent_shard_id = 3 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
141129
// The range of possible sequence numbers for the shard
142130
SequenceNumberRange sequence_number_range = 4;
143131
// Unique id of the shard within stream
@@ -155,7 +143,7 @@ message ConsumerDescription {
155143

156144
string consumer_arn = 1;
157145
// Timestamp that the consumer was created
158-
int64 consumer_creation_timestamp = 2 [(FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
146+
int64 consumer_creation_timestamp = 2 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
159147
// Name of the consumer
160148
string consumer_name = 3;
161149
ConsumerStatus consumer_status = 4;
@@ -198,14 +186,14 @@ message ShardFilter {
198186
// Exclusive id. Can only be used if AFTER_SHARD_ID is specified
199187
string shard_id = 1;
200188
// Can only be used if AT_TIMESTAMP or FROM_TIMESTAMP are specified.
201-
int64 timestamp = 2 [(FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
189+
int64 timestamp = 2 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
202190
ShardFilterType type = 3;
203191
}
204192

205193
// Represents starting position in the stream from which to start reading
206194
message StartingPosition {
207195
// Timestamp of the record from which to start reading
208-
int64 timestamp = 1 [(FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
196+
int64 timestamp = 1 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
209197
// Sequence number of the record from which to start reading
210198
string sequence_number = 2;
211199
ShardIteratorType type = 3;
@@ -227,7 +215,7 @@ message StreamDescriptionSummary {
227215
// Stream ARN
228216
string stream_arn = 7;
229217
// Timestamp that the stream was created
230-
int64 stream_creation_timestamp = 8 [(FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
218+
int64 stream_creation_timestamp = 8 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
231219
// Name of the stream
232220
string stream_name = 9;
233221
// Current status of the stream
@@ -351,7 +339,7 @@ message ListShardsRequest {
351339
// Filter out response
352340
ShardFilter shard_filter = 5;
353341
// Used to distinguish streams that have the same name
354-
int64 stream_creation_timestamp = 6 [(FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
342+
int64 stream_creation_timestamp = 6 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
355343
// Name of the stream
356344
string stream_name = 7;
357345
}
@@ -417,7 +405,7 @@ message ListStreamConsumersRequest {
417405
string next_token = 3;
418406
string stream_arn = 4;
419407
// Used to distinguish streams that have the same name
420-
int64 stream_creation_timestamp = 5 [(FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
408+
int64 stream_creation_timestamp = 5 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
421409
}
422410

423411
message ListStreamConsumersResponse {
@@ -502,7 +490,7 @@ message DescribeStreamConsumerResult {
502490

503491
message PutRecordsRequestEntry {
504492
// Data blob
505-
bytes data = 1 [(FieldTransformer) = TRANSFORM_BASE64];
493+
bytes data = 1 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_BASE64];
506494
// Hash value used to explicitly determine the shard
507495
string explicit_hash_key = 2;
508496
// Used as input to hash function that maps partition key to a specific shard
@@ -511,8 +499,8 @@ message PutRecordsRequestEntry {
511499

512500
// Represents result of an individual record
513501
message PutRecordsResultEntry {
514-
string error_message = 2 [(FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
515-
string error_code = 3 [(FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
502+
string error_message = 2 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
503+
string error_code = 3 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_EMPTY_TO_NOTHING];
516504
string sequence_number = 4;
517505
string shard_id = 5;
518506
}
@@ -544,7 +532,7 @@ message GetRecordsResult {
544532
message PutRecordRequest {
545533
Ydb.Operations.OperationParams operation_params = 1;
546534
// Data blob
547-
bytes data = 2 [(FieldTransformer) = TRANSFORM_BASE64];
535+
bytes data = 2 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_BASE64];
548536
// Hash value used to explicitly determine the shard
549537
string explicit_hash_key = 3;
550538
// Used as input to hash function that maps partition key to a specific shard
@@ -600,7 +588,7 @@ message GetShardIteratorRequest {
600588
// Name of the stream
601589
string stream_name = 5;
602590
// Used with shard iterator type AT_TIMESTAMP
603-
int64 timestamp = 6 [(FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
591+
int64 timestamp = 6 [(Ydb.FieldTransformation.FieldTransformer) = TRANSFORM_DOUBLE_S_TO_INT_MS];
604592
}
605593

606594
message GetShardIteratorResponse {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
syntax = "proto3";
2+
3+
import "google/protobuf/descriptor.proto";
4+
5+
package Ydb.FieldTransformation;
6+
7+
enum EFieldTransformationType {
8+
TRANSFORM_NONE = 0;
9+
TRANSFORM_BASE64 = 1;
10+
TRANSFORM_DOUBLE_S_TO_INT_MS = 2;
11+
TRANSFORM_EMPTY_TO_NOTHING = 3;
12+
}
13+
14+
extend google.protobuf.FieldOptions {
15+
EFieldTransformationType FieldTransformer = 58123;
16+
}

0 commit comments

Comments
 (0)