@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
2222import "google/api/resource.proto" ;
2323import "google/cloud/aiplatform/v1beta1/featurestore_online_service.proto" ;
2424import "google/protobuf/struct.proto" ;
25+ import "google/protobuf/timestamp.proto" ;
2526import "google/rpc/status.proto" ;
2627
2728option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1" ;
@@ -70,6 +71,17 @@ service FeatureOnlineStoreService {
7071 body : "*"
7172 };
7273 }
74+
75+ // Bidirectional streaming RPC to directly write to feature values in a
76+ // feature view. Requests may not have a one-to-one mapping to responses and
77+ // responses may be returned out-of-order to reduce latency.
78+ rpc FeatureViewDirectWrite (stream FeatureViewDirectWriteRequest )
79+ returns (stream FeatureViewDirectWriteResponse ) {
80+ option (google.api.http ) = {
81+ post : "/v1beta1/{feature_view=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:directWrite"
82+ body : "*"
83+ };
84+ }
7385}
7486
7587// Format of the data in the Feature View.
@@ -409,3 +421,85 @@ message SearchNearestEntitiesResponse {
409421 // The nearest neighbors of the query entity.
410422 NearestNeighbors nearest_neighbors = 1 ;
411423}
424+
425+ // Request message for
426+ // [FeatureOnlineStoreService.FeatureViewDirectWrite][google.cloud.aiplatform.v1beta1.FeatureOnlineStoreService.FeatureViewDirectWrite].
427+ message FeatureViewDirectWriteRequest {
428+ // A data key and associated feature values to write to the feature view.
429+ message DataKeyAndFeatureValues {
430+ // Feature name & value pair.
431+ message Feature {
432+ // Feature value and timestamp.
433+ message FeatureValueAndTimestamp {
434+ // The feature value.
435+ FeatureValue value = 1 ;
436+
437+ // The feature timestamp to store with this value.
438+ // If not set, then the Feature Store server will generate a timestamp
439+ // when it receives the write request.
440+ google.protobuf.Timestamp timestamp = 2 ;
441+ }
442+
443+ // Feature value data to write.
444+ oneof data_oneof {
445+ // Feature value and timestamp.
446+ FeatureValueAndTimestamp value_and_timestamp = 2 ;
447+ }
448+
449+ // Feature short name.
450+ string name = 1 ;
451+ }
452+
453+ // The data key.
454+ FeatureViewDataKey data_key = 1 ;
455+
456+ // List of features to write.
457+ repeated Feature features = 2 ;
458+ }
459+
460+ // FeatureView resource format
461+ // `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}`
462+ string feature_view = 1 [(google.api.resource_reference ) = {
463+ type : "aiplatform.googleapis.com/FeatureView"
464+ }];
465+
466+ // Required. The data keys and associated feature values.
467+ repeated DataKeyAndFeatureValues data_key_and_feature_values = 2
468+ [(google.api.field_behavior ) = REQUIRED ];
469+ }
470+
471+ // Response message for
472+ // [FeatureOnlineStoreService.FeatureViewDirectWrite][google.cloud.aiplatform.v1beta1.FeatureOnlineStoreService.FeatureViewDirectWrite].
473+ message FeatureViewDirectWriteResponse {
474+ // Details about the write for each key.
475+ message WriteResponse {
476+ // What key is this write response associated with.
477+ FeatureViewDataKey data_key = 1 ;
478+
479+ // When the feature values were written to the online store.
480+ // If
481+ // [FeatureViewDirectWriteResponse.status][google.cloud.aiplatform.v1beta1.FeatureViewDirectWriteResponse.status]
482+ // is not OK, this field is not populated.
483+ google.protobuf.Timestamp online_store_write_time = 2 ;
484+ }
485+
486+ // Response status for the keys listed in
487+ // [FeatureViewDirectWriteResponse.write_responses][google.cloud.aiplatform.v1beta1.FeatureViewDirectWriteResponse.write_responses].
488+ //
489+ // The error only applies to the
490+ // listed data keys - the stream will remain open for further
491+ // [FeatureOnlineStoreService.FeatureViewDirectWriteRequest][] requests.
492+ //
493+ // Partial failures (e.g. if the first 10 keys of a request fail, but the
494+ // rest succeed) from a single request may result in multiple responses -
495+ // there will be one response for the successful request keys and one response
496+ // for the failing request keys.
497+ google.rpc.Status status = 1 ;
498+
499+ // Details about write for each key. If status is not OK,
500+ // [WriteResponse.data_key][google.cloud.aiplatform.v1beta1.FeatureViewDirectWriteResponse.WriteResponse.data_key]
501+ // will have the key with error, but
502+ // [WriteResponse.online_store_write_time][google.cloud.aiplatform.v1beta1.FeatureViewDirectWriteResponse.WriteResponse.online_store_write_time]
503+ // will not be present.
504+ repeated WriteResponse write_responses = 2 ;
505+ }
0 commit comments