proxystore.store.endpoint
EndpointStore Implementation.
EndpointStoreKey ¶
Bases: NamedTuple
Key to object in an Endpoint.
EndpointStore ¶
EndpointStore(
name: str,
*,
endpoints: Sequence[str | UUID],
proxystore_dir: str | None = None,
cache_size: int = 16,
stats: bool = False
) -> None
Bases: Store[EndpointStoreKey]
EndpointStore backend class.
Warning
Specifying a custom proxystore_dir
can cause problems if the
proxystore_dir
is not the same on all systems that a proxy
created by this store could end up on. It is recommended to leave
the proxystore_dir
unspecified so the correct default directory
will be used.
Parameters:
-
name
(
str
) –Name of the store instance (default: None).
-
endpoints
(
Sequence[str | UUID]
) –Sequence of valid and running endpoint UUIDs to use. At least one of these endpoints must be accessible by this process.
-
proxystore_dir
(
str | None
) –Optionally specify the proxystore home directory. Defaults to [
home_dir()
[proxystore.utils.home_dir]. -
cache_size
(
int
) –Size of LRU cache (in # of objects). If 0, the cache is disabled. The cache is local to the Python process.
-
stats
(
bool
) –Collect stats on store operations.
Raises:
-
ValueError
–If endpoints is an empty list.
-
EndpointStoreError
–If unable to connect to one of the endpoints provided.
Source code in proxystore/store/endpoint.py
evict ¶
Evict object associated with key.
Parameters:
-
key
(
EndpointStoreKey
) –Key corresponding to object in store to evict.
Raises:
-
EndpointStoreError
–If the Endpoint returns a non-200 status code.
Source code in proxystore/store/endpoint.py
exists ¶
Check if key exists.
Parameters:
-
key
(
EndpointStoreKey
) –Key to check.
Raises:
-
EndpointStoreError
–If the Endpoint returns a non-200 status code.
Source code in proxystore/store/endpoint.py
get_bytes ¶
Get serialized object from remote store.
Parameters:
-
key
(
EndpointStoreKey
) –Key corresponding to object.
Returns:
-
bytes | None
–Serialized object or
None
if it does not exist on the endpoint.
Raises:
-
EndpointStoreError
–If the Endpoint returns a status code other than 200 (success) or 400 (missing key).
Source code in proxystore/store/endpoint.py
set_bytes ¶
Set serialized object in remote store with key.
Parameters:
-
key
(
EndpointStoreKey
) –Key corresponding to object.
-
data
(
bytes
) –Serialized object.
Raises:
-
EndpointStoreError
–If the endpoint does not return a 200 status code for success.