Package com.logicalclocks.hsfs
Class FeatureStoreBase<T2 extends QueryBase>
java.lang.Object
com.logicalclocks.hsfs.FeatureStoreBase<T2>
- Direct Known Subclasses:
FeatureStore,FeatureStore,FeatureStore,FeatureStore
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Integerprotected FeatureGroupApiprotected static final org.slf4j.Loggerprotected StorageConnectorApiprotected TrainingDatasetApi -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract FeatureGroupBasecreateStreamFeatureGroup(@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, DataSource dataSource) Create a stream feature group object.abstract FeatureGroupBasecreateStreamFeatureGroup(@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) Deprecated.getAdlsConnector(String name) Get a previously created Adls compliant storage connector from the feature store.getBigqueryConnector(String name) Get a previously created BigQuery compliant storage connector from the feature store.getDataSource(String name) Get a previously created data source from the feature store.abstract ObjectgetFeatureView(@NonNull String name, @NonNull Integer version) abstract ObjectgetFeatureView(String name) getGcsConnector(String name) Get a previously created Gcs compliant storage connector from the feature store.getHopsFsConnector(String name) Get a previously created HopsFs compliant storage connector from the feature store.getJdbcConnector(String name) Get a previously created JDBC compliant storage connector from the feature store.getKafkaConnector(String name) Get a previously created Kafka compliant storage connector from the feature store.Get a previously created JDBC compliant storage connector from the feature store to connect to the online feature store.abstract FeatureGroupBasegetOrCreateStreamFeatureGroup(@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, DataSource dataSource, OnlineConfig onlineConfig) Get a stream feature group metadata object or create a new one if it doesn't exist.abstract FeatureGroupBasegetOrCreateStreamFeatureGroup(@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, OnlineConfig onlineConfig) getRedshiftConnector(String name) Get a previously created Redshift compliant storage connector from the feature store.getS3Connector(String name) Get a previously created S3 compliant storage connector from the feature store.getSnowflakeConnector(String name) Get a previously created Snowflake compliant storage connector from the feature store.abstract ObjectgetSqlConnector(String name) getStorageConnector(String name) Get a previously created storage connector from the feature store.abstract ObjectgetStreamFeatureGroup(@NonNull String name, @NonNull Integer version) Get a feature group object from the feature store.abstract ObjectgetStreamFeatureGroup(String name) Get a feature group object with default version `1` from the feature store.toString()
-
Field Details
-
featureGroupApi
-
trainingDatasetApi
-
storageConnectorApi
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
DEFAULT_VERSION
-
-
Constructor Details
-
FeatureStoreBase
public FeatureStoreBase()
-
-
Method Details
-
createStreamFeatureGroup
@Deprecated 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) Deprecated.Create a feature group object.- Parameters:
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.- Returns:
- The feature group metadata object.
-
createStreamFeatureGroup
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, DataSource dataSource) Create a stream feature group object.- Parameters:
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 groupdataSource- the data source specifying the location of the data.- Returns:
- The feature group metadata object.
-
getOrCreateStreamFeatureGroup
@Deprecated 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, OnlineConfig onlineConfig) throws IOException, FeatureStoreException Deprecated.Get a feature group metadata object or create a new one if it doesn't exists.- Parameters:
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.- Returns:
- The feature group metadata object.
- Throws:
IOExceptionFeatureStoreException
-
getOrCreateStreamFeatureGroup
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, DataSource dataSource, OnlineConfig onlineConfig) throws IOException, FeatureStoreException Get a stream feature group metadata object or create a new one if it doesn't exist.- Parameters:
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 groupdataSource- the data source specifying the location of the data.onlineConfig- the online configuration for the feature group.- Returns:
- The feature group metadata object.
- Throws:
IOExceptionFeatureStoreException
-
getStreamFeatureGroup
public abstract Object getStreamFeatureGroup(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException Get a feature group object from the feature store.- Parameters:
name- the name of the feature groupversion- the version of the feature group- Returns:
- FeatureGroup
- Throws:
FeatureStoreExceptionIOException
-
getStreamFeatureGroup
Get a feature group object with default version `1` from the feature store.- Parameters:
name- the name of the feature group- Returns:
- FeatureGroup
- Throws:
FeatureStoreExceptionIOException
-
getFeatureView
- Throws:
FeatureStoreExceptionIOException
-
getFeatureView
public abstract Object getFeatureView(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException - Throws:
FeatureStoreExceptionIOException
-
getStorageConnector
Get a previously created storage connector from the feature store.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");- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getDataSource
Get a previously created data source from the feature store.data sources 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 getOnlineDataSource` method to get the JDBC connector for the Online Feature Store.
// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); DataSource ds = fs.getDataSource("ds_name");- Parameters:
name- Name of the data source to retrieve.- Returns:
- DataSource Data source object.
- Throws:
FeatureStoreException- If unable to retrieve DataSource from the feature store.IOException- Generic IO exception.
-
getHopsFsConnector
public StorageConnector.HopsFsConnector getHopsFsConnector(String name) throws FeatureStoreException, IOException Get a previously created HopsFs compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.HopsFsConnector hfsSc = fs.getHopsFsConnector("hfs_sc_name");- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.HopsFsConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getJdbcConnector
public StorageConnector.JdbcConnector getJdbcConnector(String name) throws FeatureStoreException, IOException Get a previously created JDBC compliant storage connector from the feature store.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");- Parameters:
name- Name of the jdbc storage connector to retrieve.- Returns:
- StorageConnector.JdbcConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getSqlConnector
- Throws:
FeatureStoreExceptionIOException
-
getOnlineStorageConnector
public StorageConnector.JdbcConnector getOnlineStorageConnector() throws FeatureStoreException, IOExceptionGet a previously created JDBC compliant storage connector from the feature store to connect to the online feature store.//get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.JdbcConnector onlineSc = fs.getOnlineStorageConnector("online_sc_name");- Returns:
- StorageConnector.JdbcConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getS3Connector
public StorageConnector.S3Connector getS3Connector(String name) throws FeatureStoreException, IOException Get a previously created S3 compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.S3Connector s3Sc = fs.getS3Connector("s3_sc_name");- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.S3Connector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getRedshiftConnector
public StorageConnector.RedshiftConnector getRedshiftConnector(String name) throws FeatureStoreException, IOException Get a previously created Redshift compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.RedshiftConnector rshSc = fs.getRedshiftConnector("rsh_sc_name");- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.RedshiftConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getSnowflakeConnector
public StorageConnector.SnowflakeConnector getSnowflakeConnector(String name) throws FeatureStoreException, IOException Get a previously created Snowflake compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.SnowflakeConnector snflSc = fs.getSnowflakeConnector("snfl_sc_name");- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.SnowflakeConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getAdlsConnector
public StorageConnector.AdlsConnector getAdlsConnector(String name) throws FeatureStoreException, IOException Get a previously created Adls compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.AdlsConnectorr adlslSc = fs.getAdlsConnector("adls_sc_name");- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.AdlsConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getKafkaConnector
public StorageConnector.KafkaConnector getKafkaConnector(String name) throws FeatureStoreException, IOException Get a previously created Kafka compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.KafkaConnector kafkaSc = fs.getKafkaConnector("kafka_sc_name");- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.KafkaConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getBigqueryConnector
public StorageConnector.BigqueryConnector getBigqueryConnector(String name) throws FeatureStoreException, IOException Get a previously created BigQuery compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.BigqueryConnector bigqSc = fs.getBigqueryConnector("bigq_sc_name");- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.BigqueryConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getGcsConnector
public StorageConnector.GcsConnector getGcsConnector(String name) throws FeatureStoreException, IOException Get a previously created Gcs compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.GcsConnector gcsSc = fs.getGcsConnector("gsc_sc_name");- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.GcsConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
toString
-
createStreamFeatureGroup(String, Integer, String, Boolean, TimeTravelFormat, List, List, String, String, List, StatisticsConfig, DataSource)instead.