Class RecommendationAIWriteUserEvent
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson>,org.apache.beam.sdk.values.PCollectionTuple>
-
- org.apache.beam.sdk.extensions.ml.RecommendationAIWriteUserEvent
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
public abstract class RecommendationAIWriteUserEvent extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson>,org.apache.beam.sdk.values.PCollectionTuple>APTransformusing the Recommendations AI API (https://cloud.google.com/recommendations). Takes an inputPCollectionofGenericJsons and converts them to and createsUserEvents.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.beam.sdk.values.TupleTag<com.google.cloud.recommendationengine.v1beta1.UserEvent>FAILURE_TAGstatic org.apache.beam.sdk.values.TupleTag<com.google.cloud.recommendationengine.v1beta1.UserEvent>SUCCESS_TAG
-
Constructor Summary
Constructors Constructor Description RecommendationAIWriteUserEvent()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.StringcatalogName()Returns name of the catalog where the user events will be created.abstract java.lang.StringeventStore()Returns name of the event store where the user events will be created.org.apache.beam.sdk.values.PCollectionTupleexpand(org.apache.beam.sdk.values.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 java.lang.StringprojectId()Returns ID of Google Cloud project to be used for creating user events.RecommendationAIWriteUserEventwithCatalogName(java.lang.String catalogName)RecommendationAIWriteUserEventwithEventStore(java.lang.String eventStore)RecommendationAIWriteUserEventwithProjectId(java.lang.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
-
-
-
-
Method Detail
-
projectId
@Nullable public abstract java.lang.String projectId()
Returns ID of Google Cloud project to be used for creating user events.
-
catalogName
@Nullable public abstract java.lang.String catalogName()
Returns name of the catalog where the user events will be created.
-
eventStore
@Nullable public abstract java.lang.String eventStore()
Returns name of the event store where the user events will be created.
-
expand
public org.apache.beam.sdk.values.PCollectionTuple expand(org.apache.beam.sdk.values.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.- Specified by:
expandin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson>,org.apache.beam.sdk.values.PCollectionTuple>- Parameters:
input- input PCollection- Returns:
- PCollectionTuple with successful and failed
UserEvents
-
withProjectId
public RecommendationAIWriteUserEvent withProjectId(java.lang.String projectId)
-
withCatalogName
public RecommendationAIWriteUserEvent withCatalogName(java.lang.String catalogName)
-
withEventStore
public RecommendationAIWriteUserEvent withEventStore(java.lang.String eventStore)
-
-