Class FeastClient

    • Method Detail

      • create

        public static FeastClient create​(String host,
                                         int port)
        Create a client to access Feast
        Parameters:
        host - hostname or ip address of Feast serving GRPC server
        port - port number of Feast serving GRPC server
        Returns:
        FeastClient
      • getOnlineFeatures

        public List<Row> getOnlineFeatures​(List<String> featureRefs,
                                           List<Row> rows)
        Get online features from Feast from FeatureSets

        See getOnlineFeatures(List, List, String, boolean)

        Parameters:
        featureRefs - list of string feature references to retrieve in the following format featureSet:feature, where 'featureSet' and 'feature' refer to the FeatureSet and Feature names respectively. Only the Feature name is required.
        rows - list of Row to select the entities to retrieve the features for.
        Returns:
        list of Row containing retrieved data fields.
      • getOnlineFeatures

        public List<Row> getOnlineFeatures​(List<String> featureRefs,
                                           List<Row> rows,
                                           String project)
        Get online features from Feast.

        See getOnlineFeatures(List, List, String, boolean)

        Parameters:
        featureRefs - list of string feature references to retrieve in the following format featureSet:feature, where 'featureSet' and 'feature' refer to the FeatureSet and Feature names respectively. Only the Feature name is required.
        rows - list of Row to select the entities to retrieve the features for
        project - String Specifies the project which contains the FeatureSets which the Feature requested belong to.
        Returns:
        list of Row containing retrieved data fields.
      • getOnlineFeatures

        public List<Row> getOnlineFeatures​(List<String> featureRefs,
                                           List<Row> rows,
                                           String project,
                                           boolean omitEntitiesInResponse)
        Get online features from Feast.

        Example of retrieving online features for the driver featureset, with features driver_id and driver_name

        
         FeastClient client = FeastClient.create("localhost", 6566);
         List<String> requestedFeatureIds = Arrays.asList("driver:driver_id", "driver:driver_name");
         List<Row> requestedRows =
                 Arrays.asList(Row.create().set("driver_id", 123), Row.create().set("driver_id", 456));
         List<Row> retrievedFeatures = client.getOnlineFeatures(requestedFeatureIds, requestedRows);
         retrievedFeatures.forEach(System.out::println);
         
        Parameters:
        featureRefs - list of string feature references to retrieve in the following format featureSet:feature, where 'featureSet' and 'feature' refer to the FeatureSet and Feature names respectively. Only the Feature name is required.
        rows - list of Row to select the entities to retrieve the features for
        project - String Specifies the project which contains the FeatureSets which the Feature requested belong to.
        omitEntitiesInResponse - if true, the returned Row will not contain field and value for the entity
        Returns:
        list of Row containing retrieved data fields.