Skip to content

Commit 309d112

Browse files
committed
[BEAM-3221] Improve documentation in model pipeline protos
* clarify state caching tokens * fix documentation around side input types and valid request types.
1 parent 99d870d commit 309d112

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

model/fn-execution/src/main/proto/beam_fn_api.proto

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,11 @@ message ProcessBundleRequest {
268268
// instantiated and executed by the SDK harness.
269269
string process_bundle_descriptor_id = 1;
270270

271-
// A cache token which can be used by an SDK to check for the validity
272-
// of cached elements which have a cache token associated.
271+
// Contains the cache token and also defines the scope of what the token applies to.
272+
//
273+
// See https://s.apache.org/beam-fn-state-api-and-bundle-processing#heading=h.7ghoih5aig5m
274+
// for additional details on how to use the cache token with the State API
275+
// to cache data across bundle boundaries.
273276
message CacheToken {
274277

275278
// A flag to indicate a cache token is valid for all user state.
@@ -289,12 +292,17 @@ message ProcessBundleRequest {
289292
SideInput side_input = 2;
290293
}
291294

292-
// The cache token identifier which should be globally unique.
295+
// An opaque token used with the StateKey to create a globally unique
296+
// identifier.
293297
bytes token = 10;
294298
}
295299

296300
// (Optional) A list of cache tokens that can be used by an SDK to reuse
297301
// cached data returned by the State API across multiple bundles.
302+
//
303+
// See https://s.apache.org/beam-fn-state-api-and-bundle-processing#heading=h.7ghoih5aig5m
304+
// for additional details on how to use the cache token with the State API
305+
// to cache data across bundle boundaries.
298306
repeated CacheToken cache_tokens = 2;
299307

300308
// (Optional) Elements to be processed with the bundle. Either all or

model/pipeline/src/main/proto/beam_runner_api.proto

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ message StandardSideInputTypes {
452452
// Represents a view over a PCollection<KV<K, V>>.
453453
//
454454
// StateGetRequests performed on this side input must use
455-
// StateKey.IterableSideInput or StateKey.MultimapSideInput.
455+
// StateKey.MultimapKeysSideInput or StateKey.MultimapSideInput.
456456
MULTIMAP = 1 [(beam_urn) = "beam:side_input:multimap:v1"];
457457
}
458458
}
@@ -1354,9 +1354,8 @@ message SideInput {
13541354
// This access pattern defines the SDK harness <-> Runner Harness RPC
13551355
// interface for accessing a side input.
13561356
//
1357-
// The only access pattern intended for Beam, because of its superior
1358-
// performance possibilities, is "beam:sideinput:multimap" (or some such
1359-
// URN)
1357+
// See StandardSideInputTypes for an enumeration of all side input types
1358+
// defined.
13601359
FunctionSpec access_pattern = 1;
13611360

13621361
// (Required) The FunctionSpec of the UDF that adapts a particular

0 commit comments

Comments
 (0)