Skip to content

Commit e5647cc

Browse files
shikharactions-user
authored andcommitted
sync protos
GitOrigin-RevId: abbede945be34f6dfbb35f67f12e5990f04d4cae
1 parent 09b7c23 commit e5647cc

File tree

3 files changed

+123
-50
lines changed

3 files changed

+123
-50
lines changed

s2/v1/openapi.json

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,14 +1531,10 @@
15311531
},
15321532
"StreamConfig": {
15331533
"type": "object",
1534+
"required": [
1535+
"timestamping"
1536+
],
15341537
"properties": {
1535-
"require_client_timestamps": {
1536-
"type": [
1537-
"boolean",
1538-
"null"
1539-
],
1540-
"description": "Controls how to handle timestamps when they are not provided by the client.\n If this is false (or not set), the record's arrival time in milliseconds since Unix epoch\nwill be assigned as its timestamp. If this is true, then any append without a\nclient-specified timestamp will be rejected as invalid."
1541-
},
15421538
"retention_policy": {
15431539
"oneOf": [
15441540
{
@@ -1557,16 +1553,13 @@
15571553
},
15581554
{
15591555
"$ref": "#/components/schemas/StorageClass",
1560-
"description": "Storage class for recent writes. This is the main cost:performance knob in S2."
1556+
"description": "Storage class for recent writes."
15611557
}
15621558
]
15631559
},
1564-
"uncapped_client_timestamps": {
1565-
"type": [
1566-
"boolean",
1567-
"null"
1568-
],
1569-
"description": "Allow client timestamps to exceed the arrival time in milliseconds since Unix epoch.\nIf this is false (or not set), client timestamps will be capped at the arrival time."
1560+
"timestamping": {
1561+
"$ref": "#/components/schemas/TimestampingConfig",
1562+
"description": "Timestamping behavior."
15701563
}
15711564
}
15721565
},
@@ -1620,14 +1613,10 @@
16201613
},
16211614
"StreamReconfiguration": {
16221615
"type": "object",
1616+
"required": [
1617+
"timestamping"
1618+
],
16231619
"properties": {
1624-
"require_client_timestamps": {
1625-
"type": [
1626-
"boolean",
1627-
"null"
1628-
],
1629-
"description": "Controls how to handle timestamps when they are not provided by the client.\nIf this is false (or not set), the record's arrival time in milliseconds since Unix epoch\nwill be assigned as its timestamp. If this is true, then any append without a\nclient-specified timestamp will be rejected as invalid."
1630-
},
16311620
"retention_policy": {
16321621
"oneOf": [
16331622
{
@@ -1646,16 +1635,67 @@
16461635
},
16471636
{
16481637
"$ref": "#/components/schemas/StorageClass",
1649-
"description": "Storage class for recent writes. This is the main cost:performance knob in S2."
1638+
"description": "Storage class for recent writes."
1639+
}
1640+
]
1641+
},
1642+
"timestamping": {
1643+
"$ref": "#/components/schemas/TimestampingReconfiguration",
1644+
"description": "Timestamping behavior."
1645+
}
1646+
}
1647+
},
1648+
"TimestampingConfig": {
1649+
"type": "object",
1650+
"properties": {
1651+
"mode": {
1652+
"oneOf": [
1653+
{
1654+
"type": "null"
1655+
},
1656+
{
1657+
"$ref": "#/components/schemas/TimestampingMode",
1658+
"description": "Timestamping mode for appends that influences how timestamps are handled."
1659+
}
1660+
]
1661+
},
1662+
"uncapped": {
1663+
"type": [
1664+
"boolean",
1665+
"null"
1666+
],
1667+
"description": "Allow client-specified timestamps to exceed the arrival time.\nIf this is false or not set, client timestamps will be capped at the arrival time."
1668+
}
1669+
}
1670+
},
1671+
"TimestampingMode": {
1672+
"type": "string",
1673+
"enum": [
1674+
"client-prefer",
1675+
"client-require",
1676+
"arrival"
1677+
]
1678+
},
1679+
"TimestampingReconfiguration": {
1680+
"type": "object",
1681+
"properties": {
1682+
"mode": {
1683+
"oneOf": [
1684+
{
1685+
"type": "null"
1686+
},
1687+
{
1688+
"$ref": "#/components/schemas/TimestampingMode",
1689+
"description": "Timestamping mode for appends that influences how timestamps are handled."
16501690
}
16511691
]
16521692
},
1653-
"uncapped_client_timestamps": {
1693+
"uncapped": {
16541694
"type": [
16551695
"boolean",
16561696
"null"
16571697
],
1658-
"description": "Allow client timestamps to exceed the arrival time in milliseconds since Unix epoch.\nIf this is false (or not set), client timestamps will be capped at the arrival time."
1698+
"description": "Allow client-specified timestamps to exceed the arrival time."
16591699
}
16601700
}
16611701
}

s2/v1alpha/openapi.json

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@
13041304
"null"
13051305
],
13061306
"format": "int64",
1307-
"description": "Timestamp for this record.\nThe service will always ensure monotonicity by adjusting it up if necessary to the maximum observed timestamp.\nRefer to the config documentation for `require_client_timestamps` and `uncapped_client_timestamps` to control whether client-specified timestamps are required, and whether they are allowed to exceed the arrival time.",
1307+
"description": "Timestamp for this record.\nPrecise semantics depend on the stream's `timestamping` config.",
13081308
"minimum": 0
13091309
}
13101310
}
@@ -1694,13 +1694,6 @@
16941694
"type": "object",
16951695
"description": "Stream configuration.",
16961696
"properties": {
1697-
"require_client_timestamps": {
1698-
"type": [
1699-
"boolean",
1700-
"null"
1701-
],
1702-
"description": "Controls how to handle timestamps when they are not provided by the client.\nIf this is false (or not set), the record's arrival time in milliseconds since Unix epoch will be assigned as its timestamp.\nIf this is true, then any append without a client-specified timestamp will be rejected as invalid."
1703-
},
17041697
"retention_policy": {
17051698
"oneOf": [
17061699
{
@@ -1714,14 +1707,18 @@
17141707
},
17151708
"storage_class": {
17161709
"$ref": "#/components/schemas/StorageClass",
1717-
"description": "Storage class for recent writes. This is the main cost:performance knob in S2."
1710+
"description": "Storage class for recent writes."
17181711
},
1719-
"uncapped_client_timestamps": {
1720-
"type": [
1721-
"boolean",
1722-
"null"
1723-
],
1724-
"description": "Allow client timestamps to exceed the arrival time in milliseconds since Unix epoch.\nIf this is false (or not set), client timestamps will be capped at the arrival time."
1712+
"timestamping": {
1713+
"oneOf": [
1714+
{
1715+
"type": "null"
1716+
},
1717+
{
1718+
"$ref": "#/components/schemas/Timestamping",
1719+
"description": "Timestamping behavior."
1720+
}
1721+
]
17251722
}
17261723
}
17271724
},
@@ -1753,6 +1750,26 @@
17531750
"description": "Stream name."
17541751
}
17551752
}
1753+
},
1754+
"Timestamping": {
1755+
"type": "object",
1756+
"required": [
1757+
"mode"
1758+
],
1759+
"properties": {
1760+
"mode": {
1761+
"type": "integer",
1762+
"format": "int32",
1763+
"description": "Timestamping mode for appends that influences how timestamps are handled."
1764+
},
1765+
"uncapped": {
1766+
"type": [
1767+
"boolean",
1768+
"null"
1769+
],
1770+
"description": "Allow client-specified timestamps to exceed the arrival time.\nIf this is false or not set, client timestamps will be capped at the arrival time."
1771+
}
1772+
}
17561773
}
17571774
},
17581775
"securitySchemes": {

s2/v1alpha/s2.proto

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -586,17 +586,37 @@ message ReadSessionResponse {
586586

587587
// Storage class for recent writes.
588588
enum StorageClass {
589-
// Unspecified, which is currently overridden to `STORAGE_CLASS_EXPRESS`.
589+
// Defaults to `STORAGE_CLASS_EXPRESS`.
590590
STORAGE_CLASS_UNSPECIFIED = 0;
591591
// Standard, which offers end-to-end latencies under 500 ms.
592592
STORAGE_CLASS_STANDARD = 1;
593593
// Express, which offers end-to-end latencies under 50 ms.
594594
STORAGE_CLASS_EXPRESS = 2;
595595
}
596596

597+
// Timestamping mode.
598+
// Note that arrival time is always in milliseconds since Unix epoch.
599+
enum TimestampingMode {
600+
// Defaults to `TIMESTAMPING_MODE_CLIENT_PREFER`.
601+
TIMESTAMPING_MODE_UNSPECIFIED = 0;
602+
// Prefer client-specified timestamp if present otherwise use arrival time.
603+
TIMESTAMPING_MODE_CLIENT_PREFER = 1;
604+
// Require a client-specified timestamp and reject the append if it is missing.
605+
TIMESTAMPING_MODE_CLIENT_REQUIRE = 2;
606+
// Use the arrival time and ignore any client-specified timestamp.
607+
TIMESTAMPING_MODE_ARRIVAL = 3;
608+
}
609+
597610
// Stream configuration.
598611
message StreamConfig {
599-
// Storage class for recent writes. This is the main cost:performance knob in S2.
612+
message Timestamping {
613+
// Timestamping mode for appends that influences how timestamps are handled.
614+
TimestampingMode mode = 1;
615+
// Allow client-specified timestamps to exceed the arrival time.
616+
// If this is false or not set, client timestamps will be capped at the arrival time.
617+
optional bool uncapped = 2;
618+
}
619+
// Storage class for recent writes.
600620
StorageClass storage_class = 1;
601621
// Retention policy for the stream.
602622
// If unspecified, the default is to retain records for 7 days.
@@ -605,13 +625,10 @@ message StreamConfig {
605625
// If set to 0, the stream will have infinite retention.
606626
uint64 age = 2;
607627
}
608-
// Controls how to handle timestamps when they are not provided by the client.
609-
// If this is false (or not set), the record's arrival time in milliseconds since Unix epoch will be assigned as its timestamp.
610-
// If this is true, then any append without a client-specified timestamp will be rejected as invalid.
611-
optional bool require_client_timestamps = 3;
612-
// Allow client timestamps to exceed the arrival time in milliseconds since Unix epoch.
613-
// If this is false (or not set), client timestamps will be capped at the arrival time.
614-
optional bool uncapped_client_timestamps = 4;
628+
// Replaced with `timestamping`.
629+
reserved 3, 4;
630+
// Timestamping behavior.
631+
Timestamping timestamping = 5;
615632
}
616633

617634
// Basin configuration.
@@ -660,8 +677,7 @@ message Header {
660677
// Record to be appended to a stream.
661678
message AppendRecord {
662679
// Timestamp for this record.
663-
// The service will always ensure monotonicity by adjusting it up if necessary to the maximum observed timestamp.
664-
// Refer to the config documentation for `require_client_timestamps` and `uncapped_client_timestamps` to control whether client-specified timestamps are required, and whether they are allowed to exceed the arrival time.
680+
// Precise semantics depend on the stream's `timestamping` config.
665681
optional uint64 timestamp = 3;
666682
// Series of name-value pairs for this record.
667683
repeated Header headers = 1;

0 commit comments

Comments
 (0)