-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathregistry_store.py
More file actions
49 lines (37 loc) · 1.24 KB
/
registry_store.py
File metadata and controls
49 lines (37 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from abc import ABC, abstractmethod
from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto
class RegistryStore(ABC):
"""
A registry store is a storage backend for the Feast registry.
"""
@abstractmethod
def get_registry_proto(self) -> RegistryProto:
"""
Retrieves the registry proto from the registry path. If there is no file at that path,
raises a FileNotFoundError.
Returns:
Returns either the registry proto stored at the registry path, or an empty registry proto.
"""
raise NotImplementedError
@abstractmethod
def update_registry_proto(self, registry_proto: RegistryProto):
"""
Overwrites the current registry proto with the proto passed in. This method
writes to the registry path.
Args:
registry_proto: the new RegistryProto
"""
pass
@abstractmethod
def teardown(self):
"""
Tear down the registry.
"""
pass
class NoopRegistryStore(RegistryStore):
def get_registry_proto(self) -> RegistryProto:
return RegistryProto()
def update_registry_proto(self, registry_proto: RegistryProto):
pass
def teardown(self):
pass