Class FeastClient

    • Constructor Detail

      • FeastClient

        protected FeastClient​(io.grpc.ManagedChannel channel,
                              Optional<io.grpc.CallCredentials> credentials)
    • Method Detail

      • create

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

        public static FeastClient createSecure​(String host,
                                               int port,
                                               SecurityConfig securityConfig)
        Create a authenticated client that can access Feast serving with authentication enabled. Supports the CallCredentials in the feast.common.auth.credentials package.
        Parameters:
        host - hostname or ip address of Feast serving GRPC server
        port - port number of Feast serving GRPC server
        securityConfig - security options to configure the Feast client. See SecurityConfig for options.
        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 override. If specifed uses the project for retrieval. Overrides the projects set in Feature References if also specified.
        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 override. If specifed uses the project for retrieval. Overrides the projects set in Feature References if also specified.
        omitEntitiesInResponse - if true, the returned Row will not contain field and value for the entity
        Returns:
        list of Row containing retrieved data fields.