Class RecommendationAIWriteUserEvent
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<com.google.api.client.json.GenericJson>,PCollectionTuple>
org.apache.beam.sdk.extensions.ml.RecommendationAIWriteUserEvent
- All Implemented Interfaces:
Serializable,HasDisplayData
public abstract class RecommendationAIWriteUserEvent
extends PTransform<PCollection<com.google.api.client.json.GenericJson>,PCollectionTuple>
A
PTransform using the Recommendations AI API (https://cloud.google.com/recommendations).
Takes an input PCollection of GenericJsons and converts them to and creates
UserEvents.
It is possible to provide a catalog name to which you want to add the user event (defaults to "default_catalog"). It is possible to provide a event store to which you want to add the user event (defaults to "default_event_store").
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TupleTag<com.google.cloud.recommendationengine.v1beta1.UserEvent> static final TupleTag<com.google.cloud.recommendationengine.v1beta1.UserEvent> Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringReturns name of the catalog where the user events will be created.abstract StringReturns name of the event store where the user events will be created.expand(PCollection<com.google.api.client.json.GenericJson> input) The transform converts the contents of input PCollection intoUserEvents and then calls the Recommendation AI service to create the user event.abstract StringReturns ID of Google Cloud project to be used for creating user events.withCatalogName(String catalogName) withEventStore(String eventStore) withProjectId(String projectId) Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Field Details
-
SUCCESS_TAG
-
FAILURE_TAG
-
-
Constructor Details
-
RecommendationAIWriteUserEvent
public RecommendationAIWriteUserEvent()
-
-
Method Details
-
projectId
Returns ID of Google Cloud project to be used for creating user events. -
catalogName
Returns name of the catalog where the user events will be created. -
eventStore
Returns name of the event store where the user events will be created. -
expand
The transform converts the contents of input PCollection intoUserEvents and then calls the Recommendation AI service to create the user event.- Specified by:
expandin classPTransform<PCollection<com.google.api.client.json.GenericJson>,PCollectionTuple> - Parameters:
input- input PCollection- Returns:
- PCollectionTuple with successful and failed
UserEvents
-
withProjectId
-
withCatalogName
-
withEventStore
-