public abstract class RecommendationAIImportUserEvents extends PTransform<PCollection<KV<java.lang.String,com.google.api.client.json.GenericJson>>,PCollectionTuple>
PTransform
connecting to the Recommendations AI API
(https://cloud.google.com/recommendations) and creating UserEvent
s. *
Batch size defines how many items are at once per batch (max: 5000).
The transform consumes KV
of String
and GenericJson
s (assumed to be
the user event id as key and contents as value) and outputs a PCollectionTuple which will contain
the successfully created and failed user events.
It is possible to provide a catalog name to which you want to add the catalog item (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").
Modifier and Type | Field and Description |
---|---|
static TupleTag<com.google.cloud.recommendationengine.v1beta1.UserEvent> |
FAILURE_TAG |
static TupleTag<com.google.cloud.recommendationengine.v1beta1.UserEvent> |
SUCCESS_TAG |
annotations, displayData, name, resourceHints
Constructor and Description |
---|
RecommendationAIImportUserEvents() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Integer |
batchSize() |
abstract @Nullable java.lang.String |
catalogName() |
abstract @Nullable java.lang.String |
eventStore() |
PCollectionTuple |
expand(PCollection<KV<java.lang.String,com.google.api.client.json.GenericJson>> input)
The transform converts the contents of input PCollection into
UserEvent s and then calls
the Recommendation AI service to create the user event. |
abstract Duration |
maxBufferingDuration() |
abstract @Nullable java.lang.String |
projectId() |
RecommendationAIImportUserEvents |
withBatchSize(java.lang.Integer batchSize) |
RecommendationAIImportUserEvents |
withCatalogName(java.lang.String catalogName) |
RecommendationAIImportUserEvents |
withEventStore(java.lang.String eventStore) |
RecommendationAIImportUserEvents |
withProjectId(java.lang.String projectId) |
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
public static final TupleTag<com.google.cloud.recommendationengine.v1beta1.UserEvent> SUCCESS_TAG
public static final TupleTag<com.google.cloud.recommendationengine.v1beta1.UserEvent> FAILURE_TAG
public abstract @Nullable java.lang.String projectId()
public abstract @Nullable java.lang.String catalogName()
public abstract @Nullable java.lang.String eventStore()
public abstract java.lang.Integer batchSize()
public abstract Duration maxBufferingDuration()
public RecommendationAIImportUserEvents withProjectId(java.lang.String projectId)
public RecommendationAIImportUserEvents withCatalogName(java.lang.String catalogName)
public RecommendationAIImportUserEvents withEventStore(java.lang.String eventStore)
public RecommendationAIImportUserEvents withBatchSize(java.lang.Integer batchSize)
public PCollectionTuple expand(PCollection<KV<java.lang.String,com.google.api.client.json.GenericJson>> input)
UserEvent
s and then calls
the Recommendation AI service to create the user event.expand
in class PTransform<PCollection<KV<java.lang.String,com.google.api.client.json.GenericJson>>,PCollectionTuple>
input
- input PCollection