Skip to content

Commit 22a5951

Browse files
authored
Document job management and interactive API protos (#39294)
Add documentation comments to previously undocumented messages and fields in the Beam job management and interactive API protos: beam_artifact_api.proto: ArtifactRetrievalService, ArtifactStagingService, ArtifactRequestWrapper, ProxyManifest, PutArtifactMetadata, and more. beam_expansion_api.proto: ExpansionRequest/Response, DiscoverSchemaTransformRequest/Response, SchemaTransformConfig. beam_job_api.proto: JobService, JobInfo, JobStateEvent, JobMessage, GetJobMetricsRequest/Response, MetricResults, PipelineOptionType. beam_interactive_api.proto: TestStreamService, EventsRequest.
1 parent 0dd4788 commit 22a5951

4 files changed

Lines changed: 62 additions & 2 deletions

File tree

model/interactive/src/main/proto/org/apache/beam/model/interactive/v1/beam_interactive_api.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ message TestStreamFileRecord {
5050
org.apache.beam.model.pipeline.v1.TestStreamPayload.Event recorded_event = 1;
5151
}
5252

53+
// A gRPC service that serves cached TestStream events to a TestStream source.
54+
// Used by Interactive Beam to replay recorded pipeline elements from a streaming cache.
5355
service TestStreamService {
5456
// A TestStream will request for events using this RPC.
5557
rpc Events(EventsRequest) returns (stream org.apache.beam.model.pipeline.v1.TestStreamPayload.Event) {}
5658
}
5759

60+
// A request for TestStream events from a streaming cache.
61+
// The client specifies which PCollection output tags to read events for.
5862
message EventsRequest {
5963
// The set of PCollections to read from. These are the PTransform outputs
6064
// local names. These are a subset of the TestStream's outputs. This allows

model/job-management/src/main/proto/org/apache/beam/model/job_management/v1/beam_artifact_api.proto

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,23 @@ message ResolveArtifactsResponse {
7878

7979
// A request to get an artifact.
8080
message GetArtifactRequest {
81+
// (Required) The artifact to retrieve, typically a resolved artifact from ResolveArtifacts.
8182
org.apache.beam.model.pipeline.v1.ArtifactInformation artifact = 1;
8283
}
8384

8485
// Part of a response to getting an artifact.
8586
message GetArtifactResponse {
87+
// A chunk of the artifact's binary content.
8688
bytes data = 1;
8789
}
8890

8991
// Wraps an ArtifactRetrievalService request for use in ReverseArtifactRetrievalService.
92+
// The server sends these requests to the client during the reverse staging flow.
9093
message ArtifactRequestWrapper {
9194
oneof request {
95+
// Request to resolve a set of artifacts into concrete artifact references.
9296
ResolveArtifactsRequest resolve_artifact = 1000;
97+
// Request to retrieve the bytes of a specific artifact.
9398
GetArtifactRequest get_artifact = 1001;
9499
}
95100
}
@@ -151,16 +156,22 @@ message ArtifactMetadata {
151156

152157
// A collection of artifacts.
153158
message Manifest {
159+
// (Required) The list of artifacts staged for a job.
154160
repeated ArtifactMetadata artifact = 1;
155161
}
156162

157163
// A manifest with location information.
158164
message ProxyManifest {
165+
// (Required) The manifest of staged artifacts.
159166
Manifest manifest = 1;
167+
// A location (name + URI) at which a staged artifact can be retrieved.
160168
message Location {
161-
string name = 1;
162-
string uri = 2;
169+
// (Required) The name of the artifact, matching the name in the Manifest.
170+
string name = 1;
171+
// (Required) The URI at which the artifact content can be retrieved.
172+
string uri = 2;
163173
}
174+
// (Required) The list of artifact locations for retrieval.
164175
repeated Location location = 2;
165176
}
166177

@@ -173,6 +184,7 @@ message GetManifestRequest {
173184

174185
// A response containing a job manifest.
175186
message GetManifestResponse {
187+
// (Required) The manifest of staged artifacts for the job.
176188
Manifest manifest = 1;
177189
}
178190

@@ -187,9 +199,11 @@ message LegacyGetArtifactRequest {
187199

188200
// Part of an artifact.
189201
message ArtifactChunk {
202+
// A chunk of the artifact's binary content.
190203
bytes data = 1;
191204
}
192205

206+
// Metadata for an artifact being staged, sent as the first message in a PutArtifact stream.
193207
message PutArtifactMetadata {
194208
// (Required) A token for artifact staging session. This token can be obtained
195209
// from PrepareJob request in JobService
@@ -211,6 +225,7 @@ message PutArtifactRequest {
211225
}
212226
}
213227

228+
// A response to staging an artifact. An empty response indicating the artifact was staged successfully.
214229
message PutArtifactResponse {
215230
}
216231

model/job-management/src/main/proto/org/apache/beam/model/job_management/v1/beam_expansion_api.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import "google/protobuf/struct.proto";
3333
import "org/apache/beam/model/pipeline/v1/beam_runner_api.proto";
3434
import "org/apache/beam/model/pipeline/v1/schema.proto";
3535

36+
// A request to expand a single PTransform in a remote SDK. The expansion service
37+
// resolves the transform into its constituent subtransforms and outputs.
3638
message ExpansionRequest {
3739
// Set of components needed to interpret the transform, or which
3840
// may be useful for its expansion. This includes the input
@@ -64,6 +66,8 @@ message ExpansionRequest {
6466
google.protobuf.Struct pipeline_options = 6;
6567
}
6668

69+
// The result of expanding a PTransform, containing the expanded transform and
70+
// all newly created components.
6771
message ExpansionResponse {
6872
// Set of components needed to execute the expanded transform,
6973
// including the (original) inputs, outputs, and subtransforms.
@@ -82,9 +86,13 @@ message ExpansionResponse {
8286
string error = 10;
8387
}
8488

89+
// A request to discover all SchemaTransformProviders registered with the expansion service.
90+
// This is used by cross-language pipeline construction to enumerate available transforms.
8591
message DiscoverSchemaTransformRequest {
8692
}
8793

94+
// Configuration metadata for a SchemaTransform, describing its inputs, outputs,
95+
// and configuration schema. Used to enable cross-language transform discovery.
8896
message SchemaTransformConfig {
8997
// Config schema of the SchemaTransform
9098
org.apache.beam.model.pipeline.v1.Schema config_schema = 1;
@@ -102,6 +110,7 @@ message SchemaTransformConfig {
102110
string description = 4;
103111
}
104112

113+
// A response containing all discovered SchemaTransform configurations.
105114
message DiscoverSchemaTransformResponse {
106115
// A mapping from SchemaTransform ID to schema transform config of discovered
107116
// SchemaTransforms

model/job-management/src/main/proto/org/apache/beam/model/job_management/v1/beam_job_api.proto

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ message RunJobRequest {
112112
}
113113

114114

115+
// The response from submitting a job for execution.
115116
message RunJobResponse {
116117
string job_id = 1; // (required) The ID for the executing job
117118
}
@@ -144,6 +145,7 @@ message DrainJobResponse {
144145
}
145146

146147
// A subset of info provided by ProvisionApi.ProvisionInfo
148+
// Represents metadata about a submitted job.
147149
message JobInfo {
148150
string job_id = 1; // (required)
149151
string job_name = 2; // (required)
@@ -155,6 +157,7 @@ message JobInfo {
155157
// Throws error GRPC_STATUS_UNAVAILABLE if server is down
156158
message GetJobsRequest { }
157159

160+
// The response from requesting a list of all invoked jobs.
158161
message GetJobsResponse {
159162
repeated JobInfo job_info = 1; // (required)
160163
}
@@ -168,6 +171,7 @@ message GetJobStateRequest {
168171

169172
}
170173

174+
// An event representing a job state transition. Emitted by GetState and GetStateStream.
171175
message JobStateEvent {
172176
JobState.Enum state = 1; // (required)
173177
google.protobuf.Timestamp timestamp = 2; // (required)
@@ -182,6 +186,7 @@ message GetJobPipelineRequest {
182186

183187
}
184188

189+
// The response from requesting a job's pipeline representation.
185190
message GetJobPipelineResponse {
186191
org.apache.beam.model.pipeline.v1.Pipeline pipeline = 1; // (required)
187192
}
@@ -195,25 +200,41 @@ message JobMessagesRequest {
195200
string job_id = 1; // (required)
196201
}
197202

203+
// A single log message or diagnostic event from a running job.
198204
message JobMessage {
205+
// (Required) A unique identifier for this message.
199206
string message_id = 1;
207+
// (Required) The time at which the message was emitted, as a string representation.
200208
string time = 2;
209+
// (Required) The importance level of this message.
201210
MessageImportance importance = 3;
211+
// (Required) The text content of the message.
202212
string message_text = 4;
203213

214+
// Importance levels for job messages, ordered from least to most severe.
204215
enum MessageImportance {
216+
// The importance was not specified.
205217
MESSAGE_IMPORTANCE_UNSPECIFIED = 0;
218+
// Debug-level messages, typically very verbose.
206219
JOB_MESSAGE_DEBUG = 1;
220+
// Detailed informational messages.
207221
JOB_MESSAGE_DETAILED = 2;
222+
// Basic informational messages.
208223
JOB_MESSAGE_BASIC = 3;
224+
// Warning messages indicating potential issues.
209225
JOB_MESSAGE_WARNING = 4;
226+
// Error messages indicating failures.
210227
JOB_MESSAGE_ERROR = 5;
211228
}
212229
}
213230

231+
// A streaming response from GetMessageStream, containing either a job message
232+
// or a job state change event.
214233
message JobMessagesResponse {
215234
oneof response {
235+
// A log message or diagnostic event from the job.
216236
JobMessage message_response = 1;
237+
// A job state transition event.
217238
JobStateEvent state_response = 2;
218239
}
219240
}
@@ -270,17 +291,22 @@ message JobState {
270291
}
271292

272293

294+
// A request to fetch metrics for a given job.
273295
message GetJobMetricsRequest {
274296
string job_id = 1; // (required)
275297
}
276298

299+
// A response containing metrics for a given job.
277300
message GetJobMetricsResponse {
301+
// (Required) The metrics results containing both attempted and committed values.
278302
MetricResults metrics = 1;
279303
}
280304

281305
// All metrics for a given job. Runners may support one or the other or both.
282306
message MetricResults {
307+
// Metrics reflecting the result of attempted (non-committed) computations.
283308
repeated org.apache.beam.model.pipeline.v1.MonitoringInfo attempted = 1;
309+
// Metrics reflecting the result of committed computations.
284310
repeated org.apache.beam.model.pipeline.v1.MonitoringInfo committed = 2;
285311
}
286312

@@ -296,12 +322,17 @@ message DescribePipelineOptionsRequest {
296322
// Types mirror those of JSON, since that's how pipeline options are serialized.
297323
message PipelineOptionType {
298324
enum Enum {
325+
// A string value.
299326
STRING = 0;
327+
// A boolean (true/false) value.
300328
BOOLEAN = 1;
301329
// whole numbers, see https://json-schema.org/understanding-json-schema/reference/numeric.html
302330
INTEGER = 2;
331+
// A floating-point number.
303332
NUMBER = 3;
333+
// An array of values.
304334
ARRAY = 4;
335+
// A nested object.
305336
OBJECT = 5;
306337
};
307338
}
@@ -324,6 +355,7 @@ message PipelineOptionDescriptor {
324355
string group = 5;
325356
}
326357

358+
// The response from describing pipeline options, containing a list of option descriptors.
327359
message DescribePipelineOptionsResponse {
328360
// List of pipeline option descriptors.
329361
repeated PipelineOptionDescriptor options = 1;

0 commit comments

Comments
 (0)