rohdesamuel commented on code in PR #25065:
URL: https://github.com/apache/beam/pull/25065#discussion_r1081711060


##########
model/fn-execution/src/main/proto/org/apache/beam/model/fn_execution/v1/beam_fn_api.proto:
##########
@@ -137,12 +138,64 @@ message InstructionResponse {
     FinalizeBundleResponse finalize_bundle = 1004;
     MonitoringInfosMetadataResponse monitoring_infos = 1005;
     HarnessMonitoringInfosResponse harness_monitoring_infos = 1006;
+    SampleResponse sample = 1007;
 
     // DEPRECATED
     RegisterResponse register = 1000;
   }
 }
 
+// If supported, the `SampleRequest` will respond with a `SampleResponse` of 
any
+// sampled elements for the PCollections within the given
+// ProcessBundleDescriptor. The SDK being queried must have the
+// "beam:protocol:data_sampling:v1" capability.
+message SampleRequest {
+  // Required. The id of the ProcessBundleDescriptor to sample. If empty,
+  // returns samples from all descriptors.
+  string process_bundle_descriptor_id = 1;
+
+  // Optional. The PCollections to sample from. If empty, returns all sampled
+  // PCollections from the given PBD. If both are empty, returns all samples.
+  repeated string pcollection_ids = 2;
+}
+
+// Contains sampled elements from all PCollections from a single
+// ProcessBundleDescriptor when the SDK is processing a bundle.
+message Samples {
+
+  // A sampled element. This is a proto message to allow for additional
+  // per-element metadata.
+  message Element {
+    // Required. Sampled raw bytes for an element. This is a
+    // single encoded element in the nested context.
+    bytes element = 1;

Review Comment:
   Done!



##########
model/fn-execution/src/main/proto/org/apache/beam/model/fn_execution/v1/beam_fn_api.proto:
##########
@@ -137,12 +138,64 @@ message InstructionResponse {
     FinalizeBundleResponse finalize_bundle = 1004;
     MonitoringInfosMetadataResponse monitoring_infos = 1005;
     HarnessMonitoringInfosResponse harness_monitoring_infos = 1006;
+    SampleResponse sample = 1007;
 
     // DEPRECATED
     RegisterResponse register = 1000;
   }
 }
 
+// If supported, the `SampleRequest` will respond with a `SampleResponse` of 
any
+// sampled elements for the PCollections within the given
+// ProcessBundleDescriptor. The SDK being queried must have the
+// "beam:protocol:data_sampling:v1" capability.
+message SampleRequest {
+  // Required. The id of the ProcessBundleDescriptor to sample. If empty,
+  // returns samples from all descriptors.
+  string process_bundle_descriptor_id = 1;
+
+  // Optional. The PCollections to sample from. If empty, returns all sampled
+  // PCollections from the given PBD. If both are empty, returns all samples.
+  repeated string pcollection_ids = 2;
+}
+
+// Contains sampled elements from all PCollections from a single
+// ProcessBundleDescriptor when the SDK is processing a bundle.
+message Samples {
+
+  // A sampled element. This is a proto message to allow for additional
+  // per-element metadata.
+  message Element {
+    // Required. Sampled raw bytes for an element. This is a
+    // single encoded element in the nested context.
+    bytes element = 1;

Review Comment:
   And good to know, thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to