public abstract class FeatureStoreBase<T2 extends QueryBase> extends Object
Modifier and Type | Field and Description |
---|---|
protected static Integer |
DEFAULT_VERSION |
protected FeatureGroupApi |
featureGroupApi |
protected static org.slf4j.Logger |
LOGGER |
protected StorageConnectorApi |
storageConnectorApi |
protected TrainingDatasetApi |
trainingDatasetApi |
Constructor and Description |
---|
FeatureStoreBase() |
Modifier and Type | Method and Description |
---|---|
abstract FeatureGroupBase |
createStreamFeatureGroup(@NonNull String name,
Integer version,
String description,
Boolean onlineEnabled,
TimeTravelFormat timeTravelFormat,
List<String> primaryKeys,
List<String> partitionKeys,
String eventTime,
String hudiPrecombineKey,
List<Feature> features,
StatisticsConfig statisticsConfig,
StorageConnector storageConnector,
String path)
Create a feature group object.
|
StorageConnector.AdlsConnector |
getAdlsConnector(String name)
Get a previously created Adls compliant storage connector from the feature store.
|
StorageConnector.BigqueryConnector |
getBigqueryConnector(String name)
Get a previously created BigQuery compliant storage connector from the feature store.
|
abstract Object |
getFeatureView(String name) |
abstract Object |
getFeatureView(@NonNull String name,
@NonNull Integer version) |
StorageConnector.GcsConnector |
getGcsConnector(String name)
Get a previously created Gcs compliant storage connector from the feature store.
|
StorageConnector.HopsFsConnector |
getHopsFsConnector(String name)
Get a previously created HopsFs compliant storage connector from the feature store.
|
StorageConnector.JdbcConnector |
getJdbcConnector(String name)
Get a previously created JDBC compliant storage connector from the feature store.
|
StorageConnector.KafkaConnector |
getKafkaConnector(String name)
Get a previously created Kafka compliant storage connector from the feature store.
|
StorageConnector.JdbcConnector |
getOnlineStorageConnector()
Get a previously created JDBC compliant storage connector from the feature store
to connect to the online feature store.
|
abstract FeatureGroupBase |
getOrCreateStreamFeatureGroup(@NonNull String name,
Integer version,
String description,
Boolean onlineEnabled,
TimeTravelFormat timeTravelFormat,
List<String> primaryKeys,
List<String> partitionKeys,
String eventTime,
String hudiPrecombineKey,
List<Feature> features,
StatisticsConfig statisticsConfig,
StorageConnector storageConnector,
String path)
Get a feature group metadata object or create a new one if it doesn't exists.
|
StorageConnector.RedshiftConnector |
getRedshiftConnector(String name)
Get a previously created Redshift compliant storage connector from the feature store.
|
StorageConnector.S3Connector |
getS3Connector(String name)
Get a previously created S3 compliant storage connector from the feature store.
|
StorageConnector.SnowflakeConnector |
getSnowflakeConnector(String name)
Get a previously created Snowflake compliant storage connector from the feature store.
|
StorageConnector |
getStorageConnector(String name)
Get a previously created storage connector from the feature store.
|
abstract Object |
getStreamFeatureGroup(String name)
Get a feature group object with default version `1` from the feature store.
|
abstract Object |
getStreamFeatureGroup(@NonNull String name,
@NonNull Integer version)
Get a feature group object from the feature store.
|
String |
toString() |
protected FeatureGroupApi featureGroupApi
protected TrainingDatasetApi trainingDatasetApi
protected StorageConnectorApi storageConnectorApi
protected static final org.slf4j.Logger LOGGER
protected static final Integer DEFAULT_VERSION
public abstract FeatureGroupBase createStreamFeatureGroup(@NonNull @NonNull String name, Integer version, String description, Boolean onlineEnabled, TimeTravelFormat timeTravelFormat, List<String> primaryKeys, List<String> partitionKeys, String eventTime, String hudiPrecombineKey, List<Feature> features, StatisticsConfig statisticsConfig, StorageConnector storageConnector, String path)
name
- the name of the feature groupversion
- the version of the feature groupdescription
- descrption of the feature grouponlineEnabled
- whether the feature group should be online enabledtimeTravelFormat
- the data format to use to store the offline dataprimaryKeys
- list of primary keyspartitionKeys
- list of partition keyseventTime
- the feature/column to use as event timehudiPrecombineKey
- if the timeTravelFormat is set to hudi, the feature/column to use as precombine keyfeatures
- the list of feature objects if defined explicitlystatisticsConfig
- the statistics configuration for the feature groupstorageConnector
- the storage connector to use to store the offline
feature data (Default stored internally in Hopsworks).path
- the path on the storage where to store the feature data.public abstract FeatureGroupBase getOrCreateStreamFeatureGroup(@NonNull @NonNull String name, Integer version, String description, Boolean onlineEnabled, TimeTravelFormat timeTravelFormat, List<String> primaryKeys, List<String> partitionKeys, String eventTime, String hudiPrecombineKey, List<Feature> features, StatisticsConfig statisticsConfig, StorageConnector storageConnector, String path) throws IOException, FeatureStoreException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StreamFeatureGroup streamFeatureGroup = featureStore.getOrCreateStreamFeatureGroup(
"doc_example",
1,
"Feature group for example in documentation",
true,
TimeTravelFormat.HUDI,
Collections.singletonList("primary_key"),
Collections.singletonList("partition_key"),
"event_time",
null,
features,
null,
new StatisticsConfig(true, true, true, true),
null
);
streamFeatureGroup.save()
name
- the name of the feature groupversion
- the version of the feature groupdescription
- descrption of the feature grouponlineEnabled
- whether the feature group should be online enabledtimeTravelFormat
- the data format to use to store the offline dataprimaryKeys
- list of primary keyspartitionKeys
- list of partition keyseventTime
- the feature/column to use as event timehudiPrecombineKey
- if the timeTravelFormat is set to hudi, the feature/column to use as precombine keyfeatures
- the list of feature objects if defined explicitlystatisticsConfig
- the statistics configuration for the feature groupstorageConnector
- the storage connector to use to store the offline
feature data (Default stored internally in Hopsworks).path
- the path on the storage where to store the feature data.IOException
FeatureStoreException
public abstract Object getStreamFeatureGroup(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException
name
- the name of the feature groupversion
- the version of the feature groupFeatureStoreException
IOException
public abstract Object getStreamFeatureGroup(String name) throws FeatureStoreException, IOException
name
- the name of the feature groupFeatureStoreException
IOException
public abstract Object getFeatureView(String name) throws FeatureStoreException, IOException
FeatureStoreException
IOException
public abstract Object getFeatureView(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException
FeatureStoreException
IOException
public StorageConnector getStorageConnector(String name) throws FeatureStoreException, IOException
Storage connectors encapsulate all information needed for the execution engine to read and write to a specific storage.
If you want to connect to the online feature store, see the getOnlineStorageConnector` method to get the JDBC connector for the Online Feature Store.
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector sc = fs.getStorageConnector("sc_name");
name
- Name of the storage connector to retrieve.FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.public StorageConnector.HopsFsConnector getHopsFsConnector(String name) throws FeatureStoreException, IOException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector.HopsFsConnector hfsSc = fs.getHopsFsConnector("hfs_sc_name");
name
- Name of the storage connector to retrieve.FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.public StorageConnector.JdbcConnector getJdbcConnector(String name) throws FeatureStoreException, IOException
If you want to connect to the online feature store, see the getOnlineStorageConnector` method to get the JDBC connector for the Online Feature Store.
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector.JdbcConnector jdbcSc = fs.getJdbcConnector("jdbc_sc_name");
name
- Name of the jdbc storage connector to retrieve.FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.public StorageConnector.JdbcConnector getOnlineStorageConnector() throws FeatureStoreException, IOException
//get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector.JdbcConnector onlineSc = fs.getOnlineStorageConnector("online_sc_name");
FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.public StorageConnector.S3Connector getS3Connector(String name) throws FeatureStoreException, IOException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector.S3Connector s3Sc = fs.getS3Connector("s3_sc_name");
name
- Name of the storage connector to retrieve.FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.public StorageConnector.RedshiftConnector getRedshiftConnector(String name) throws FeatureStoreException, IOException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector.RedshiftConnector rshSc = fs.getRedshiftConnector("rsh_sc_name");
name
- Name of the storage connector to retrieve.FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.public StorageConnector.SnowflakeConnector getSnowflakeConnector(String name) throws FeatureStoreException, IOException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector.SnowflakeConnector snflSc = fs.getSnowflakeConnector("snfl_sc_name");
name
- Name of the storage connector to retrieve.FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.public StorageConnector.AdlsConnector getAdlsConnector(String name) throws FeatureStoreException, IOException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector.AdlsConnectorr adlslSc = fs.getAdlsConnector("adls_sc_name");
name
- Name of the storage connector to retrieve.FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.public StorageConnector.KafkaConnector getKafkaConnector(String name) throws FeatureStoreException, IOException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector.KafkaConnector kafkaSc = fs.getKafkaConnector("kafka_sc_name");
name
- Name of the storage connector to retrieve.FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.public StorageConnector.BigqueryConnector getBigqueryConnector(String name) throws FeatureStoreException, IOException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector.BigqueryConnector bigqSc = fs.getBigqueryConnector("bigq_sc_name");
name
- Name of the storage connector to retrieve.FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.public StorageConnector.GcsConnector getGcsConnector(String name) throws FeatureStoreException, IOException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StorageConnector.GcsConnector gcsSc = fs.getGcsConnector("gsc_sc_name");
name
- Name of the storage connector to retrieve.FeatureStoreException
- If unable to retrieve StorageConnector from the feature store.IOException
- Generic IO exception.Copyright © 2025. All rights reserved.