def plan_infra(self, config: RepoConfig, desired_registry_proto: RegistryProto) -> Infra: infra = Infra() if self.online_store: infra_objects: List[InfraObject] = self.online_store.plan( config, desired_registry_proto) infra.infra_objects += infra_objects return infra
def plan_infra(self, config: RepoConfig, desired_registry_proto: RegistryProto) -> Infra: """ Returns the Infra required to support the desired registry. Args: config: The RepoConfig for the current FeatureStore. desired_registry_proto: The desired registry, in proto form. """ return Infra()
def get_infra(self, project: str, allow_cache: bool = False) -> Infra: """ Retrieves the stored Infra object. Args: project: Feast project that the Infra object refers to allow_cache: Whether to allow returning this entity from a cached registry Returns: The stored Infra object. """ registry_proto = self._get_registry_proto(allow_cache=allow_cache) return Infra.from_proto(registry_proto.infra)
def update_infra(self, infra: Infra, project: str, commit: bool = True): """ Updates the stored Infra object. Args: infra: The new Infra object to be stored. project: Feast project that the Infra object refers to commit: Whether the change should be persisted immediately """ self._prepare_registry_for_changes() assert self.cached_registry_proto self.cached_registry_proto.infra.CopyFrom(infra.to_proto()) if commit: self.commit()