Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit 038b533

Browse files
GetStateKeysEntryMessage
1 parent 6cdc9e0 commit 038b533

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

dev/restate/service/protocol.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,20 @@ message ClearStateEntryMessage {
151151
bytes key = 1;
152152
}
153153

154+
// Completable: Yes
155+
// Fallible: No
156+
// Type: 0x0800 + 4
157+
message GetStateKeysEntryMessage {
158+
message StateKeys {
159+
repeated bytes keys = 1;
160+
}
161+
162+
oneof result {
163+
StateKeys value = 14;
164+
Failure failure = 15;
165+
};
166+
}
167+
154168
// ------ Syscalls ------
155169

156170
// Completable: Yes

service-invocation-protocol.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ Each syscall defines a priori whether it replies with an ack or a completion, or
9090

9191
## Messages
9292

93-
The protocol is composed by messages that are sent back and forth between runtime and the service deployment. The protocol
94-
mandates the following messages:
93+
The protocol is composed by messages that are sent back and forth between runtime and the service deployment. The
94+
protocol mandates the following messages:
9595

9696
- `StartMessage`
9797
- `[..]EntryMessage`
@@ -284,6 +284,7 @@ descriptions in [`protocol.proto`](dev/restate/service/protocol.proto).
284284
| ------------------------------- | -------- | ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
285285
| `PollInputStreamEntryMessage` | `0x0400` | Yes | No | Carries the invocation input message(s) of the invocation. Note: currently the runtime always sends this entry completed, but this may change in future. |
286286
| `GetStateEntryMessage` | `0x0800` | Yes | No | Get the value of a service instance state key. |
287+
| `GetStateKeysEntryMessage` | `0x0804` | Yes | No | Get all the known state keys for this service instance. Note: the completion value for this message is a protobuf of type `GetStateKeysEntryMessage.StateKeys`. |
287288
| `SleepEntryMessage` | `0x0C00` | Yes | No | Initiate a timer that completes after the given time. |
288289
| `InvokeEntryMessage` | `0x0C01` | Yes | Yes | Invoke another Restate service. |
289290
| `AwakeableEntryMessage` | `0x0C03` | Yes | No | Arbitrary result container which can be completed from another service, given a specific id. See [Awakeable identifier](#awakeable-identifier) for more details. |
@@ -298,8 +299,9 @@ descriptions in [`protocol.proto`](dev/restate/service/protocol.proto).
298299
When creating an `AwakeableEntryMessage`, the SDK MUST expose to the user code an id, required to later complete the
299300
entry, using either `CompleteAwakeableEntryMessage` or some other mechanism provided by the runtime.
300301

301-
The id format is a string starts with `prom_1` concatenated with a [Base64 URL Safe string](https://datatracker.ietf.org/doc/html/rfc4648#section-5) encoding of a byte
302-
array that concatenates:
302+
The id format is a string starts with `prom_1` concatenated with a
303+
[Base64 URL Safe string](https://datatracker.ietf.org/doc/html/rfc4648#section-5) encoding of a byte array that
304+
concatenates:
303305

304306
- `StartMessage.id`
305307
- The index of the Awakeable entry, encoded as unsigned 32 bit integer big endian.
@@ -331,8 +333,8 @@ To notify a failure, the SDK can either:
331333

332334
- Close the stream with `ErrorMessage` as last message. This message is used by the runtime for accurate reporting to
333335
the user.
334-
- Close the stream without `EndMessage` or `SuspensionMessage` or `ErrorMessage`. This is equivalent to sending
335-
an `ErrorMessage` with unknown reason.
336+
- Close the stream without `EndMessage` or `SuspensionMessage` or `ErrorMessage`. This is equivalent to sending an
337+
`ErrorMessage` with unknown reason.
336338

337339
The runtime takes care of retrying to execute the invocation after such failures occur, following a defined set of
338340
policies. When retrying, the previous stored journal will be reused. Moreover, the SDK MUST NOT assume that every

0 commit comments

Comments
 (0)