Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion model/fn-execution/src/main/proto/beam_fn_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,15 @@ message StateKey {
bytes window = 3;
}

// Represents a request for an unordered set of values associated with a
// specified user key and window for a PTransform. See
// https://s.apache.org/beam-fn-state-api-and-bundle-processing for further
// details.
//
// The response data stream will be a concatenation of all V's associated
// with the specified user key and window.
// See https://s.apache.org/beam-fn-api-send-and-receive-data for further
// details.
message BagUserState {
// (Required) The id of the PTransform containing user state.
string transform_id = 1;
Expand All @@ -721,14 +730,62 @@ message StateKey {
bytes key = 4;
}

// Represents a request for the keys of a multimap associated with a specified
// user key and window for a PTransform. See
// https://s.apache.org/beam-fn-state-api-and-bundle-processing for further
// details.
//
// Can only be used to perform StateGetRequests and StateClearRequests on the
// user state.
//
// The response data stream will be a concatenation of all K's associated
// with the specified user key and window.
// See https://s.apache.org/beam-fn-api-send-and-receive-data for further
// details.
message MultimapKeysUserState {
// (Required) The id of the PTransform containing user state.
string transform_id = 1;
// (Required) The id of the user state.
string user_state_id = 2;
// (Required) The window encoded in a nested context.
bytes window = 3;
// (Required) The key of the currently executing element encoded in a
// nested context.
bytes key = 4;
}

// Represents a request for the values of the map key associated with a
// specified user key and window for a PTransform. See
// https://s.apache.org/beam-fn-state-api-and-bundle-processing for further
// details.
//
// The response data stream will be a concatenation of all V's associated
// with the specified map key, user key, and window.
// See https://s.apache.org/beam-fn-api-send-and-receive-data for further
// details.
message MultimapUserState {
// (Required) The id of the PTransform containing user state.
string transform_id = 1;
// (Required) The id of the user state.
string user_state_id = 2;
// (Required) The window encoded in a nested context.
bytes window = 3;
// (Required) The key of the currently executing element encoded in a
// nested context.
bytes key = 4;
// (Required) The map key encoded in a nested context.
bytes map_key = 5;
}

// (Required) One of the following state keys must be set.
oneof type {
Runner runner = 1;
MultimapSideInput multimap_side_input = 2;
BagUserState bag_user_state = 3;
IterableSideInput iterable_side_input = 4;
MultimapKeysSideInput multimap_keys_side_input = 5;
// TODO: represent a state key for user map state
MultimapKeysUserState multimap_keys_user_state = 6;
MultimapUserState multimap_user_state = 7;
}
}

Expand Down