| 165 | |
| 166 | |
| 167 | class Registry(BaseRegistry): |
| 168 | def apply_user_metadata( |
| 169 | self, |
| 170 | project: str, |
| 171 | feature_view: BaseFeatureView, |
| 172 | metadata_bytes: Optional[bytes], |
| 173 | ): |
| 174 | pass |
| 175 | |
| 176 | def get_user_metadata( |
| 177 | self, project: str, feature_view: BaseFeatureView |
| 178 | ) -> Optional[bytes]: |
| 179 | pass |
| 180 | |
| 181 | def set_project_metadata(self, project: str, key: str, value: str): |
| 182 | """Set a custom project metadata key-value pair in the registry backend.""" |
| 183 | if hasattr(self._registry_store, "set_project_metadata"): |
| 184 | self._registry_store.set_project_metadata(project, key, value) |
| 185 | else: |
| 186 | raise NotImplementedError( |
| 187 | "set_project_metadata not implemented for this registry backend" |
| 188 | ) |
| 189 | |
| 190 | def get_project_metadata(self, project: str, key: str) -> Optional[str]: |
| 191 | """Get a custom project metadata value by key from the registry backend.""" |
| 192 | if hasattr(self._registry_store, "get_project_metadata"): |
| 193 | return self._registry_store.get_project_metadata(project, key) |
| 194 | else: |
| 195 | raise NotImplementedError( |
| 196 | "get_project_metadata not implemented for this registry backend" |
| 197 | ) |
| 198 | |
| 199 | # The cached_registry_proto object is used for both reads and writes. In particular, |
| 200 | # all write operations refresh the cache and modify it in memory; the write must |
| 201 | # then be persisted to the underlying RegistryStore with a call to commit(). |
| 202 | cached_registry_proto: RegistryProto |
| 203 | cached_registry_proto_created: datetime |
| 204 | cached_registry_proto_ttl: timedelta |
| 205 | |
| 206 | def __init__( |
| 207 | self, |
| 208 | project: str, |
| 209 | registry_config: Optional[RegistryConfig], |
| 210 | repo_path: Optional[Path], |
| 211 | auth_config: AuthConfig = NoAuthConfig(), |
| 212 | ): |
| 213 | """ |
| 214 | Create the Registry object. |
| 215 | |
| 216 | Args: |
| 217 | registry_config: RegistryConfig object containing the destination path and cache ttl, |
| 218 | repo_path: Path to the base of the Feast repository |
| 219 | or where it will be created if it does not exist yet. |
| 220 | """ |
| 221 | |
| 222 | self._refresh_lock = Lock() |
| 223 | self._auth_config = auth_config |
| 224 |
no outgoing calls