public class StreamFeatureGroup extends FeatureGroupBase<org.apache.beam.sdk.values.PCollection<Object>>
Modifier and Type | Field and Description |
---|---|
protected FeatureGroupEngine |
featureGroupEngine |
created, creator, deltaStreamerJobConf, deprecated, description, eventTime, expectationsNames, featureGroupEngineBase, features, featureStore, hudiPrecombineKey, id, location, LOGGER, name, notificationTopicName, onlineEnabled, onlineTopicName, partitionKeys, path, primaryKeys, statisticColumns, statisticsConfig, storageConnector, subject, timeTravelFormat, topicName, type, utils, version
Constructor and Description |
---|
StreamFeatureGroup() |
StreamFeatureGroup(FeatureStore featureStore,
int id) |
StreamFeatureGroup(FeatureStore featureStore,
@NonNull String name,
Integer version,
String description,
List<String> primaryKeys,
List<String> partitionKeys,
String hudiPrecombineKey,
boolean onlineEnabled,
TimeTravelFormat timeTravelFormat,
List<Feature> features,
StatisticsConfig statisticsConfig,
String onlineTopicName,
String eventTime,
StorageConnector storageConnector,
String path) |
StreamFeatureGroup(Integer id,
String description,
List<Feature> features) |
Modifier and Type | Method and Description |
---|---|
BeamProducer |
insertStream()
Ingest a feature data to the online feature store using Beam Pipeline object.
|
BeamProducer |
insertStream(Map<String,String> writeOptions) |
Object |
insertStream(org.apache.beam.sdk.values.PCollection<Object> featureData) |
Object |
insertStream(org.apache.beam.sdk.values.PCollection<Object> featureData,
Map<String,String> writeOptions) |
void |
save()
Save the feature group metadata on Hopsworks.
|
void |
save(Map<String,String> writeOptions,
JobConfiguration materializationJobConfiguration)
Save the feature group metadata on Hopsworks.
|
addTag, checkDeprecated, delete, deleteTag, getAvroSchema, getComplexFeatures, getDeserializedAvroSchema, getDeserializedEncodedAvroSchema, getEncodedAvroSchema, getFeature, getFeatureAvroSchema, getPrimaryKeys, getSubject, getTag, getTags, setDeprecated, unloadSubject, updateDeprecated, updateDeprecated, updateDescription, updateFeatureDescription, updateNotificationTopicName, updateStatisticsConfig
protected FeatureGroupEngine featureGroupEngine
public StreamFeatureGroup(FeatureStore featureStore, @NonNull @NonNull String name, Integer version, String description, List<String> primaryKeys, List<String> partitionKeys, String hudiPrecombineKey, boolean onlineEnabled, TimeTravelFormat timeTravelFormat, List<Feature> features, StatisticsConfig statisticsConfig, String onlineTopicName, String eventTime, StorageConnector storageConnector, String path)
public StreamFeatureGroup()
public StreamFeatureGroup(Integer id, String description, List<Feature> features)
public StreamFeatureGroup(FeatureStore featureStore, int id)
public void save() throws FeatureStoreException, IOException
FeatureStoreException
IOException
public void save(Map<String,String> writeOptions, JobConfiguration materializationJobConfiguration) throws FeatureStoreException, IOException
writeOptions
- Options to provide to the materialization jobmaterializationJobConfiguration
- Resource configuration for the materialization jobFeatureStoreException
IOException
public BeamProducer insertStream() throws Exception
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
// get feature group handle
StreamFeatureGroup fg = fs.getStreamFeatureGroup("taxi_ride", 1);
// create Beam pipeline
Pipeline pipeline = Pipeline.create();
pipeline
.apply("read stream from the source", PubsubIO.readStrings().fromTopic(options.getInputTopic()))
.apply("Parse JSON to Beam Rows", JsonToRow.withSchema(schema))
.apply("insert streaming feature data", fg.insertStream());
Exception
public BeamProducer insertStream(Map<String,String> writeOptions) throws Exception
Exception
public Object insertStream(org.apache.beam.sdk.values.PCollection<Object> featureData) throws Exception
insertStream
in class FeatureGroupBase<org.apache.beam.sdk.values.PCollection<Object>>
Exception
public Object insertStream(org.apache.beam.sdk.values.PCollection<Object> featureData, Map<String,String> writeOptions) throws Exception
insertStream
in class FeatureGroupBase<org.apache.beam.sdk.values.PCollection<Object>>
Exception
Copyright © 2025. All rights reserved.