From a6b72021f7245f43cdf4917afd485b474c6b81c0 Mon Sep 17 00:00:00 2001 From: quettabit Date: Tue, 2 Sep 2025 23:58:00 -0600 Subject: [PATCH] initial commit --- protos | 2 +- src/streamstore/_lib/s2/v1alpha/s2_pb2.py | 70 +++++++++++----------- src/streamstore/_lib/s2/v1alpha/s2_pb2.pyi | 9 ++- src/streamstore/_mappers.py | 23 +++++-- src/streamstore/schemas.py | 12 ++-- tests/test_account_ops.py | 8 +-- tests/test_basin_ops.py | 18 ++++-- 7 files changed, 88 insertions(+), 54 deletions(-) diff --git a/protos b/protos index 6a21125..8babbd6 160000 --- a/protos +++ b/protos @@ -1 +1 @@ -Subproject commit 6a21125d2dc74776d6d248a3351da46d65f9ea5a +Subproject commit 8babbd68f20829b8ec92bbe4864a3f020782bd5c diff --git a/src/streamstore/_lib/s2/v1alpha/s2_pb2.py b/src/streamstore/_lib/s2/v1alpha/s2_pb2.py index e5a2179..5f3d685 100644 --- a/src/streamstore/_lib/s2/v1alpha/s2_pb2.py +++ b/src/streamstore/_lib/s2/v1alpha/s2_pb2.py @@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x13s2/v1alpha/s2.proto\x12\ns2.v1alpha\x1a google/protobuf/field_mask.proto"V\n\x11ListBasinsRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\x13\n\x0bstart_after\x18\x02 \x01(\t\x12\x12\n\x05limit\x18\x03 \x01(\x04H\x00\x88\x01\x01\x42\x08\n\x06_limit"M\n\x12ListBasinsResponse\x12%\n\x06\x62\x61sins\x18\x01 \x03(\x0b\x32\x15.s2.v1alpha.BasinInfo\x12\x10\n\x08has_more\x18\x02 \x01(\x08"s\n\x12\x43reateBasinRequest\x12\r\n\x05\x62\x61sin\x18\x01 \x01(\t\x12\'\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.s2.v1alpha.BasinConfig\x12%\n\x05scope\x18\x03 \x01(\x0e\x32\x16.s2.v1alpha.BasinScope":\n\x13\x43reateBasinResponse\x12#\n\x04info\x18\x01 \x01(\x0b\x32\x15.s2.v1alpha.BasinInfo"#\n\x12\x44\x65leteBasinRequest\x12\r\n\x05\x62\x61sin\x18\x01 \x01(\t"\x15\n\x13\x44\x65leteBasinResponse"&\n\x15GetBasinConfigRequest\x12\r\n\x05\x62\x61sin\x18\x01 \x01(\t"A\n\x16GetBasinConfigResponse\x12\'\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x17.s2.v1alpha.BasinConfig"{\n\x17ReconfigureBasinRequest\x12\r\n\x05\x62\x61sin\x18\x01 \x01(\t\x12\'\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.s2.v1alpha.BasinConfig\x12(\n\x04mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"C\n\x18ReconfigureBasinResponse\x12\'\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x17.s2.v1alpha.BasinConfig"D\n\x17IssueAccessTokenRequest\x12)\n\x04info\x18\x01 \x01(\x0b\x32\x1b.s2.v1alpha.AccessTokenInfo"3\n\x14ReadWritePermissions\x12\x0c\n\x04read\x18\x01 \x01(\x08\x12\r\n\x05write\x18\x02 \x01(\x08"\xb0\x01\n\x18PermittedOperationGroups\x12\x31\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32 .s2.v1alpha.ReadWritePermissions\x12/\n\x05\x62\x61sin\x18\x02 \x01(\x0b\x32 .s2.v1alpha.ReadWritePermissions\x12\x30\n\x06stream\x18\x03 \x01(\x0b\x32 .s2.v1alpha.ReadWritePermissions"&\n\x18RevokeAccessTokenRequest\x12\n\n\x02id\x18\x01 \x01(\t"F\n\x19RevokeAccessTokenResponse\x12)\n\x04info\x18\x01 \x01(\x0b\x32\x1b.s2.v1alpha.AccessTokenInfo"\\\n\x17ListAccessTokensRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\x13\n\x0bstart_after\x18\x02 \x01(\t\x12\x12\n\x05limit\x18\x03 \x01(\x04H\x00\x88\x01\x01\x42\x08\n\x06_limit"`\n\x18ListAccessTokensResponse\x12\x32\n\raccess_tokens\x18\x01 \x03(\x0b\x32\x1b.s2.v1alpha.AccessTokenInfo\x12\x10\n\x08has_more\x18\x02 \x01(\x08"\x8f\x01\n\x0f\x41\x63\x63\x65ssTokenInfo\x12\n\n\x02id\x18\x01 \x01(\t\x12\x17\n\nexpires_at\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1b\n\x13\x61uto_prefix_streams\x18\x03 \x01(\x08\x12+\n\x05scope\x18\x04 \x01(\x0b\x32\x1c.s2.v1alpha.AccessTokenScopeB\r\n\x0b_expires_at"\xf2\x01\n\x10\x41\x63\x63\x65ssTokenScope\x12\'\n\x06\x62\x61sins\x18\x01 \x01(\x0b\x32\x17.s2.v1alpha.ResourceSet\x12(\n\x07streams\x18\x02 \x01(\x0b\x32\x17.s2.v1alpha.ResourceSet\x12.\n\raccess_tokens\x18\x03 \x01(\x0b\x32\x17.s2.v1alpha.ResourceSet\x12\x37\n\top_groups\x18\x04 \x01(\x0b\x32$.s2.v1alpha.PermittedOperationGroups\x12"\n\x03ops\x18\x05 \x03(\x0e\x32\x15.s2.v1alpha.Operation"<\n\x0bResourceSet\x12\x0f\n\x05\x65xact\x18\x01 \x01(\tH\x00\x12\x10\n\x06prefix\x18\x02 \x01(\tH\x00\x42\n\n\x08matching"0\n\x18IssueAccessTokenResponse\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x01 \x01(\t"V\n\nStreamInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ncreated_at\x18\x02 \x01(\r\x12\x17\n\ndeleted_at\x18\x03 \x01(\rH\x00\x88\x01\x01\x42\r\n\x0b_deleted_at"W\n\x12ListStreamsRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\x13\n\x0bstart_after\x18\x02 \x01(\t\x12\x12\n\x05limit\x18\x03 \x01(\x04H\x00\x88\x01\x01\x42\x08\n\x06_limit"P\n\x13ListStreamsResponse\x12\'\n\x07streams\x18\x01 \x03(\x0b\x32\x16.s2.v1alpha.StreamInfo\x12\x10\n\x08has_more\x18\x02 \x01(\x08"O\n\x13\x43reateStreamRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t\x12(\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x18.s2.v1alpha.StreamConfig"<\n\x14\x43reateStreamResponse\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.s2.v1alpha.StreamInfo"%\n\x13\x44\x65leteStreamRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t"\x16\n\x14\x44\x65leteStreamResponse"(\n\x16GetStreamConfigRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t"C\n\x17GetStreamConfigResponse\x12(\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x18.s2.v1alpha.StreamConfig"~\n\x18ReconfigureStreamRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t\x12(\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x18.s2.v1alpha.StreamConfig\x12(\n\x04mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"E\n\x19ReconfigureStreamResponse\x12(\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x18.s2.v1alpha.StreamConfig""\n\x10\x43heckTailRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t"A\n\x11\x43heckTailResponse\x12\x14\n\x0cnext_seq_num\x18\x01 \x01(\x04\x12\x16\n\x0elast_timestamp\x18\x02 \x01(\x04"\xa4\x01\n\x0b\x41ppendInput\x12\x0e\n\x06stream\x18\x01 \x01(\t\x12)\n\x07records\x18\x02 \x03(\x0b\x32\x18.s2.v1alpha.AppendRecord\x12\x1a\n\rmatch_seq_num\x18\x03 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rfencing_token\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x10\n\x0e_match_seq_numB\x10\n\x0e_fencing_token"\x98\x01\n\x0c\x41ppendOutput\x12\x15\n\rstart_seq_num\x18\x01 \x01(\x04\x12\x17\n\x0fstart_timestamp\x18\x04 \x01(\x04\x12\x13\n\x0b\x65nd_seq_num\x18\x02 \x01(\x04\x12\x15\n\rend_timestamp\x18\x05 \x01(\x04\x12\x14\n\x0cnext_seq_num\x18\x03 \x01(\x04\x12\x16\n\x0elast_timestamp\x18\x06 \x01(\x04"7\n\rAppendRequest\x12&\n\x05input\x18\x01 \x01(\x0b\x32\x17.s2.v1alpha.AppendInput":\n\x0e\x41ppendResponse\x12(\n\x06output\x18\x01 \x01(\x0b\x32\x18.s2.v1alpha.AppendOutput">\n\x14\x41ppendSessionRequest\x12&\n\x05input\x18\x01 \x01(\x0b\x32\x17.s2.v1alpha.AppendInput"A\n\x15\x41ppendSessionResponse\x12(\n\x06output\x18\x01 \x01(\x0b\x32\x18.s2.v1alpha.AppendOutput"g\n\nReadOutput\x12\x31\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32 .s2.v1alpha.SequencedRecordBatchH\x00\x12\x16\n\x0cnext_seq_num\x18\x03 \x01(\x04H\x00\x42\x08\n\x06outputJ\x04\x08\x02\x10\x03"\xb8\x01\n\x0bReadRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t\x12\x11\n\x07seq_num\x18\x02 \x01(\x04H\x00\x12\x13\n\ttimestamp\x18\x04 \x01(\x04H\x00\x12\x15\n\x0btail_offset\x18\x05 \x01(\x04H\x00\x12$\n\x05limit\x18\x03 \x01(\x0b\x32\x15.s2.v1alpha.ReadLimit\x12\x12\n\x05until\x18\x06 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x63lamp\x18\x07 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_until"6\n\x0cReadResponse\x12&\n\x06output\x18\x01 \x01(\x0b\x32\x16.s2.v1alpha.ReadOutput"G\n\tReadLimit\x12\x12\n\x05\x63ount\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x12\n\x05\x62ytes\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x08\n\x06_countB\x08\n\x06_bytes"\xd3\x01\n\x12ReadSessionRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t\x12\x11\n\x07seq_num\x18\x02 \x01(\x04H\x00\x12\x13\n\ttimestamp\x18\x05 \x01(\x04H\x00\x12\x15\n\x0btail_offset\x18\x06 \x01(\x04H\x00\x12$\n\x05limit\x18\x03 \x01(\x0b\x32\x15.s2.v1alpha.ReadLimit\x12\x12\n\nheartbeats\x18\x04 \x01(\x08\x12\x12\n\x05until\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x63lamp\x18\x08 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_until"M\n\x13ReadSessionResponse\x12+\n\x06output\x18\x01 \x01(\x0b\x32\x16.s2.v1alpha.ReadOutputH\x00\x88\x01\x01\x42\t\n\x07_output"\xf3\x02\n\x0cStreamConfig\x12/\n\rstorage_class\x18\x01 \x01(\x0e\x32\x18.s2.v1alpha.StorageClass\x12\r\n\x03\x61ge\x18\x02 \x01(\x04H\x00\x12;\n\x0ctimestamping\x18\x05 \x01(\x0b\x32%.s2.v1alpha.StreamConfig.Timestamping\x12?\n\x0f\x64\x65lete_on_empty\x18\x06 \x01(\x0b\x32&.s2.v1alpha.StreamConfig.DeleteOnEmpty\x1a^\n\x0cTimestamping\x12*\n\x04mode\x18\x01 \x01(\x0e\x32\x1c.s2.v1alpha.TimestampingMode\x12\x15\n\x08uncapped\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x0b\n\t_uncapped\x1a%\n\rDeleteOnEmpty\x12\x14\n\x0cmin_age_secs\x18\x01 \x01(\x04\x42\x12\n\x10retention_policyJ\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05"\x86\x01\n\x0b\x42\x61sinConfig\x12\x37\n\x15\x64\x65\x66\x61ult_stream_config\x18\x01 \x01(\x0b\x32\x18.s2.v1alpha.StreamConfig\x12\x1f\n\x17\x63reate_stream_on_append\x18\x02 \x01(\x08\x12\x1d\n\x15\x63reate_stream_on_read\x18\x03 \x01(\x08"g\n\tBasinInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x05scope\x18\x05 \x01(\x0e\x32\x16.s2.v1alpha.BasinScope\x12%\n\x05state\x18\x04 \x01(\x0e\x32\x16.s2.v1alpha.BasinState"%\n\x06Header\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\r\n\x05value\x18\x02 \x01(\x0c"g\n\x0c\x41ppendRecord\x12\x16\n\ttimestamp\x18\x03 \x01(\x04H\x00\x88\x01\x01\x12#\n\x07headers\x18\x01 \x03(\x0b\x32\x12.s2.v1alpha.Header\x12\x0c\n\x04\x62ody\x18\x02 \x01(\x0c\x42\x0c\n\n_timestamp"h\n\x0fSequencedRecord\x12\x0f\n\x07seq_num\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x04 \x01(\x04\x12#\n\x07headers\x18\x02 \x03(\x0b\x32\x12.s2.v1alpha.Header\x12\x0c\n\x04\x62ody\x18\x03 \x01(\x0c"D\n\x14SequencedRecordBatch\x12,\n\x07records\x18\x01 \x03(\x0b\x32\x1b.s2.v1alpha.SequencedRecord*H\n\nBasinScope\x12\x1b\n\x17\x42\x41SIN_SCOPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x42\x41SIN_SCOPE_AWS_US_EAST_1\x10\x01*\x81\x05\n\tOperation\x12\x19\n\x15OPERATION_UNSPECIFIED\x10\x00\x12\x19\n\x15OPERATION_LIST_BASINS\x10\x01\x12\x1a\n\x16OPERATION_CREATE_BASIN\x10\x02\x12\x1a\n\x16OPERATION_DELETE_BASIN\x10\x03\x12\x1f\n\x1bOPERATION_RECONFIGURE_BASIN\x10\x04\x12\x1e\n\x1aOPERATION_GET_BASIN_CONFIG\x10\x05\x12 \n\x1cOPERATION_ISSUE_ACCESS_TOKEN\x10\x06\x12!\n\x1dOPERATION_REVOKE_ACCESS_TOKEN\x10\x07\x12 \n\x1cOPERATION_LIST_ACCESS_TOKENS\x10\x08\x12\x1a\n\x16OPERATION_LIST_STREAMS\x10\t\x12\x1b\n\x17OPERATION_CREATE_STREAM\x10\n\x12\x1b\n\x17OPERATION_DELETE_STREAM\x10\x0b\x12\x1f\n\x1bOPERATION_GET_STREAM_CONFIG\x10\x0c\x12 \n\x1cOPERATION_RECONFIGURE_STREAM\x10\r\x12\x18\n\x14OPERATION_CHECK_TAIL\x10\x0e\x12\x14\n\x10OPERATION_APPEND\x10\x0f\x12\x12\n\x0eOPERATION_READ\x10\x10\x12\x12\n\x0eOPERATION_TRIM\x10\x11\x12\x13\n\x0fOPERATION_FENCE\x10\x12\x12\x1d\n\x19OPERATION_ACCOUNT_METRICS\x10\x13\x12\x1b\n\x17OPERATION_BASIN_METRICS\x10\x14\x12\x1c\n\x18OPERATION_STREAM_METRICS\x10\x15*d\n\x0cStorageClass\x12\x1d\n\x19STORAGE_CLASS_UNSPECIFIED\x10\x00\x12\x1a\n\x16STORAGE_CLASS_STANDARD\x10\x01\x12\x19\n\x15STORAGE_CLASS_EXPRESS\x10\x02*\x9f\x01\n\x10TimestampingMode\x12!\n\x1dTIMESTAMPING_MODE_UNSPECIFIED\x10\x00\x12#\n\x1fTIMESTAMPING_MODE_CLIENT_PREFER\x10\x01\x12$\n TIMESTAMPING_MODE_CLIENT_REQUIRE\x10\x02\x12\x1d\n\x19TIMESTAMPING_MODE_ARRIVAL\x10\x03*u\n\nBasinState\x12\x1b\n\x17\x42\x41SIN_STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x42\x41SIN_STATE_ACTIVE\x10\x01\x12\x18\n\x14\x42\x41SIN_STATE_CREATING\x10\x02\x12\x18\n\x14\x42\x41SIN_STATE_DELETING\x10\x03\x32\xf8\x05\n\x0e\x41\x63\x63ountService\x12P\n\nListBasins\x12\x1d.s2.v1alpha.ListBasinsRequest\x1a\x1e.s2.v1alpha.ListBasinsResponse"\x03\x90\x02\x01\x12S\n\x0b\x43reateBasin\x12\x1e.s2.v1alpha.CreateBasinRequest\x1a\x1f.s2.v1alpha.CreateBasinResponse"\x03\x90\x02\x02\x12S\n\x0b\x44\x65leteBasin\x12\x1e.s2.v1alpha.DeleteBasinRequest\x1a\x1f.s2.v1alpha.DeleteBasinResponse"\x03\x90\x02\x02\x12\x62\n\x10ReconfigureBasin\x12#.s2.v1alpha.ReconfigureBasinRequest\x1a$.s2.v1alpha.ReconfigureBasinResponse"\x03\x90\x02\x02\x12\\\n\x0eGetBasinConfig\x12!.s2.v1alpha.GetBasinConfigRequest\x1a".s2.v1alpha.GetBasinConfigResponse"\x03\x90\x02\x01\x12]\n\x10IssueAccessToken\x12#.s2.v1alpha.IssueAccessTokenRequest\x1a$.s2.v1alpha.IssueAccessTokenResponse\x12\x65\n\x11RevokeAccessToken\x12$.s2.v1alpha.RevokeAccessTokenRequest\x1a%.s2.v1alpha.RevokeAccessTokenResponse"\x03\x90\x02\x02\x12\x62\n\x10ListAccessTokens\x12#.s2.v1alpha.ListAccessTokensRequest\x1a$.s2.v1alpha.ListAccessTokensResponse"\x03\x90\x02\x01\x32\xdb\x03\n\x0c\x42\x61sinService\x12S\n\x0bListStreams\x12\x1e.s2.v1alpha.ListStreamsRequest\x1a\x1f.s2.v1alpha.ListStreamsResponse"\x03\x90\x02\x01\x12V\n\x0c\x43reateStream\x12\x1f.s2.v1alpha.CreateStreamRequest\x1a .s2.v1alpha.CreateStreamResponse"\x03\x90\x02\x02\x12V\n\x0c\x44\x65leteStream\x12\x1f.s2.v1alpha.DeleteStreamRequest\x1a .s2.v1alpha.DeleteStreamResponse"\x03\x90\x02\x02\x12_\n\x0fGetStreamConfig\x12".s2.v1alpha.GetStreamConfigRequest\x1a#.s2.v1alpha.GetStreamConfigResponse"\x03\x90\x02\x01\x12\x65\n\x11ReconfigureStream\x12$.s2.v1alpha.ReconfigureStreamRequest\x1a%.s2.v1alpha.ReconfigureStreamResponse"\x03\x90\x02\x02\x32\x90\x03\n\rStreamService\x12M\n\tCheckTail\x12\x1c.s2.v1alpha.CheckTailRequest\x1a\x1d.s2.v1alpha.CheckTailResponse"\x03\x90\x02\x01\x12?\n\x06\x41ppend\x12\x19.s2.v1alpha.AppendRequest\x1a\x1a.s2.v1alpha.AppendResponse\x12X\n\rAppendSession\x12 .s2.v1alpha.AppendSessionRequest\x1a!.s2.v1alpha.AppendSessionResponse(\x01\x30\x01\x12>\n\x04Read\x12\x17.s2.v1alpha.ReadRequest\x1a\x18.s2.v1alpha.ReadResponse"\x03\x90\x02\x01\x12U\n\x0bReadSession\x12\x1e.s2.v1alpha.ReadSessionRequest\x1a\x1f.s2.v1alpha.ReadSessionResponse"\x03\x90\x02\x01\x30\x01\x42\x0e\n\ns2.v1alphaP\x01\x62\x06proto3' + b'\n\x13s2/v1alpha/s2.proto\x12\ns2.v1alpha\x1a google/protobuf/field_mask.proto"V\n\x11ListBasinsRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\x13\n\x0bstart_after\x18\x02 \x01(\t\x12\x12\n\x05limit\x18\x03 \x01(\x04H\x00\x88\x01\x01\x42\x08\n\x06_limit"M\n\x12ListBasinsResponse\x12%\n\x06\x62\x61sins\x18\x01 \x03(\x0b\x32\x15.s2.v1alpha.BasinInfo\x12\x10\n\x08has_more\x18\x02 \x01(\x08"s\n\x12\x43reateBasinRequest\x12\r\n\x05\x62\x61sin\x18\x01 \x01(\t\x12\'\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.s2.v1alpha.BasinConfig\x12%\n\x05scope\x18\x03 \x01(\x0e\x32\x16.s2.v1alpha.BasinScope":\n\x13\x43reateBasinResponse\x12#\n\x04info\x18\x01 \x01(\x0b\x32\x15.s2.v1alpha.BasinInfo"#\n\x12\x44\x65leteBasinRequest\x12\r\n\x05\x62\x61sin\x18\x01 \x01(\t"\x15\n\x13\x44\x65leteBasinResponse"&\n\x15GetBasinConfigRequest\x12\r\n\x05\x62\x61sin\x18\x01 \x01(\t"A\n\x16GetBasinConfigResponse\x12\'\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x17.s2.v1alpha.BasinConfig"{\n\x17ReconfigureBasinRequest\x12\r\n\x05\x62\x61sin\x18\x01 \x01(\t\x12\'\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.s2.v1alpha.BasinConfig\x12(\n\x04mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"C\n\x18ReconfigureBasinResponse\x12\'\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x17.s2.v1alpha.BasinConfig"D\n\x17IssueAccessTokenRequest\x12)\n\x04info\x18\x01 \x01(\x0b\x32\x1b.s2.v1alpha.AccessTokenInfo"3\n\x14ReadWritePermissions\x12\x0c\n\x04read\x18\x01 \x01(\x08\x12\r\n\x05write\x18\x02 \x01(\x08"\xb0\x01\n\x18PermittedOperationGroups\x12\x31\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32 .s2.v1alpha.ReadWritePermissions\x12/\n\x05\x62\x61sin\x18\x02 \x01(\x0b\x32 .s2.v1alpha.ReadWritePermissions\x12\x30\n\x06stream\x18\x03 \x01(\x0b\x32 .s2.v1alpha.ReadWritePermissions"&\n\x18RevokeAccessTokenRequest\x12\n\n\x02id\x18\x01 \x01(\t"F\n\x19RevokeAccessTokenResponse\x12)\n\x04info\x18\x01 \x01(\x0b\x32\x1b.s2.v1alpha.AccessTokenInfo"\\\n\x17ListAccessTokensRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\x13\n\x0bstart_after\x18\x02 \x01(\t\x12\x12\n\x05limit\x18\x03 \x01(\x04H\x00\x88\x01\x01\x42\x08\n\x06_limit"`\n\x18ListAccessTokensResponse\x12\x32\n\raccess_tokens\x18\x01 \x03(\x0b\x32\x1b.s2.v1alpha.AccessTokenInfo\x12\x10\n\x08has_more\x18\x02 \x01(\x08"\x8f\x01\n\x0f\x41\x63\x63\x65ssTokenInfo\x12\n\n\x02id\x18\x01 \x01(\t\x12\x17\n\nexpires_at\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1b\n\x13\x61uto_prefix_streams\x18\x03 \x01(\x08\x12+\n\x05scope\x18\x04 \x01(\x0b\x32\x1c.s2.v1alpha.AccessTokenScopeB\r\n\x0b_expires_at"\xf2\x01\n\x10\x41\x63\x63\x65ssTokenScope\x12\'\n\x06\x62\x61sins\x18\x01 \x01(\x0b\x32\x17.s2.v1alpha.ResourceSet\x12(\n\x07streams\x18\x02 \x01(\x0b\x32\x17.s2.v1alpha.ResourceSet\x12.\n\raccess_tokens\x18\x03 \x01(\x0b\x32\x17.s2.v1alpha.ResourceSet\x12\x37\n\top_groups\x18\x04 \x01(\x0b\x32$.s2.v1alpha.PermittedOperationGroups\x12"\n\x03ops\x18\x05 \x03(\x0e\x32\x15.s2.v1alpha.Operation"<\n\x0bResourceSet\x12\x0f\n\x05\x65xact\x18\x01 \x01(\tH\x00\x12\x10\n\x06prefix\x18\x02 \x01(\tH\x00\x42\n\n\x08matching"0\n\x18IssueAccessTokenResponse\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x01 \x01(\t"V\n\nStreamInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ncreated_at\x18\x02 \x01(\r\x12\x17\n\ndeleted_at\x18\x03 \x01(\rH\x00\x88\x01\x01\x42\r\n\x0b_deleted_at"W\n\x12ListStreamsRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\x13\n\x0bstart_after\x18\x02 \x01(\t\x12\x12\n\x05limit\x18\x03 \x01(\x04H\x00\x88\x01\x01\x42\x08\n\x06_limit"P\n\x13ListStreamsResponse\x12\'\n\x07streams\x18\x01 \x03(\x0b\x32\x16.s2.v1alpha.StreamInfo\x12\x10\n\x08has_more\x18\x02 \x01(\x08"O\n\x13\x43reateStreamRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t\x12(\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x18.s2.v1alpha.StreamConfig"<\n\x14\x43reateStreamResponse\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.s2.v1alpha.StreamInfo"%\n\x13\x44\x65leteStreamRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t"\x16\n\x14\x44\x65leteStreamResponse"(\n\x16GetStreamConfigRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t"C\n\x17GetStreamConfigResponse\x12(\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x18.s2.v1alpha.StreamConfig"~\n\x18ReconfigureStreamRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t\x12(\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x18.s2.v1alpha.StreamConfig\x12(\n\x04mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"E\n\x19ReconfigureStreamResponse\x12(\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x18.s2.v1alpha.StreamConfig""\n\x10\x43heckTailRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t"A\n\x11\x43heckTailResponse\x12\x14\n\x0cnext_seq_num\x18\x01 \x01(\x04\x12\x16\n\x0elast_timestamp\x18\x02 \x01(\x04"\xa4\x01\n\x0b\x41ppendInput\x12\x0e\n\x06stream\x18\x01 \x01(\t\x12)\n\x07records\x18\x02 \x03(\x0b\x32\x18.s2.v1alpha.AppendRecord\x12\x1a\n\rmatch_seq_num\x18\x03 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rfencing_token\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x10\n\x0e_match_seq_numB\x10\n\x0e_fencing_token"\x98\x01\n\x0c\x41ppendOutput\x12\x15\n\rstart_seq_num\x18\x01 \x01(\x04\x12\x17\n\x0fstart_timestamp\x18\x04 \x01(\x04\x12\x13\n\x0b\x65nd_seq_num\x18\x02 \x01(\x04\x12\x15\n\rend_timestamp\x18\x05 \x01(\x04\x12\x14\n\x0cnext_seq_num\x18\x03 \x01(\x04\x12\x16\n\x0elast_timestamp\x18\x06 \x01(\x04"7\n\rAppendRequest\x12&\n\x05input\x18\x01 \x01(\x0b\x32\x17.s2.v1alpha.AppendInput":\n\x0e\x41ppendResponse\x12(\n\x06output\x18\x01 \x01(\x0b\x32\x18.s2.v1alpha.AppendOutput">\n\x14\x41ppendSessionRequest\x12&\n\x05input\x18\x01 \x01(\x0b\x32\x17.s2.v1alpha.AppendInput"A\n\x15\x41ppendSessionResponse\x12(\n\x06output\x18\x01 \x01(\x0b\x32\x18.s2.v1alpha.AppendOutput"g\n\nReadOutput\x12\x31\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32 .s2.v1alpha.SequencedRecordBatchH\x00\x12\x16\n\x0cnext_seq_num\x18\x03 \x01(\x04H\x00\x42\x08\n\x06outputJ\x04\x08\x02\x10\x03"\xb8\x01\n\x0bReadRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t\x12\x11\n\x07seq_num\x18\x02 \x01(\x04H\x00\x12\x13\n\ttimestamp\x18\x04 \x01(\x04H\x00\x12\x15\n\x0btail_offset\x18\x05 \x01(\x04H\x00\x12$\n\x05limit\x18\x03 \x01(\x0b\x32\x15.s2.v1alpha.ReadLimit\x12\x12\n\x05until\x18\x06 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x63lamp\x18\x07 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_until"6\n\x0cReadResponse\x12&\n\x06output\x18\x01 \x01(\x0b\x32\x16.s2.v1alpha.ReadOutput"G\n\tReadLimit\x12\x12\n\x05\x63ount\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x12\n\x05\x62ytes\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x08\n\x06_countB\x08\n\x06_bytes"\xd3\x01\n\x12ReadSessionRequest\x12\x0e\n\x06stream\x18\x01 \x01(\t\x12\x11\n\x07seq_num\x18\x02 \x01(\x04H\x00\x12\x13\n\ttimestamp\x18\x05 \x01(\x04H\x00\x12\x15\n\x0btail_offset\x18\x06 \x01(\x04H\x00\x12$\n\x05limit\x18\x03 \x01(\x0b\x32\x15.s2.v1alpha.ReadLimit\x12\x12\n\nheartbeats\x18\x04 \x01(\x08\x12\x12\n\x05until\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x63lamp\x18\x08 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_until"M\n\x13ReadSessionResponse\x12+\n\x06output\x18\x01 \x01(\x0b\x32\x16.s2.v1alpha.ReadOutputH\x00\x88\x01\x01\x42\t\n\x07_output"\xc8\x03\n\x0cStreamConfig\x12/\n\rstorage_class\x18\x01 \x01(\x0e\x32\x18.s2.v1alpha.StorageClass\x12\r\n\x03\x61ge\x18\x02 \x01(\x04H\x00\x12>\n\x08infinite\x18\x07 \x01(\x0b\x32*.s2.v1alpha.StreamConfig.InfiniteRetentionH\x00\x12;\n\x0ctimestamping\x18\x05 \x01(\x0b\x32%.s2.v1alpha.StreamConfig.Timestamping\x12?\n\x0f\x64\x65lete_on_empty\x18\x06 \x01(\x0b\x32&.s2.v1alpha.StreamConfig.DeleteOnEmpty\x1a^\n\x0cTimestamping\x12*\n\x04mode\x18\x01 \x01(\x0e\x32\x1c.s2.v1alpha.TimestampingMode\x12\x15\n\x08uncapped\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x0b\n\t_uncapped\x1a%\n\rDeleteOnEmpty\x12\x14\n\x0cmin_age_secs\x18\x01 \x01(\x04\x1a\x13\n\x11InfiniteRetentionB\x12\n\x10retention_policyJ\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05"\x86\x01\n\x0b\x42\x61sinConfig\x12\x37\n\x15\x64\x65\x66\x61ult_stream_config\x18\x01 \x01(\x0b\x32\x18.s2.v1alpha.StreamConfig\x12\x1f\n\x17\x63reate_stream_on_append\x18\x02 \x01(\x08\x12\x1d\n\x15\x63reate_stream_on_read\x18\x03 \x01(\x08"g\n\tBasinInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x05scope\x18\x05 \x01(\x0e\x32\x16.s2.v1alpha.BasinScope\x12%\n\x05state\x18\x04 \x01(\x0e\x32\x16.s2.v1alpha.BasinState"%\n\x06Header\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\r\n\x05value\x18\x02 \x01(\x0c"g\n\x0c\x41ppendRecord\x12\x16\n\ttimestamp\x18\x03 \x01(\x04H\x00\x88\x01\x01\x12#\n\x07headers\x18\x01 \x03(\x0b\x32\x12.s2.v1alpha.Header\x12\x0c\n\x04\x62ody\x18\x02 \x01(\x0c\x42\x0c\n\n_timestamp"h\n\x0fSequencedRecord\x12\x0f\n\x07seq_num\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x04 \x01(\x04\x12#\n\x07headers\x18\x02 \x03(\x0b\x32\x12.s2.v1alpha.Header\x12\x0c\n\x04\x62ody\x18\x03 \x01(\x0c"D\n\x14SequencedRecordBatch\x12,\n\x07records\x18\x01 \x03(\x0b\x32\x1b.s2.v1alpha.SequencedRecord*H\n\nBasinScope\x12\x1b\n\x17\x42\x41SIN_SCOPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x42\x41SIN_SCOPE_AWS_US_EAST_1\x10\x01*\x81\x05\n\tOperation\x12\x19\n\x15OPERATION_UNSPECIFIED\x10\x00\x12\x19\n\x15OPERATION_LIST_BASINS\x10\x01\x12\x1a\n\x16OPERATION_CREATE_BASIN\x10\x02\x12\x1a\n\x16OPERATION_DELETE_BASIN\x10\x03\x12\x1f\n\x1bOPERATION_RECONFIGURE_BASIN\x10\x04\x12\x1e\n\x1aOPERATION_GET_BASIN_CONFIG\x10\x05\x12 \n\x1cOPERATION_ISSUE_ACCESS_TOKEN\x10\x06\x12!\n\x1dOPERATION_REVOKE_ACCESS_TOKEN\x10\x07\x12 \n\x1cOPERATION_LIST_ACCESS_TOKENS\x10\x08\x12\x1a\n\x16OPERATION_LIST_STREAMS\x10\t\x12\x1b\n\x17OPERATION_CREATE_STREAM\x10\n\x12\x1b\n\x17OPERATION_DELETE_STREAM\x10\x0b\x12\x1f\n\x1bOPERATION_GET_STREAM_CONFIG\x10\x0c\x12 \n\x1cOPERATION_RECONFIGURE_STREAM\x10\r\x12\x18\n\x14OPERATION_CHECK_TAIL\x10\x0e\x12\x14\n\x10OPERATION_APPEND\x10\x0f\x12\x12\n\x0eOPERATION_READ\x10\x10\x12\x12\n\x0eOPERATION_TRIM\x10\x11\x12\x13\n\x0fOPERATION_FENCE\x10\x12\x12\x1d\n\x19OPERATION_ACCOUNT_METRICS\x10\x13\x12\x1b\n\x17OPERATION_BASIN_METRICS\x10\x14\x12\x1c\n\x18OPERATION_STREAM_METRICS\x10\x15*d\n\x0cStorageClass\x12\x1d\n\x19STORAGE_CLASS_UNSPECIFIED\x10\x00\x12\x1a\n\x16STORAGE_CLASS_STANDARD\x10\x01\x12\x19\n\x15STORAGE_CLASS_EXPRESS\x10\x02*\x9f\x01\n\x10TimestampingMode\x12!\n\x1dTIMESTAMPING_MODE_UNSPECIFIED\x10\x00\x12#\n\x1fTIMESTAMPING_MODE_CLIENT_PREFER\x10\x01\x12$\n TIMESTAMPING_MODE_CLIENT_REQUIRE\x10\x02\x12\x1d\n\x19TIMESTAMPING_MODE_ARRIVAL\x10\x03*u\n\nBasinState\x12\x1b\n\x17\x42\x41SIN_STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x42\x41SIN_STATE_ACTIVE\x10\x01\x12\x18\n\x14\x42\x41SIN_STATE_CREATING\x10\x02\x12\x18\n\x14\x42\x41SIN_STATE_DELETING\x10\x03\x32\xf8\x05\n\x0e\x41\x63\x63ountService\x12P\n\nListBasins\x12\x1d.s2.v1alpha.ListBasinsRequest\x1a\x1e.s2.v1alpha.ListBasinsResponse"\x03\x90\x02\x01\x12S\n\x0b\x43reateBasin\x12\x1e.s2.v1alpha.CreateBasinRequest\x1a\x1f.s2.v1alpha.CreateBasinResponse"\x03\x90\x02\x02\x12S\n\x0b\x44\x65leteBasin\x12\x1e.s2.v1alpha.DeleteBasinRequest\x1a\x1f.s2.v1alpha.DeleteBasinResponse"\x03\x90\x02\x02\x12\x62\n\x10ReconfigureBasin\x12#.s2.v1alpha.ReconfigureBasinRequest\x1a$.s2.v1alpha.ReconfigureBasinResponse"\x03\x90\x02\x02\x12\\\n\x0eGetBasinConfig\x12!.s2.v1alpha.GetBasinConfigRequest\x1a".s2.v1alpha.GetBasinConfigResponse"\x03\x90\x02\x01\x12]\n\x10IssueAccessToken\x12#.s2.v1alpha.IssueAccessTokenRequest\x1a$.s2.v1alpha.IssueAccessTokenResponse\x12\x65\n\x11RevokeAccessToken\x12$.s2.v1alpha.RevokeAccessTokenRequest\x1a%.s2.v1alpha.RevokeAccessTokenResponse"\x03\x90\x02\x02\x12\x62\n\x10ListAccessTokens\x12#.s2.v1alpha.ListAccessTokensRequest\x1a$.s2.v1alpha.ListAccessTokensResponse"\x03\x90\x02\x01\x32\xdb\x03\n\x0c\x42\x61sinService\x12S\n\x0bListStreams\x12\x1e.s2.v1alpha.ListStreamsRequest\x1a\x1f.s2.v1alpha.ListStreamsResponse"\x03\x90\x02\x01\x12V\n\x0c\x43reateStream\x12\x1f.s2.v1alpha.CreateStreamRequest\x1a .s2.v1alpha.CreateStreamResponse"\x03\x90\x02\x02\x12V\n\x0c\x44\x65leteStream\x12\x1f.s2.v1alpha.DeleteStreamRequest\x1a .s2.v1alpha.DeleteStreamResponse"\x03\x90\x02\x02\x12_\n\x0fGetStreamConfig\x12".s2.v1alpha.GetStreamConfigRequest\x1a#.s2.v1alpha.GetStreamConfigResponse"\x03\x90\x02\x01\x12\x65\n\x11ReconfigureStream\x12$.s2.v1alpha.ReconfigureStreamRequest\x1a%.s2.v1alpha.ReconfigureStreamResponse"\x03\x90\x02\x02\x32\x90\x03\n\rStreamService\x12M\n\tCheckTail\x12\x1c.s2.v1alpha.CheckTailRequest\x1a\x1d.s2.v1alpha.CheckTailResponse"\x03\x90\x02\x01\x12?\n\x06\x41ppend\x12\x19.s2.v1alpha.AppendRequest\x1a\x1a.s2.v1alpha.AppendResponse\x12X\n\rAppendSession\x12 .s2.v1alpha.AppendSessionRequest\x1a!.s2.v1alpha.AppendSessionResponse(\x01\x30\x01\x12>\n\x04Read\x12\x17.s2.v1alpha.ReadRequest\x1a\x18.s2.v1alpha.ReadResponse"\x03\x90\x02\x01\x12U\n\x0bReadSession\x12\x1e.s2.v1alpha.ReadSessionRequest\x1a\x1f.s2.v1alpha.ReadSessionResponse"\x03\x90\x02\x01\x30\x01\x42\x0e\n\ns2.v1alphaP\x01\x62\x06proto3' ) _globals = globals() @@ -97,16 +97,16 @@ _globals["_STREAMSERVICE"].methods_by_name[ "ReadSession" ]._serialized_options = b"\220\002\001" - _globals["_BASINSCOPE"]._serialized_start = 4981 - _globals["_BASINSCOPE"]._serialized_end = 5053 - _globals["_OPERATION"]._serialized_start = 5056 - _globals["_OPERATION"]._serialized_end = 5697 - _globals["_STORAGECLASS"]._serialized_start = 5699 - _globals["_STORAGECLASS"]._serialized_end = 5799 - _globals["_TIMESTAMPINGMODE"]._serialized_start = 5802 - _globals["_TIMESTAMPINGMODE"]._serialized_end = 5961 - _globals["_BASINSTATE"]._serialized_start = 5963 - _globals["_BASINSTATE"]._serialized_end = 6080 + _globals["_BASINSCOPE"]._serialized_start = 5066 + _globals["_BASINSCOPE"]._serialized_end = 5138 + _globals["_OPERATION"]._serialized_start = 5141 + _globals["_OPERATION"]._serialized_end = 5782 + _globals["_STORAGECLASS"]._serialized_start = 5784 + _globals["_STORAGECLASS"]._serialized_end = 5884 + _globals["_TIMESTAMPINGMODE"]._serialized_start = 5887 + _globals["_TIMESTAMPINGMODE"]._serialized_end = 6046 + _globals["_BASINSTATE"]._serialized_start = 6048 + _globals["_BASINSTATE"]._serialized_end = 6165 _globals["_LISTBASINSREQUEST"]._serialized_start = 69 _globals["_LISTBASINSREQUEST"]._serialized_end = 155 _globals["_LISTBASINSRESPONSE"]._serialized_start = 157 @@ -200,27 +200,29 @@ _globals["_READSESSIONRESPONSE"]._serialized_start = 3966 _globals["_READSESSIONRESPONSE"]._serialized_end = 4043 _globals["_STREAMCONFIG"]._serialized_start = 4046 - _globals["_STREAMCONFIG"]._serialized_end = 4417 - _globals["_STREAMCONFIG_TIMESTAMPING"]._serialized_start = 4252 - _globals["_STREAMCONFIG_TIMESTAMPING"]._serialized_end = 4346 - _globals["_STREAMCONFIG_DELETEONEMPTY"]._serialized_start = 4348 - _globals["_STREAMCONFIG_DELETEONEMPTY"]._serialized_end = 4385 - _globals["_BASINCONFIG"]._serialized_start = 4420 - _globals["_BASINCONFIG"]._serialized_end = 4554 - _globals["_BASININFO"]._serialized_start = 4556 - _globals["_BASININFO"]._serialized_end = 4659 - _globals["_HEADER"]._serialized_start = 4661 - _globals["_HEADER"]._serialized_end = 4698 - _globals["_APPENDRECORD"]._serialized_start = 4700 - _globals["_APPENDRECORD"]._serialized_end = 4803 - _globals["_SEQUENCEDRECORD"]._serialized_start = 4805 - _globals["_SEQUENCEDRECORD"]._serialized_end = 4909 - _globals["_SEQUENCEDRECORDBATCH"]._serialized_start = 4911 - _globals["_SEQUENCEDRECORDBATCH"]._serialized_end = 4979 - _globals["_ACCOUNTSERVICE"]._serialized_start = 6083 - _globals["_ACCOUNTSERVICE"]._serialized_end = 6843 - _globals["_BASINSERVICE"]._serialized_start = 6846 - _globals["_BASINSERVICE"]._serialized_end = 7321 - _globals["_STREAMSERVICE"]._serialized_start = 7324 - _globals["_STREAMSERVICE"]._serialized_end = 7724 + _globals["_STREAMCONFIG"]._serialized_end = 4502 + _globals["_STREAMCONFIG_TIMESTAMPING"]._serialized_start = 4316 + _globals["_STREAMCONFIG_TIMESTAMPING"]._serialized_end = 4410 + _globals["_STREAMCONFIG_DELETEONEMPTY"]._serialized_start = 4412 + _globals["_STREAMCONFIG_DELETEONEMPTY"]._serialized_end = 4449 + _globals["_STREAMCONFIG_INFINITERETENTION"]._serialized_start = 4451 + _globals["_STREAMCONFIG_INFINITERETENTION"]._serialized_end = 4470 + _globals["_BASINCONFIG"]._serialized_start = 4505 + _globals["_BASINCONFIG"]._serialized_end = 4639 + _globals["_BASININFO"]._serialized_start = 4641 + _globals["_BASININFO"]._serialized_end = 4744 + _globals["_HEADER"]._serialized_start = 4746 + _globals["_HEADER"]._serialized_end = 4783 + _globals["_APPENDRECORD"]._serialized_start = 4785 + _globals["_APPENDRECORD"]._serialized_end = 4888 + _globals["_SEQUENCEDRECORD"]._serialized_start = 4890 + _globals["_SEQUENCEDRECORD"]._serialized_end = 4994 + _globals["_SEQUENCEDRECORDBATCH"]._serialized_start = 4996 + _globals["_SEQUENCEDRECORDBATCH"]._serialized_end = 5064 + _globals["_ACCOUNTSERVICE"]._serialized_start = 6168 + _globals["_ACCOUNTSERVICE"]._serialized_end = 6928 + _globals["_BASINSERVICE"]._serialized_start = 6931 + _globals["_BASINSERVICE"]._serialized_end = 7406 + _globals["_STREAMSERVICE"]._serialized_start = 7409 + _globals["_STREAMSERVICE"]._serialized_end = 7809 # @@protoc_insertion_point(module_scope) diff --git a/src/streamstore/_lib/s2/v1alpha/s2_pb2.pyi b/src/streamstore/_lib/s2/v1alpha/s2_pb2.pyi index 90c0c35..c77b8fa 100644 --- a/src/streamstore/_lib/s2/v1alpha/s2_pb2.pyi +++ b/src/streamstore/_lib/s2/v1alpha/s2_pb2.pyi @@ -637,7 +637,7 @@ class ReadSessionResponse(_message.Message): ) -> None: ... class StreamConfig(_message.Message): - __slots__ = ("storage_class", "age", "timestamping", "delete_on_empty") + __slots__ = ("storage_class", "age", "infinite", "timestamping", "delete_on_empty") class Timestamping(_message.Message): __slots__ = ("mode", "uncapped") MODE_FIELD_NUMBER: _ClassVar[int] @@ -656,18 +656,25 @@ class StreamConfig(_message.Message): min_age_secs: int def __init__(self, min_age_secs: _Optional[int] = ...) -> None: ... + class InfiniteRetention(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + STORAGE_CLASS_FIELD_NUMBER: _ClassVar[int] AGE_FIELD_NUMBER: _ClassVar[int] + INFINITE_FIELD_NUMBER: _ClassVar[int] TIMESTAMPING_FIELD_NUMBER: _ClassVar[int] DELETE_ON_EMPTY_FIELD_NUMBER: _ClassVar[int] storage_class: StorageClass age: int + infinite: StreamConfig.InfiniteRetention timestamping: StreamConfig.Timestamping delete_on_empty: StreamConfig.DeleteOnEmpty def __init__( self, storage_class: _Optional[_Union[StorageClass, str]] = ..., age: _Optional[int] = ..., + infinite: _Optional[_Union[StreamConfig.InfiniteRetention, _Mapping]] = ..., timestamping: _Optional[_Union[StreamConfig.Timestamping, _Mapping]] = ..., delete_on_empty: _Optional[_Union[StreamConfig.DeleteOnEmpty, _Mapping]] = ..., ) -> None: ... diff --git a/src/streamstore/_mappers.py b/src/streamstore/_mappers.py index 46336b8..0a97393 100644 --- a/src/streamstore/_mappers.py +++ b/src/streamstore/_mappers.py @@ -1,5 +1,5 @@ from datetime import datetime -from typing import cast +from typing import Literal, cast from google.protobuf.internal.containers import RepeatedCompositeFieldContainer @@ -127,15 +127,18 @@ def stream_config_message( stream_config = msgs.StreamConfig() if config: storage_class = config.storage_class - retention_age = config.retention_age + retention_policy = config.retention_policy timestamping = config.timestamping delete_on_empty_min_age = config.delete_on_empty_min_age if storage_class is not None: paths.append(f"{mask_path_prefix}storage_class") stream_config.storage_class = storage_class.value - if retention_age is not None: + if retention_policy is not None: paths.append(f"{mask_path_prefix}retention_policy") - stream_config.age = retention_age + if retention_policy == "infinite": + stream_config.infinite.CopyFrom(msgs.StreamConfig.InfiniteRetention()) + else: + stream_config.age = retention_policy if timestamping is not None: paths.append(f"{mask_path_prefix}timestamping") if timestamping.mode is not None: @@ -183,9 +186,19 @@ def basin_config_message( def stream_config_schema(config: msgs.StreamConfig) -> StreamConfig: + retention_policy: int | Literal["infinite"] + match config.WhichOneof("retention_policy"): + case "age": + retention_policy = config.age + case "infinite": + retention_policy = "infinite" + case _: + raise RuntimeError( + "StreamConfig retention_policy doesn't match any of the expected values" + ) return StreamConfig( StorageClass(config.storage_class), - config.age, + retention_policy, Timestamping( mode=TimestampingMode(config.timestamping.mode), uncapped=config.timestamping.uncapped, diff --git a/src/streamstore/schemas.py b/src/streamstore/schemas.py index 7bf1597..34ad5ee 100644 --- a/src/streamstore/schemas.py +++ b/src/streamstore/schemas.py @@ -35,7 +35,7 @@ from dataclasses import dataclass, field from datetime import datetime from enum import Enum -from typing import Generic, TypeVar +from typing import Generic, Literal, TypeVar from streamstore._exceptions import fallible @@ -294,13 +294,15 @@ class StreamConfig: #: #: If not specified, the default is :attr:`.StorageClass.EXPRESS`. storage_class: StorageClass | None = None - #: Age in seconds for automatic trimming of records older than this threshold. + #: Retention policy for records in this stream. #: - #: If not specified, the default is to retain records for 7 days. + #: Retention duration in seconds to automatically trim records older than this duration. #: - #: If set to ``0``, the stream will have infinite retention. + #: ``'infinite'`` to retain records indefinitely. #: (While S2 is in public preview, this is capped at 28 days. Let us know if you'd like the cap removed.) - retention_age: int | None = None + #: + #: If not specified, the default is to retain records for 7 days. + retention_policy: int | Literal["infinite"] | None = None #: Timestamping behavior for appends to this stream, which influences how timestamps are handled. timestamping: Timestamping | None = None #: Minimum age in seconds before this stream can be automatically deleted if empty. diff --git a/tests/test_account_ops.py b/tests/test_account_ops.py index 506ff06..230a657 100644 --- a/tests/test_account_ops.py +++ b/tests/test_account_ops.py @@ -36,7 +36,7 @@ async def test_create_basin_with_config(self, s2: S2, basin_name: str): config = BasinConfig( default_stream_config=StreamConfig( storage_class=StorageClass.STANDARD, - retention_age=86400 * 7, + retention_policy=86400 * 7, timestamping=Timestamping( mode=TimestampingMode.CLIENT_REQUIRE, uncapped=True, @@ -60,7 +60,7 @@ async def test_reconfigure_basin(self, s2: S2, basin: Basin): config = BasinConfig( default_stream_config=StreamConfig( storage_class=StorageClass.STANDARD, - retention_age=3600, + retention_policy=3600, ), create_stream_on_append=True, ) @@ -73,8 +73,8 @@ async def test_reconfigure_basin(self, s2: S2, basin: Basin): == config.default_stream_config.storage_class ) assert ( - updated_config.default_stream_config.retention_age - == config.default_stream_config.retention_age + updated_config.default_stream_config.retention_policy + == config.default_stream_config.retention_policy ) assert updated_config.create_stream_on_append == config.create_stream_on_append diff --git a/tests/test_basin_ops.py b/tests/test_basin_ops.py index 2e3c59a..aabb6ee 100644 --- a/tests/test_basin_ops.py +++ b/tests/test_basin_ops.py @@ -30,7 +30,7 @@ async def test_create_stream_with_config( config = StreamConfig( storage_class=StorageClass.STANDARD, - retention_age=86400 * 3, + retention_policy=86400 * 3, timestamping=Timestamping( mode=TimestampingMode.ARRIVAL, uncapped=False, @@ -53,14 +53,13 @@ async def test_default_stream_config(self, shared_basin: Basin, stream: Stream): config = await basin.get_stream_config(stream.name) assert config.storage_class == StorageClass.EXPRESS - assert config.retention_age == 86400 * 7 + assert config.retention_policy == 86400 * 7 async def test_reconfigure_stream(self, shared_basin: Basin, stream: Stream): basin = shared_basin - config = StreamConfig( storage_class=StorageClass.STANDARD, - retention_age=86400 * 21, + retention_policy="infinite", timestamping=Timestamping( mode=TimestampingMode.CLIENT_REQUIRE, uncapped=True ), @@ -70,6 +69,17 @@ async def test_reconfigure_stream(self, shared_basin: Basin, stream: Stream): updated_config = await basin.reconfigure_stream(stream.name, config) assert updated_config == config + config = StreamConfig( + storage_class=StorageClass.EXPRESS, + retention_policy=86400 * 90, + timestamping=Timestamping( + mode=TimestampingMode.CLIENT_PREFER, uncapped=False + ), + delete_on_empty_min_age=3600, + ) + updated_config = await basin.reconfigure_stream(stream.name, config) + assert updated_config == config + async def test_list_streams(self, shared_basin: Basin, stream_names: list[str]): basin = shared_basin